Devel Lib
Devel::Serializing::IData< T, IsHidden > Class Template Reference

Template class representing a data field. More...

#include <SerializableData.h>

Inheritance diagram for Devel::Serializing::IData< T, IsHidden >:
Collaboration diagram for Devel::Serializing::IData< T, IsHidden >:

Public Member Functions

virtual ~IData ()=default
 Default destructor.
 
bool doSerialize (IO::CWriteStream &i_oStream) const
 Serializes the data to a write stream. More...
 
bool doDeserialize (IO::CReadStream &i_oStream)
 Deserializes the data from a read stream. More...
 
bool doDeserialize (const char *i_szString)
 Deserializes the data from a string. More...
 
bool doDeserialize (std::vector< std::string >::const_iterator &i_oIt, const std::vector< std::string >::const_iterator &i_oItEnd)
 Deserializes the data from a range of strings. More...
 
virtual size_t size () const
 Returns the size of the data. More...
 
virtual bool isHidden () const
 Returns whether the field is hidden. More...
 
virtual SCompareData compareData () const
 Returns the compare data for the data field. More...
 
auto begin () const
 Returns an iterator pointing to the beginning of the value. More...
 
auto end () const
 Returns an iterator pointing to the end of the value. More...
 
auto & operator[] (const size_t i_nIndex)
 Returns a reference to the value at the specified index. More...
 
const auto & operator[] (const size_t i_nIndex) const
 Returns a const reference to the value at the specified index. More...
 
 SerializerEnableIfNotArithmetic (IData< T > &) operator--()
 Pre-decrement operator. More...
 
 SerializerEnableIfNotArithmetic (IData< T > &) operator--(int)
 Post-decrement operator. More...
 
 SerializerEnableIfNotArithmetic (IData< T > &) operator++()
 Pre-increment operator. More...
 
 SerializerEnableIfNotArithmetic (IData< T > &) operator++(int)
 Post-increment operator. More...
 
- Public Member Functions inherited from Devel::Serializing::IValue< int >
 IValue (TArgs... i_tArgs)
 Constructs an IValue object with the specified arguments. More...
 
const int & value () const
 Returns the value. More...
 
int & value ()
 Returns a reference to the value. More...
 

Additional Inherited Members

- Protected Attributes inherited from Devel::Serializing::IValue< int >
int m_tValue
 The value.
 

Detailed Description

template<typename T = int, bool IsHidden = false>
class Devel::Serializing::IData< T, IsHidden >

Template class representing a data field.

Template Parameters
TThe type of the data.
IsHiddenSpecifies whether the field is hidden.

Member Function Documentation

◆ begin()

template<typename T = int, bool IsHidden = false>
auto Devel::Serializing::IData< T, IsHidden >::begin ( ) const
inline

Returns an iterator pointing to the beginning of the value.

Returns
An iterator pointing to the beginning of the value.

◆ compareData()

template<typename T = int, bool IsHidden = false>
virtual SCompareData Devel::Serializing::IData< T, IsHidden >::compareData ( ) const
inlinevirtual

Returns the compare data for the data field.

Returns
The compare data.

Reimplemented in Devel::Serializing::IWString< IsHidden, T >, and Devel::Serializing::IString< IsHidden, T >.

◆ doDeserialize() [1/3]

template<typename T = int, bool IsHidden = false>
bool Devel::Serializing::IData< T, IsHidden >::doDeserialize ( const char *  i_szString)
inline

Deserializes the data from a string.

Parameters
i_szStringThe string to deserialize from.
Returns
true if deserialization is successful, false otherwise.

◆ doDeserialize() [2/3]

template<typename T = int, bool IsHidden = false>
bool Devel::Serializing::IData< T, IsHidden >::doDeserialize ( IO::CReadStream i_oStream)
inline

Deserializes the data from a read stream.

Parameters
i_oStreamThe read stream to deserialize from.
Returns
true if deserialization is successful, false otherwise.

◆ doDeserialize() [3/3]

template<typename T = int, bool IsHidden = false>
bool Devel::Serializing::IData< T, IsHidden >::doDeserialize ( std::vector< std::string >::const_iterator &  i_oIt,
const std::vector< std::string >::const_iterator &  i_oItEnd 
)
inline

Deserializes the data from a range of strings.

Parameters
i_oItAn iterator pointing to the current string.
i_oItEndAn iterator pointing to the end of the range of strings.
Returns
true if deserialization is successful, false otherwise.

◆ doSerialize()

template<typename T = int, bool IsHidden = false>
bool Devel::Serializing::IData< T, IsHidden >::doSerialize ( IO::CWriteStream i_oStream) const
inline

Serializes the data to a write stream.

Parameters
i_oStreamThe write stream to serialize to.
Returns
true if serialization is successful, false otherwise.

◆ end()

template<typename T = int, bool IsHidden = false>
auto Devel::Serializing::IData< T, IsHidden >::end ( ) const
inline

Returns an iterator pointing to the end of the value.

Returns
An iterator pointing to the end of the value.

◆ isHidden()

template<typename T = int, bool IsHidden = false>
virtual bool Devel::Serializing::IData< T, IsHidden >::isHidden ( ) const
inlinevirtual

Returns whether the field is hidden.

Returns
true if the field is hidden, false otherwise.

◆ operator[]() [1/2]

template<typename T = int, bool IsHidden = false>
auto& Devel::Serializing::IData< T, IsHidden >::operator[] ( const size_t  i_nIndex)
inline

Returns a reference to the value at the specified index.

Parameters
i_nIndexThe index of the value.
Returns
A reference to the value at the specified index.

◆ operator[]() [2/2]

template<typename T = int, bool IsHidden = false>
const auto& Devel::Serializing::IData< T, IsHidden >::operator[] ( const size_t  i_nIndex) const
inline

Returns a const reference to the value at the specified index.

Parameters
i_nIndexThe index of the value.
Returns
A const reference to the value at the specified index.

◆ SerializerEnableIfNotArithmetic() [1/4]

template<typename T = int, bool IsHidden = false>
Devel::Serializing::IData< T, IsHidden >::SerializerEnableIfNotArithmetic ( IData< T > &  )
inline

Pre-increment operator.

Returns
A reference to the data after increment.

◆ SerializerEnableIfNotArithmetic() [2/4]

template<typename T = int, bool IsHidden = false>
Devel::Serializing::IData< T, IsHidden >::SerializerEnableIfNotArithmetic ( IData< T > &  )
inline

Post-increment operator.

Returns
A reference to the data before increment.

◆ SerializerEnableIfNotArithmetic() [3/4]

template<typename T = int, bool IsHidden = false>
Devel::Serializing::IData< T, IsHidden >::SerializerEnableIfNotArithmetic ( IData< T > &  )
inline

Pre-decrement operator.

Returns
A reference to the data after decrement.

◆ SerializerEnableIfNotArithmetic() [4/4]

template<typename T = int, bool IsHidden = false>
Devel::Serializing::IData< T, IsHidden >::SerializerEnableIfNotArithmetic ( IData< T > &  )
inline

Post-decrement operator.

Returns
A reference to the data before decrement.

◆ size()


The documentation for this class was generated from the following file: