#include <freXMLValueSet.h>


Public Types | |
| typedef STLStringVector | ValuesType |
| typedef unsigned long | ValueCountType |
Public Member Functions | |
| void | Reset (const ValueCountType iValueCount, const std::string &sNewValue="") |
| virtual void | Reset () |
| void | Resize (const ValueCountType iNewSize, const std::string &sNewValue="") |
| ValueCountType | Size () const |
| bool | GetValue (bool &value, ValueCountType iItemPos=0) const |
| bool | GetValue (float &value, ValueCountType iItemPos=0) const |
| bool | GetValue (double &value, ValueCountType iItemPos=0) const |
| bool | GetValue (unsigned int &value, ValueCountType iItemPos=0) const |
| bool | GetValue (int &value, ValueCountType iItemPos=0) const |
| bool | GetValue (long &value, ValueCountType iItemPos=0) const |
| bool | GetValue (unsigned long &value, ValueCountType iItemPos=0) const |
| bool | GetValue (std::string &value, ValueCountType iItemPos=0) const |
| bool | SetValue (const bool value, ValueCountType iItemPos=0) |
| bool | SetValue (const double value, ValueCountType iItemPos=0) |
| bool | SetValue (const float value, ValueCountType iItemPos=0) |
| bool | SetValue (const int value, ValueCountType iItemPos=0) |
| bool | SetValue (const unsigned int value, ValueCountType iItemPos=0) |
| bool | SetValue (const long value, ValueCountType iItemPos=0) |
| bool | SetValue (const unsigned long value, ValueCountType iItemPos=0) |
| bool | SetValue (const std::string &value, ValueCountType iItemPos=0) |
| virtual XMLValueSet & | operator= (const XMLValueSet &valueSet) |
| XMLValueSet (const ValueCountType iValueCount, const std::string &sNewValue="") | |
| XMLValueSet () | |
| XMLValueSet (const XMLValueSet &valueSet) | |
| virtual | ~XMLValueSet () |
Protected Member Functions | |
| virtual void | SubElementLoadProcessing (const std::string &rsXMLSubTag, const std::string &rsXMLSubElement, const std::string &rsXMLSubData) |
| virtual std::string | SaveData (const unsigned int &iDepth, bool &bHasSubElements) const |
Protected Attributes | |
| ValuesType | m_Values |
XMLValueSet is a vector of values stored as a string but can be set and get (when possible) as other types. Each value is stored as a subelement with a "value" xml tag.
Definition at line 41 of file freXMLValueSet.h.
Definition at line 44 of file freXMLValueSet.h.
| typedef unsigned long FREE::XMLValueSet::ValueCountType |
Definition at line 45 of file freXMLValueSet.h.
| FREE::XMLValueSet::XMLValueSet | ( | const ValueCountType | iValueCount, | |
| const std::string & | sNewValue = "" | |||
| ) |
Constructor that allows to set value count and default value.
| [in] | iValueCount | Size of the set. |
| [in] | sNewValue | Default value for all values in the set. |
Definition at line 214 of file freXMLValueSet.cxx.
References Reset().

| FREE::XMLValueSet::XMLValueSet | ( | ) |
Default constructor
Definition at line 220 of file freXMLValueSet.cxx.
References Reset().

| FREE::XMLValueSet::XMLValueSet | ( | const XMLValueSet & | valueSet | ) |
Copy constructor
Definition at line 226 of file freXMLValueSet.cxx.
| FREE::XMLValueSet::~XMLValueSet | ( | ) | [virtual] |
Definition at line 232 of file freXMLValueSet.cxx.
| void FREE::XMLValueSet::Reset | ( | const ValueCountType | iValueCount, | |
| const std::string & | sNewValue = "" | |||
| ) |
Resets the layer with the passed count of values. After the reset all values contain the passed value.
| [in] | iValueCount | count of values after reset. |
| [in] | sNewValue | New value after the reset. |
Definition at line 36 of file freXMLValueSet.cxx.
References m_Values, and Reset().
Referenced by FREE::ParameterLayer::New().

| void FREE::XMLValueSet::Reset | ( | ) | [virtual] |
Resets the layer to a zero count of values.
Reimplemented from FREE::XMLStreamObject.
Definition at line 238 of file freXMLValueSet.cxx.
References m_Values, and FREE::XMLStreamObject::Reset().
Referenced by Reset(), and XMLValueSet().

