value_8hpp.tex 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. \hypertarget{value_8hpp}{}\section{/home/caleb/\+Sources/\+T\+T\+T\+T/filval/value.hpp File Reference}
  2. \label{value_8hpp}\index{/home/caleb/\+Sources/\+T\+T\+T\+T/filval/value.\+hpp@{/home/caleb/\+Sources/\+T\+T\+T\+T/filval/value.\+hpp}}
  3. {\ttfamily \#include $<$iomanip$>$}\newline
  4. {\ttfamily \#include $<$iostream$>$}\newline
  5. {\ttfamily \#include $<$sstream$>$}\newline
  6. {\ttfamily \#include $<$utility$>$}\newline
  7. {\ttfamily \#include $<$algorithm$>$}\newline
  8. {\ttfamily \#include $<$map$>$}\newline
  9. {\ttfamily \#include $<$vector$>$}\newline
  10. {\ttfamily \#include $<$tuple$>$}\newline
  11. {\ttfamily \#include $<$initializer\+\_\+list$>$}\newline
  12. {\ttfamily \#include $<$functional$>$}\newline
  13. {\ttfamily \#include \char`\"{}log.\+hpp\char`\"{}}\newline
  14. Include dependency graph for value.\+hpp\+:
  15. \nopagebreak
  16. \begin{figure}[H]
  17. \begin{center}
  18. \leavevmode
  19. \includegraphics[width=350pt]{value_8hpp__incl}
  20. \end{center}
  21. \end{figure}
  22. This graph shows which files directly or indirectly include this file\+:
  23. \nopagebreak
  24. \begin{figure}[H]
  25. \begin{center}
  26. \leavevmode
  27. \includegraphics[width=341pt]{value_8hpp__dep__incl}
  28. \end{center}
  29. \end{figure}
  30. \subsection*{Classes}
  31. \begin{DoxyCompactItemize}
  32. \item
  33. class \hyperlink{classfv_1_1Function}{fv\+::\+Function$<$ typename $>$}
  34. \item
  35. class \hyperlink{classfv_1_1GenFunction}{fv\+::\+Gen\+Function}
  36. \begin{DoxyCompactList}\small\item\em Parent class to all \hyperlink{classfv_1_1Function}{Function} classes. \end{DoxyCompactList}\item
  37. class \hyperlink{classfv_1_1Function_3_01R_07ArgTypes_8_8_8_08_4}{fv\+::\+Function$<$ R(\+Arg\+Types...)$>$}
  38. \begin{DoxyCompactList}\small\item\em In order to enable proper provenance tracking, and at the same time keep the ability to embed functions into values, the \hyperlink{classfv_1_1Function}{Function} class should be used. \end{DoxyCompactList}\item
  39. class \hyperlink{classfv_1_1GenValue}{fv\+::\+Gen\+Value}
  40. \item
  41. class \hyperlink{classfv_1_1Value}{fv\+::\+Value$<$ T $>$}
  42. \begin{DoxyCompactList}\small\item\em A generic value. \end{DoxyCompactList}\item
  43. class \hyperlink{classfv_1_1ObservedValue}{fv\+::\+Observed\+Value$<$ T $>$}
  44. \begin{DoxyCompactList}\small\item\em A generic, observed, value. \end{DoxyCompactList}\item
  45. class \hyperlink{classfv_1_1DerivedValue}{fv\+::\+Derived\+Value$<$ T $>$}
  46. \begin{DoxyCompactList}\small\item\em A generic, derived, value. \end{DoxyCompactList}\item
  47. class \hyperlink{classfv_1_1WrapperVector}{fv\+::\+Wrapper\+Vector$<$ T $>$}
  48. \begin{DoxyCompactList}\small\item\em A std\+::vector wrapper around a C-\/style array. \end{DoxyCompactList}\item
  49. class \hyperlink{classfv_1_1Pair}{fv\+::\+Pair$<$ T1, T2 $>$}
  50. \begin{DoxyCompactList}\small\item\em Creates a std\+::pair type from a two other \hyperlink{classfv_1_1Value}{Value} objects. \end{DoxyCompactList}\item
  51. class \hyperlink{classfv_1_1ZipMapFour}{fv\+::\+Zip\+Map\+Four$<$ R, T $>$}
  52. \begin{DoxyCompactList}\small\item\em Takes a set of four \hyperlink{classfv_1_1Value}{Value}$<$std\+::vector$<$\+T$>$ $>$ objects and a function of four Ts and returns a std\+::vector$<$\+R$>$. \end{DoxyCompactList}\item
  53. class \hyperlink{classfv_1_1Count}{fv\+::\+Count$<$ T $>$}
  54. \item
  55. class \hyperlink{classfv_1_1Reduce}{fv\+::\+Reduce$<$ T $>$}
  56. \begin{DoxyCompactList}\small\item\em \hyperlink{classfv_1_1Reduce}{Reduce} a \hyperlink{classfv_1_1Value}{Value} of type vector$<$\+T$>$ to just a T. \end{DoxyCompactList}\item
  57. class \hyperlink{classfv_1_1Max}{fv\+::\+Max$<$ T $>$}
  58. \begin{DoxyCompactList}\small\item\em Find and return the maximum value of a vector. \end{DoxyCompactList}\item
  59. class \hyperlink{classfv_1_1Min}{fv\+::\+Min$<$ T $>$}
  60. \begin{DoxyCompactList}\small\item\em Find and return the minimum value of a vector. \end{DoxyCompactList}\item
  61. class \hyperlink{classfv_1_1Mean}{fv\+::\+Mean$<$ T $>$}
  62. \begin{DoxyCompactList}\small\item\em Calculate the mean value of a vector. \end{DoxyCompactList}\item
  63. class \hyperlink{classfv_1_1Range}{fv\+::\+Range$<$ T $>$}
  64. \begin{DoxyCompactList}\small\item\em Calculate the range of the values in a vector. \end{DoxyCompactList}\item
  65. class \hyperlink{classfv_1_1ElementOf}{fv\+::\+Element\+Of$<$ T $>$}
  66. \begin{DoxyCompactList}\small\item\em Extract the element at a specific index from a vector. \end{DoxyCompactList}\item
  67. class \hyperlink{classfv_1_1ReduceIndex}{fv\+::\+Reduce\+Index$<$ T $>$}
  68. \begin{DoxyCompactList}\small\item\em Similar to \hyperlink{classfv_1_1Reduce}{Reduce}, but returns a pair of a T and an int. \end{DoxyCompactList}\item
  69. class \hyperlink{classfv_1_1MaxIndex}{fv\+::\+Max\+Index$<$ T $>$}
  70. \begin{DoxyCompactList}\small\item\em Find and return the maximum value of a vector and its index. \end{DoxyCompactList}\item
  71. class \hyperlink{classfv_1_1MinIndex}{fv\+::\+Min\+Index$<$ T $>$}
  72. \begin{DoxyCompactList}\small\item\em Find and return the minimum value of a vector and its index. \end{DoxyCompactList}\item
  73. class \hyperlink{classfv_1_1BoundValue}{fv\+::\+Bound\+Value$<$ T $>$}
  74. \begin{DoxyCompactList}\small\item\em A generic value owning only a function object. \end{DoxyCompactList}\item
  75. class \hyperlink{classfv_1_1PointerValue}{fv\+::\+Pointer\+Value$<$ T $>$}
  76. \begin{DoxyCompactList}\small\item\em A \hyperlink{classfv_1_1Value}{Value} of a pointer. \end{DoxyCompactList}\item
  77. class \hyperlink{classfv_1_1ConstantValue}{fv\+::\+Constant\+Value$<$ T $>$}
  78. \begin{DoxyCompactList}\small\item\em A \hyperlink{classfv_1_1Value}{Value} which always returns the same value, supplied in the constructor. \end{DoxyCompactList}\end{DoxyCompactItemize}
  79. \subsection*{Namespaces}
  80. \begin{DoxyCompactItemize}
  81. \item
  82. \hyperlink{namespacefv}{fv}
  83. \begin{DoxyCompactList}\small\item\em The namespace containing all filval classes and functions. \end{DoxyCompactList}\end{DoxyCompactItemize}
  84. \subsection*{Macros}
  85. \begin{DoxyCompactItemize}
  86. \item
  87. \hypertarget{value_8hpp_abda9672baa08af6eea0eba8b7f2b025d}{}\label{value_8hpp_abda9672baa08af6eea0eba8b7f2b025d}
  88. \#define {\bfseries F\+U\+NC}(f)~f, \#f
  89. \end{DoxyCompactItemize}
  90. \subsection*{Typedefs}
  91. \begin{DoxyCompactItemize}
  92. \item
  93. \hypertarget{namespacefv_acc10056e9b78553b6a5b2110e63456e9}{}\label{namespacefv_acc10056e9b78553b6a5b2110e63456e9}
  94. typedef std\+::map$<$ std\+::string, Gen\+Value $\ast$ $>$ {\bfseries fv\+::\+Value\+Set}
  95. \end{DoxyCompactItemize}
  96. \subsection*{Functions}
  97. \begin{DoxyCompactItemize}
  98. \item
  99. \hypertarget{namespacefv_a12225ad5af727a02b469015810b7f83f}{}\label{namespacefv_a12225ad5af727a02b469015810b7f83f}
  100. std\+::ostream \& {\bfseries fv\+::operator$<$$<$} (std\+::ostream \&os, Gen\+Value \&gv)
  101. \end{DoxyCompactItemize}
  102. \subsection{Detailed Description}
  103. \begin{DoxyAuthor}{Author}
  104. Caleb Fangmeier \href{mailto:caleb@fangmeier.tech}{\tt caleb@fangmeier.\+tech}
  105. \end{DoxyAuthor}
  106. \begin{DoxyVersion}{Version}
  107. 0.\+1
  108. \end{DoxyVersion}
  109. \hypertarget{value_8hpp_LICENSE}{}\subsection{L\+I\+C\+E\+N\+SE}\label{value_8hpp_LICENSE}
  110. M\+IT License
  111. Copyright (c) 2017 Caleb Fangmeier
  112. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \char`\"{}\+Software\char`\"{}), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions\+:
  113. The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
  114. T\+HE S\+O\+F\+T\+W\+A\+RE IS P\+R\+O\+V\+I\+D\+ED \char`\"{}\+A\+S I\+S\char`\"{}, W\+I\+T\+H\+O\+UT W\+A\+R\+R\+A\+N\+TY OF A\+NY K\+I\+ND, E\+X\+P\+R\+E\+SS OR I\+M\+P\+L\+I\+ED, I\+N\+C\+L\+U\+D\+I\+NG B\+UT N\+OT L\+I\+M\+I\+T\+ED TO T\+HE W\+A\+R\+R\+A\+N\+T\+I\+ES OF M\+E\+R\+C\+H\+A\+N\+T\+A\+B\+I\+L\+I\+TY, F\+I\+T\+N\+E\+SS F\+OR A P\+A\+R\+T\+I\+C\+U\+L\+AR P\+U\+R\+P\+O\+SE A\+ND N\+O\+N\+I\+N\+F\+R\+I\+N\+G\+E\+M\+E\+NT. IN NO E\+V\+E\+NT S\+H\+A\+LL T\+HE A\+U\+T\+H\+O\+RS OR C\+O\+P\+Y\+R\+I\+G\+HT H\+O\+L\+D\+E\+RS BE L\+I\+A\+B\+LE F\+OR A\+NY C\+L\+A\+IM, D\+A\+M\+A\+G\+ES OR O\+T\+H\+ER L\+I\+A\+B\+I\+L\+I\+TY, W\+H\+E\+T\+H\+ER IN AN A\+C\+T\+I\+ON OF C\+O\+N\+T\+R\+A\+CT, T\+O\+RT OR O\+T\+H\+E\+R\+W\+I\+SE, A\+R\+I\+S\+I\+NG F\+R\+OM, O\+UT OF OR IN C\+O\+N\+N\+E\+C\+T\+I\+ON W\+I\+TH T\+HE S\+O\+F\+T\+W\+A\+RE OR T\+HE U\+SE OR O\+T\+H\+ER D\+E\+A\+L\+I\+N\+GS IN T\+HE S\+O\+F\+T\+W\+A\+RE.\hypertarget{value_8hpp_DESCRIPTION}{}\subsection{D\+E\+S\+C\+R\+I\+P\+T\+I\+ON}\label{value_8hpp_DESCRIPTION}
  115. This header defines a set of generic classes that wrap up \char`\"{}values\char`\"{}. In essence, a Value$<$\+T$>$ object is just something that contains a value of type T and can provide it when requested. The usefulness stems from composing values together with calculations. This enables very clear dependency mapping and a way to know clearly how every value was arrived at. This could be used to, for example, automatically generate commentary for plots that explain the exect calculation used to create it. Or easily making a series of plots contrasting different values that have been composed slightly differently.