oos::attribute_writer< T > Class Template Reference

Retrieve an attribute value from an object. More...

#include <attribute_serializer.hpp>

Inherits oos::generic_object_writer< attribute_writer< T > >.

Public Member Functions

 attribute_writer (const std::string &id, T &to, int precision=-1)
 Creates an attribute_writer. More...
 
bool success () const
 True if value could be retrieved. More...
 
- Public Member Functions inherited from oos::object_writer
virtual void write (const char *, char)=0
 Write a single character to the atomizer. More...
 
virtual void write (const char *, float)=0
 Write a float to the atomizer. More...
 
virtual void write (const char *, double)=0
 Write a double to the atomizer. More...
 
virtual void write (const char *, short)=0
 Write a short to the atomizer. More...
 
virtual void write (const char *, int)=0
 Write a int to the atomizer. More...
 
virtual void write (const char *, long)=0
 Write a long to the atomizer. More...
 
virtual void write (const char *, unsigned char)=0
 Write a unsigned char to the atomizer. More...
 
virtual void write (const char *, unsigned short)=0
 Write a unsigned short to the atomizer. More...
 
virtual void write (const char *, unsigned int)=0
 Write a unsigned to the atomizer. More...
 
virtual void write (const char *, unsigned long)=0
 Write a unsigned long to the atomizer. More...
 
virtual void write (const char *, bool)=0
 Write a bool to the atomizer. More...
 
virtual void write (const char *, const char *, int)=0
 Write a const char pointer to the atomizer. More...
 
virtual void write (const char *, const std::string &)=0
 Write a std::string to the atomizer. More...
 
virtual void write (const char *, const varchar_base &)=0
 Write a std::string to the atomizer. More...
 
virtual void write (const char *, const object_base_ptr &)=0
 Write a object_base_ptr to the atomizer. More...
 
virtual void write (const char *, const object_container &)=0
 Write a object_container to the atomizer. More...
 

Friends

class generic_object_writer< attribute_writer< T > >
 

Additional Inherited Members

- Protected Member Functions inherited from oos::generic_object_writer< attribute_writer< T > >
 generic_object_writer (attribute_writer< T > *writer)
 

Detailed Description

template<class T>
class oos::attribute_writer< T >

Retrieve an attribute value from an object.

Template Parameters
TThe type of the attribute to retieve.

A attribute value of a template type is tried to retriev from an object. Therefor the attribute of given name must be found and the value must be convertible from the objects attribute.

Constructor & Destructor Documentation

template<class T >
oos::attribute_writer< T >::attribute_writer ( const std::string &  id,
T &  to,
int  precision = -1 
)
inline

Creates an attribute_writer.

Creates an attribute_writer for an attribute id of type T where id is the name of the attribute.

Template Parameters
TThe type of the attribute.
Parameters
idThe name of the attribute.
toThe attribute value to retrieve.
precisionThe precision of the value.

Member Function Documentation

template<class T >
bool oos::attribute_writer< T >::success ( ) const
inline

True if value could be retrieved.

Returns true if the value could be retrieved successfully.

Returns
True if value could be retrieved.

The documentation for this class was generated from the following file:
  • object/attribute_serializer.hpp