| void FREE::XMLValueSet::Resize | ( | const ValueCountType | iNewSize, | |
| const std::string & | sNewValue = "" | |||
| ) |
Resizes the parameter to the passed new value count. After resizing all values are set to default (empty strings).
| [in] | iNewSize | The new size/count of values per layer. |
| [in] | sNewValue | New value after the resizing. |
Definition at line 44 of file freXMLValueSet.cxx.
References m_Values.
Referenced by FREE::Convert::ArrayToParameterLayer(), FREE::ConvertValueSet::FromArrayStruct(), FREE::Convert::ITKFixedArrayToValueSet(), FREE::Convert::ITKIndexToValueSet(), and FREE::Convert::ITKSizeToValueSet().
| XMLValueSet::ValueCountType FREE::XMLValueSet::Size | ( | ) | const |
Returns the count of values in the layer.
Definition at line 51 of file freXMLValueSet.cxx.
References m_Values.
Referenced by FREE::EvolutionaryStrategySOOptimizerController::ActualizeMainComponent(), FREE::EvolutionaryStrategyOptimizerController::ActualizeMainComponent(), FREE::Convert::FixedArrayToParameterLayer(), FREE::ConvertValueSet::FromITKArray(), FREE::Convert::ITKIndexToValueSet(), FREE::Convert::ITKSizeToValueSet(), FREE::Parameter::SetParameterLayer(), FREE::ConvertValueSet::ToITKArray(), FREE::ConvertValueSet::ToITKIndex(), and FREE::ConvertValueSet::ToITKSize().
| bool FREE::XMLValueSet::GetValue | ( | bool & | value, | |
| XMLValueSet::ValueCountType | iItemPos = 0 | |||
| ) | const |
Returns the value as bool. If the value cannot be converted or the index is out of range the return of the function will be false.
| [out] | value | Wanted value of the parameter. |
| [in] | iItemPos | Indicates the position of the wanted value. |
Definition at line 58 of file freXMLValueSet.cxx.
References FREE::Convert::ToBool().
Referenced by FREE::EvolutionaryStrategySOOptimizerController::ActualizeMainComponent(), FREE::EvolutionaryStrategyOptimizerController::ActualizeMainComponent(), GetValue(), FREE::PointSetToXMLStreamObject< TPointSet >::SubElementLoadProcessing(), FREE::ConvertValueSet::ToITKArray(), FREE::ConvertValueSet::ToITKIndex(), and FREE::ConvertValueSet::ToITKSize().

| bool FREE::XMLValueSet::GetValue | ( | float & | value, | |
| XMLValueSet::ValueCountType | iItemPos = 0 | |||
| ) | const |
Returns a float value of the given value.
Definition at line 80 of file freXMLValueSet.cxx.
References GetValue(), and FREE::Convert::ToFloat().

| bool FREE::XMLValueSet::GetValue | ( | double & | value, | |
| XMLValueSet::ValueCountType | iItemPos = 0 | |||
| ) | const |
Returns a double value of the given parameter.
Definition at line 69 of file freXMLValueSet.cxx.
References GetValue(), and FREE::Convert::ToDouble().

| bool FREE::XMLValueSet::GetValue | ( | unsigned int & | value, | |
| XMLValueSet::ValueCountType | iItemPos = 0 | |||
| ) | const |
Returns an integer value of the given parameter.
Definition at line 102 of file freXMLValueSet.cxx.
References GetValue(), and FREE::Convert::ToUInt().

| bool FREE::XMLValueSet::GetValue | ( | int & | value, | |
| XMLValueSet::ValueCountType | iItemPos = 0 | |||
| ) | const |
Returns an integer value of the given parameter.
Definition at line 91 of file freXMLValueSet.cxx.
References GetValue(), and FREE::Convert::ToInt().

| bool FREE::XMLValueSet::GetValue | ( | long & | value, | |
| XMLValueSet::ValueCountType | iItemPos = 0 | |||
| ) | const |
Returns a long value of the given parameter.
Definition at line 113 of file freXMLValueSet.cxx.
References GetValue(), and FREE::Convert::ToLong().

| bool FREE::XMLValueSet::GetValue | ( | unsigned long & | value, | |
| XMLValueSet::ValueCountType | iItemPos = 0 | |||
| ) | const |
Returns a long value of the given parameter.
Definition at line 124 of file freXMLValueSet.cxx.
References GetValue(), and FREE::Convert::ToULong().

