Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef __VARIABLES_HPP__
00034 #define __VARIABLES_HPP__
00035
00036 #include <openfluid/core/TypeDefs.hpp>
00037 #include <openfluid/core/ValuesBuffer.hpp>
00038 #include <openfluid/dllexport.hpp>
00039
00040 namespace openfluid {
00041 namespace core {
00042
00043 class DLLEXPORT Variables
00044 {
00045 private:
00046
00047 typedef std::map<VariableName_t, std::pair<ValuesBuffer,Value::Type> > VariablesMap_t;
00048 VariablesMap_t m_Data;
00049
00050 public:
00051
00052 Variables();
00053
00054 ~Variables();
00055
00056 bool createVariable(const VariableName_t& aName);
00057
00058 bool createVariable(const VariableName_t& aName, const Value::Type& aType);
00059
00060 bool modifyValue(const VariableName_t& aName, const TimeIndex_t& anIndex,
00061 const Value& aValue);
00062
00063 bool modifyCurrentValue(const VariableName_t& aName, const Value& aValue);
00064
00065 bool appendValue(const VariableName_t& aName, const TimeIndex_t& anIndex, const Value& aValue);
00066
00067 bool getValue(const VariableName_t& aName, const TimeIndex_t& anIndex,
00068 Value* aValue) const;
00069
00070 Value* getValue(const VariableName_t& aName, const TimeIndex_t& anIndex) const;
00071
00072 Value* getCurrentValue(const VariableName_t& aName) const;
00073
00074 bool getCurrentValue(const VariableName_t& aName, Value* aValue) const;
00075
00076 bool getLatestIndexedValue(const VariableName_t& aName, IndexedValue& IndValue) const;
00077
00078 bool getLatestIndexedValues(const VariableName_t& aName, const TimeIndex_t& anIndex, IndexedValueList& IndValueList) const;
00079
00080 bool getIndexedValues(const VariableName_t& aName,
00081 const TimeIndex_t& aBeginIndex, const TimeIndex_t& anEndIndex,
00082 IndexedValueList& IndValueList) const;
00083
00084 bool getCurrentValueIfIndex(const VariableName_t& aName, const TimeIndex_t& Index, Value* aValue) const;
00085
00086 Value* getCurrentValueIfIndex(const VariableName_t& aName, const TimeIndex_t& Index) const;
00087
00088 bool isVariableExist(const VariableName_t& aName) const;
00089
00090 bool isVariableExist(const VariableName_t& aName, const TimeIndex_t& anIndex) const;
00091
00092 bool isVariableExist(const VariableName_t& aName, const TimeIndex_t& anIndex,
00093 Value::Type ValueType) const;
00094
00095 bool isTypedVariableExist(const VariableName_t& aName, const Value::Type& VarType) const;
00096
00097 bool isTypedVariableExist(const VariableName_t& aName, const TimeIndex_t& anIndex,
00098 const Value::Type& VarType) const;
00099
00100 std::vector<VariableName_t> getVariablesNames() const;
00101
00102 int getVariableValuesCount(const VariableName_t& aName) const;
00103
00104 bool isAllVariablesCount(unsigned int Count) const;
00105
00106 void clear();
00107
00108 void displayContent(const VariableName_t& aName, std::ostream& OStream) const;
00109
00110 };
00111
00112 } }
00113
00114
00115 #endif