Public Types | Public Member Functions
Tonido::Data::VariantRow Class Reference

VariantRow is simply a map of VariantFields. More...

List of all members.

Public Types

typedef boost::shared_ptr
< VariantRow
SharedPtr
typedef std::map< std::string,
VariantField
VariantMap

Public Member Functions

 VariantRow ()
 Ctor.
 VariantRow (const VariantRow &vr)
 ~VariantRow ()
 Dtor.
void toString (std::ostream &out) const
 This serializes a given Variant into the ostream.
void toHTML (std::ostream &out) const
 This serializes a given Variant into a HTML formatted string.
bool hasField (const std::string a_fieldname) const
 Returns true if the given VariantRow has the field specified by the string.
VariantFieldgetFirstField (void)
 Allows iteration over the fields in this VariantRow.
VariantFieldgetNextField (void)
 Allows iteration over the fields in this VariantRow.
const std::string * getFirstIndex (void)
 Allows iteration over the index in this VariantRow.
const std::string * getNextIndex (void)
 Allows iteration over the index in this VariantRow.
template<typename VALUE >
bool find (const std::string &a_field, const VALUE &a_value)
 Various find operations on the VariantRow.
VariantFieldfind (const std::string &a_field)
const VariantFieldfind (const std::string &a_field) const
VariantFieldoperator[] (const std::string &index)
 Subscript operator.
void setVariantField (const std::string &a_name, const VariantField &a_field)
 Sets the specifc Variant Field.
VariantFieldgetVariantField (const std::string &a_name)
 Gets the specifc Variant Field.
VariantRowoperator= (const VariantRow &rhs)
 Assignment operator.
uint64_bt getSize ()
 Returns the actual variant Row size.
int getNumFields ()
 Returns the number of fields in the Variant Row.
bool write (RawData::SharedPtr &a_pRaw)
 Writes this variantrow into serializable stream.
bool write (const std::string &a_fileName)
 Writes this variantrow into a XML file.
bool toXML (TiXmlElement *a_element)
 Writes the Variant Row into an XML Element.
bool read (RawData::SharedPtr &a_pRaw)
 Reads this variantrow from serializable stream.
bool read (const std::string &a_fileName)
 Loads VariantRow from XML file.
const std::string * removeCurrentEntry ()
 Removes entry pointed by m_iterator.
void clear ()
 Removes all variant fields in the variant row.
bool fromXML (TiXmlElement *a_element)
 Loads VariantRow from XML.

Detailed Description

VariantRow is simply a map of VariantFields.


Constructor & Destructor Documentation

Tonido::Data::VariantRow::VariantRow ( )

Ctor.

Details if Needed...

Tonido::Data::VariantRow::~VariantRow ( )

Dtor.

Details if Needed...


Member Function Documentation

void Tonido::Data::VariantRow::clear ( )

Removes all variant fields in the variant row.

Parameters:
[in]none
Returns:
none
template<typename VALUE >
bool Tonido::Data::VariantRow::find ( const std::string &  a_field,
const VALUE &  a_value 
)

Various find operations on the VariantRow.

Parameters:
[in]none
Returns:
the variant row with the given field name
bool Tonido::Data::VariantRow::fromXML ( TiXmlElement *  a_element)

Loads VariantRow from XML.

Parameters:
[in]a_elementXML element loads variant row
Returns:
true on sucess, false otherwise
VariantField * Tonido::Data::VariantRow::getFirstField ( void  )

Allows iteration over the fields in this VariantRow.

Parameters:
[in]none
Returns:
the first variantfield
const std::string * Tonido::Data::VariantRow::getFirstIndex ( void  )

Allows iteration over the index in this VariantRow.

Parameters:
[in]none
Returns:
the first variantfield index
VariantField * Tonido::Data::VariantRow::getNextField ( void  )

Allows iteration over the fields in this VariantRow.

Parameters:
[in]none
Returns:
the first variantfield
const std::string * Tonido::Data::VariantRow::getNextIndex ( void  )

Allows iteration over the index in this VariantRow.

Parameters:
[in]none
Returns:
the first variantfield index
int Tonido::Data::VariantRow::getNumFields ( )

Returns the number of fields in the Variant Row.

Parameters:
[in]none
Returns:
number of variant fields.
uint64_bt Tonido::Data::VariantRow::getSize ( )

Returns the actual variant Row size.

Parameters:
[in]none
Returns:
variant
VariantField& Tonido::Data::VariantRow::getVariantField ( const std::string &  a_name)

Gets the specifc Variant Field.

Parameters:
a_namename of the variant field
a_fieldfield to set to
Returns:
none
bool Tonido::Data::VariantRow::hasField ( const std::string  a_fieldname) const

Returns true if the given VariantRow has the field specified by the string.

Parameters:
[in]a_fieldnameis the field to check for
Returns:
true if field is available, false otherwise
VariantRow& Tonido::Data::VariantRow::operator= ( const VariantRow rhs)

Assignment operator.

Parameters:
[in]none
Returns:
none
VariantField& Tonido::Data::VariantRow::operator[] ( const std::string &  index)

Subscript operator.

Parameters:
[in]none
Returns:
none
bool Tonido::Data::VariantRow::read ( RawData::SharedPtr &  a_pRaw)

Reads this variantrow from serializable stream.

Parameters:
[in]none
Returns:
variant
bool Tonido::Data::VariantRow::read ( const std::string &  a_fileName)

Loads VariantRow from XML file.

Parameters:
[in]a_fileNamename of the XML file to read from
Returns:
true on sucess, false otherwise
const std::string * Tonido::Data::VariantRow::removeCurrentEntry ( )

Removes entry pointed by m_iterator.

Returns:
true on sucess, false otherwise
void Tonido::Data::VariantRow::setVariantField ( const std::string &  a_name,
const VariantField a_field 
)

Sets the specifc Variant Field.

Parameters:
a_namename of the variant field
a_fieldfield to set to
Returns:
none
void Tonido::Data::VariantRow::toHTML ( std::ostream &  out) const

This serializes a given Variant into a HTML formatted string.

Parameters:
[in]outstd::ostream to write the Variant into
Returns:
none
void Tonido::Data::VariantRow::toString ( std::ostream &  out) const

This serializes a given Variant into the ostream.

This serializes a given message into the outstream

Parameters:
[in]none
Returns:
serialized table
bool Tonido::Data::VariantRow::toXML ( TiXmlElement *  a_element)

Writes the Variant Row into an XML Element.

Parameters:
[in]a_elementParent XML element to write into
Returns:
true on success, false otherwise
bool Tonido::Data::VariantRow::write ( RawData::SharedPtr &  a_pRaw)

Writes this variantrow into serializable stream.

Parameters:
[in]none
Returns:
variant
bool Tonido::Data::VariantRow::write ( const std::string &  a_fileName)

Writes this variantrow into a XML file.

Parameters:
[in]a_fileNamefile to write into
Returns:
true on success, false otherwise

Generated on Wed Oct 12 2011 21:46:53. © CodeLathe LLC 2007-2011. All Rights Reserved.