| bool FREE::XMLValueSet::GetValue | ( | std::string & | value, | |
| XMLValueSet::ValueCountType | iItemPos = 0 | |||
| ) | const |
Returns a string value of the given parameter.
Definition at line 135 of file freXMLValueSet.cxx.
References m_Values.
| bool FREE::XMLValueSet::SetValue | ( | const bool | value, | |
| XMLValueSet::ValueCountType | iItemPos = 0 | |||
| ) |
Sets a bool value.
| [in] | value | New value of the parameter. |
| [in] | iItemPos | Indicates the position of the wanted value. |
Definition at line 145 of file freXMLValueSet.cxx.
References FREE::Convert::ToStr().
Referenced by FREE::Convert::ArrayToParameterLayer(), FREE::Convert::FixedArrayToParameterLayer(), FREE::ConvertValueSet::FromArrayStruct(), FREE::Convert::ITKFixedArrayToValueSet(), FREE::Convert::ITKIndexToValueSet(), FREE::Convert::ITKSizeToValueSet(), FREE::PointSetMediaControllerBase< PixelType, 2 >::SaveSetToSetup(), and SetValue().

| bool FREE::XMLValueSet::SetValue | ( | const double | value, | |
| ValueCountType | iItemPos = 0 | |||
| ) |
Sets a double value of the given parameter.
Definition at line 152 of file freXMLValueSet.cxx.
References SetValue(), and FREE::Convert::ToStr().

| bool FREE::XMLValueSet::SetValue | ( | const float | value, | |
| ValueCountType | iItemPos = 0 | |||
| ) |
Sets a float value of the given parameter.
Definition at line 159 of file freXMLValueSet.cxx.
References SetValue(), and FREE::Convert::ToStr().

| bool FREE::XMLValueSet::SetValue | ( | const int | value, | |
| ValueCountType | iItemPos = 0 | |||
| ) |
Sets an integer value of the given parameter.
Definition at line 166 of file freXMLValueSet.cxx.
References SetValue(), and FREE::Convert::ToStr().

| bool FREE::XMLValueSet::SetValue | ( | const unsigned int | value, | |
| ValueCountType | iItemPos = 0 | |||
| ) |
Sets an integer value of the given parameter.
Definition at line 173 of file freXMLValueSet.cxx.
References SetValue(), and FREE::Convert::ToStr().

| bool FREE::XMLValueSet::SetValue | ( | const long | value, | |
| ValueCountType | iItemPos = 0 | |||
| ) |
Sets a long value of the given parameter.
Definition at line 180 of file freXMLValueSet.cxx.
References SetValue(), and FREE::Convert::ToStr().

| bool FREE::XMLValueSet::SetValue | ( | const unsigned long | value, | |
| ValueCountType | iItemPos = 0 | |||
| ) |
Sets a long value of the given parameter.
Definition at line 187 of file freXMLValueSet.cxx.
References SetValue(), and FREE::Convert::ToStr().

| bool FREE::XMLValueSet::SetValue | ( | const std::string & | value, | |
| ValueCountType | iItemPos = 0 | |||
| ) |
Sets a string value of the given parameter.
Definition at line 194 of file freXMLValueSet.cxx.
References m_Values.
| XMLValueSet & FREE::XMLValueSet::operator= | ( | const XMLValueSet & | valueSet | ) | [virtual] |
| void FREE::XMLValueSet::SubElementLoadProcessing | ( | const std::string & | rsXMLSubTag, | |
| const std::string & | rsXMLSubElement, | |||
| const std::string & | rsXMLSubData | |||
| ) | [protected, virtual] |
Reimplemented from FREE::XMLStreamObject.
Definition at line 247 of file freXMLValueSet.cxx.
References FREE::cXML_ParameterValue, FREE::XMLStreamObject::cXML_Text, m_Values, and throwExceptionMacro.
| std::string FREE::XMLValueSet::SaveData | ( | const unsigned int & | iDepth, | |
| bool & | bHasSubElements | |||
| ) | const [protected, virtual] |
Reimplemented from FREE::XMLStreamObject.
Definition at line 257 of file freXMLValueSet.cxx.
References FREE::XMLStreamObject::AddSubElement(), FREE::cXML_ParameterValue, and m_Values.

ValuesType FREE::XMLValueSet::m_Values [protected] |
The Vector of Values
Definition at line 161 of file freXMLValueSet.h.
Referenced by GetValue(), operator=(), FREE::ParameterLayer::operator=(), Reset(), Resize(), SaveData(), SetValue(), Size(), and SubElementLoadProcessing().
1.5.3 written by Dimitri van Heesch,
© 1997-2000