FREE::XMLValueSet Class Reference
[XML streaming]

Class providing one value layer/level for a parameter. More...

#include <freXMLValueSet.h>

Inheritance diagram for FREE::XMLValueSet:

Inheritance graph
FREE::ParameterLayerFREE::XMLStreamObject
[legend]
Collaboration diagram for FREE::XMLValueSet:

Collaboration graph
FREE::XMLStreamObject
[legend]

List of all members.

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 XMLValueSetoperator= (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


Detailed Description

Class providing one value layer/level for a parameter.

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.


Member Typedef Documentation

typedef STLStringVector FREE::XMLValueSet::ValuesType

Definition at line 44 of file freXMLValueSet.h.

typedef unsigned long FREE::XMLValueSet::ValueCountType

Definition at line 45 of file freXMLValueSet.h.


Constructor & Destructor Documentation

FREE::XMLValueSet::XMLValueSet ( const ValueCountType  iValueCount,
const std::string &  sNewValue = "" 
)

Constructor that allows to set value count and default value.

Parameters:
[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().

Here is the call graph for this function:

FREE::XMLValueSet::ResetFREE::XMLStreamObject::Reset

FREE::XMLValueSet::XMLValueSet (  ) 

Default constructor

Definition at line 220 of file freXMLValueSet.cxx.

References Reset().

Here is the call graph for this function:

FREE::XMLValueSet::ResetFREE::XMLStreamObject::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.


Member Function Documentation

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.

Parameters:
[in] iValueCount count of values after reset.
[in] sNewValue New value after the reset.
Implementation of FREE::XMLValueSet /////////////////////////////

Definition at line 36 of file freXMLValueSet.cxx.

References m_Values, and Reset().

Referenced by FREE::ParameterLayer::New().

Here is the call graph for this function:

FREE::XMLValueSet::ResetFREE::XMLStreamObject::Reset

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().

Here is the call graph for this function:

FREE::XMLStreamObject::Reset

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).

Parameters:
[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.

Returns:
The item count

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.

Parameters:
[out] value Wanted value of the parameter.
[in] iItemPos Indicates the position of the wanted value.
Returns:
Indicates if the value has a valid value. If the parameter does not exist or the iItemPos is out of range, the return is false and the value not valid.

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().

Here is the call graph for this function:

FREE::Convert::ToBool

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().

Here is the call graph for this function:

FREE::XMLValueSet::GetValueFREE::Convert::ToFloatFREE::Convert::ToBool

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().

Here is the call graph for this function:

FREE::XMLValueSet::GetValueFREE::Convert::ToDoubleFREE::Convert::ToBool

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().

Here is the call graph for this function:

FREE::XMLValueSet::GetValueFREE::Convert::ToUIntFREE::Convert::ToBool

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().

Here is the call graph for this function:

FREE::XMLValueSet::GetValueFREE::Convert::ToIntFREE::Convert::ToBool

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().

Here is the call graph for this function:

FREE::XMLValueSet::GetValueFREE::Convert::ToLongFREE::Convert::ToBool

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().

Here is the call graph for this function:

FREE::XMLValueSet::GetValueFREE::Convert::ToULongFREE::Convert::ToBool

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.

Parameters:
[in] value New value of the parameter.
[in] iItemPos Indicates the position of the wanted value.
Returns:
Indicates if the value has a valid value. If the parameter does not exist or the iItemPos is out of range, then the return is false and the value not valid.

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().

Here is the call graph for this function:

FREE::Convert::ToStr

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().

Here is the call graph for this function:

FREE::XMLValueSet::SetValueFREE::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().

Here is the call graph for this function:

FREE::XMLValueSet::SetValueFREE::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().

Here is the call graph for this function:

FREE::XMLValueSet::SetValueFREE::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().

Here is the call graph for this function:

FREE::XMLValueSet::SetValueFREE::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().

Here is the call graph for this function:

FREE::XMLValueSet::SetValueFREE::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().

Here is the call graph for this function:

FREE::XMLValueSet::SetValueFREE::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]

Assignment operator.

Definition at line 204 of file freXMLValueSet.cxx.

References m_Values.

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.

Here is the call graph for this function:

FREE::XMLStreamObject::AddSubElementFREE::XMLStreamObject::AddIndentationFREE::XMLStreamObject::CreateSimpleElementFREE::Convert::ToStr


Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated at Sat Oct 13 18:17:29 2007 for f.r.e.e. - Flexible Registration and Evaluation Engine by doxygen 1.5.3 written by Dimitri van Heesch, © 1997-2000