41 #ifndef __OPENFLUID_TOOLS_DISTRIBUTIONBINDINGS_HPP__
42 #define __OPENFLUID_TOOLS_DISTRIBUTIONBINDINGS_HPP__
51 #include <openfluid/config.hpp>
57 inline std::vector<openfluid::tools::ClassIDVar>
60 std::vector<openfluid::tools::ClassIDVar> CSVTriplets;
61 int Begin = RemoveFirst ? 1 : 0;
62 for (std::size_t i=Begin;i<StringArray.size();i++)
64 const std::string& Column = StringArray[i];
66 std::size_t HashPosition = Column.find(openfluid::config::CHAR_SEPARATOR_UNIT);
67 std::size_t ColonPosition = Column.find(openfluid::config::CHAR_SEPARATOR_VAR);
69 if(HashPosition == std::string::npos || ColonPosition == std::string::npos)
76 CurrentCSVTriplet.
UnitsClass = Column.substr(0,HashPosition);
77 CurrentCSVTriplet.
UnitsIDsStr = Column.substr(HashPosition+1, ColonPosition-HashPosition-1);
78 CurrentCSVTriplet.
VariableName = Column.substr(ColonPosition+1);
80 CSVTriplets.push_back(CurrentCSVTriplet);
91 bool RemoveFirst=
false)
100 template<
typename DataType=
double>
120 template<
typename DataType=
double>
155 bool DataFound =
true;
158 if ((RNV.isAvailable && RNV.NextValue.first < DT) ||
159 RNV.isAvailable ==
false)
161 RNV.isAvailable =
false;
163 while (DataFound && !RNV.isAvailable)
165 DataFound = RNV.Reader->getNextValue(CI);
166 if (DataFound && CI.first >= DT)
168 RNV.isAvailable =
true;
184 bool AvailableFound =
false;
189 if (!AvailableFound && RNV.isAvailable)
191 NDT = RNV.NextValue.first;
192 AvailableFound =
true;
203 if (RNV.isAvailable && RNV.NextValue.first < NDT)
205 NDT = RNV.NextValue.first;
225 typedef std::map<openfluid::core::UnitID_t,ReaderNextValue<double>*>
UnitIDReader_t;
259 inline static const std::string s_MissingValueString =
"NA";
265 const std::string& DateFormat =
"%Y%m%dT%H%M%S",
266 const std::string& ColSeparators =
";");
282 return m_ColBySelectionTriplets;
Definition: FrameworkException.hpp:51
Class for management of date and time information.
Definition: DateTime.hpp:88
void addSeconds(const RawTime_t &Seconds)
Definition: DoubleValue.hpp:81
#define OPENFLUID_API
Definition: dllexport.hpp:86
unsigned int UnitID_t
Definition: TypeDefs.hpp:70
std::string VariableName_t
Definition: TypeDefs.hpp:131
std::string UnitsClass_t
Definition: TypeDefs.hpp:98
Definition: ApplicationException.hpp:47