00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __freParameterCollection_h
00023 #define __freParameterCollection_h
00024
00025 #include "freParameter.h"
00026 #include "freIDPath.h"
00027
00028 namespace FREE
00029 {
00030
00038 class ParameterCollection: public FREE::XMLStreamObject
00039 {
00040 public:
00041 typedef Parameter::Pointer ParameterPointer;
00042 typedef std::vector<ParameterPointer> ParametersType;
00043
00044 typedef ParameterLayer::ValueCountType ValueCountType;
00045 typedef Parameter::LayerCountType LayerCountType;
00046 typedef ParametersType::size_type ParameterCountType;
00047
00056 Parameter* AddParameter(const std::string& sParameterName, const ValueCountType iLayerSize =1, const LayerCountType iLayerCount =1);
00057
00060 void DeleteParameter(const std::string& sParameterName);
00061
00065 void DeleteParameter(const ParameterCountType index);
00066
00072 void AddParameterLayer(const std::string& sParameterName, bool bCopyValue = true);
00073
00077 void DeleteParameterLayer(const std::string& sParameterName, const LayerCountType iLayer);
00078
00080 virtual void ResetParameters();
00081
00083 virtual void Reset();
00084
00087 bool ParameterExists(const std::string& sParameterName) const;
00088
00090 ParameterCountType Size() const;
00091
00095 ValueCountType ParameterSize(const std::string& sParameterName) const;
00096
00100 LayerCountType ParameterLayerCount(const std::string& sParameterName) const;
00101
00106 ParameterCountType GetParameterIndex(const std::string& sParameterName) const;
00107
00111 std::string GetParameterName(const ParameterCountType& index) const;
00112
00121 bool GetParameterValue(const std::string& sParameterName, std::string& value, const ValueCountType iItemPos = 0, const LayerCountType iLayer = 0) const;
00122
00124 bool GetParameterValue(const std::string& sParameterName, double& value, const ValueCountType iItemPos = 0, const LayerCountType iLayer = 0) const;
00125
00127 bool GetParameterValue(const std::string& sParameterName, int& value, const ValueCountType iItemPos = 0, const LayerCountType iLayer = 0) const;
00128
00130 bool GetParameterValue(const std::string& sParameterName, long& value, const ValueCountType iItemPos = 0, const LayerCountType iLayer = 0) const;
00131
00133 bool GetParameterValue(const std::string& sParameterName, unsigned long& value, const ValueCountType iItemPos = 0, const LayerCountType iLayer = 0) const;
00134
00136 bool GetParameterValue(const std::string& sParameterName, bool& value, const ValueCountType iItemPos = 0, const LayerCountType iLayer = 0) const;
00137
00140 bool GetParameterValueByIDPath(const IDPath& parameterID, std::string& value) const;
00141
00143 bool GetParameterValueByIDPath(const IDPath& parameterID, bool& value) const;
00144
00146 bool GetParameterValueByIDPath(const IDPath& parameterID, double& value) const;
00147
00149 bool GetParameterValueByIDPath(const IDPath& parameterID, int& value) const;
00150
00152 bool GetParameterValueByIDPath(const IDPath& parameterID, long& value) const;
00153
00155 bool GetParameterValueByIDPath(const IDPath& parameterID, unsigned long& value) const;
00156
00162 bool GetParameterDataString(const std::string& sParameterName, std::string& sData) const;
00163
00168 Parameter* GetParameter(const std::string& sParameterName) const;
00169
00174 Parameter* GetParameter(ParameterCountType index) const;
00175
00183 bool SetParameterValue(const std::string& sParameterName, const bool value, const ValueCountType iItemPos = 0, const LayerCountType iLayer = 0);
00184
00187 bool SetParameterValue(const std::string& sParameterName, const double value, const ValueCountType iItemPos = 0, const LayerCountType iLayer = 0);
00188
00191 bool SetParameterValue(const std::string& sParameterName, const int value, const ValueCountType iItemPos = 0, const LayerCountType iLayer = 0);
00192
00195 bool SetParameterValue(const std::string& sParameterName, const long value, const ValueCountType iItemPos = 0, const LayerCountType iLayer = 0);
00196
00199 bool SetParameterValue(const std::string& sParameterName, const unsigned long value, const ValueCountType iItemPos = 0, const LayerCountType iLayer = 0);
00200
00203 bool SetParameterValue(const std::string& sParameterName, const std::string& value, const ValueCountType iItemPos = 0, const LayerCountType iLayer = 0);
00204
00207 bool SetParameterValueByIDPath(const IDPath& parameterID, std::string& value);
00208
00210 bool SetParameterValueByIDPath(const IDPath& parameterID, bool& value);
00211
00213 bool SetParameterValueByIDPath(const IDPath& parameterID, double& value);
00214
00216 bool SetParameterValueByIDPath(const IDPath& parameterID, int& value);
00217
00219 bool SetParameterValueByIDPath(const IDPath& parameterID, long& value);
00220
00222 bool SetParameterValueByIDPath(const IDPath& parameterID, unsigned long& value);
00223
00225 virtual ParameterCollection& operator = (const ParameterCollection& rParameterCollection);
00226
00227 ParameterCollection();
00228
00230 ParameterCollection( const ParameterCollection& rParameterCollection);
00231
00232 virtual ~ParameterCollection();
00233
00234 protected:
00236 virtual void SubElementLoadProcessing(const std::string& rsXMLSubTag, const std::string& rsXMLSubElement, const std::string& rsXMLSubData);
00237
00239 virtual std::string SaveData(const unsigned int& iDepth, bool& bHasSubElements) const;
00240
00243 ParametersType m_Parameters;
00244 };
00245
00246 }
00247
00248 #endif