ot::EventAttributeBase Class Reference
[Core Classes]

#include <EventAttributeBase.h>

Inheritance diagram for ot::EventAttributeBase:

Inheritance graph
[legend]
Collaboration diagram for ot::EventAttributeBase:

Collaboration graph
[legend]
List of all members.

Detailed Description

The base class of the EventAttribute class. This class must be provided as a common base class of all template instantiations of the EventAttribute class, so that an Event can store pointers of this class in its attributes map (AttributeMap). This class is purely abstract and provides an interface for serialization, de-serialization, streaming, and accessing type information. The interface is implemented by the templated EventAttribute class.

Moreover, static create functions, a static function for registering types, and some static members realize the concept of creating new EventAttribute objects without knowing anything else but the attribute's generic type name. This functionality is crucial for the de-serialization of events encoded in strings.

Author:
Jochen von Spiczak


Protected Member Functions

virtual OPENTRACKER_API ~EventAttributeBase ()
virtual EventAttributeBaseoperator= (const EventAttributeBase &rv)=0
virtual void serialize (std::ostream &out)=0
virtual void deserialize (std::istream &in)=0
virtual const std::type_info & getType () const =0
virtual const std::string & getGenericTypeName () const =0

Static Protected Member Functions

static OPENTRACKER_API EventAttributeBasecreate (const std::string &genericTypeName)
static OPENTRACKER_API EventAttributeBasecreate (const std::type_info &typeInfo)
static OPENTRACKER_API void registerType (const std::string &genericTypeName, const std::type_info &typeInfo, CreateFunction create)

Static Protected Attributes

static OPENTRACKER_API CreatorMap creators
static OPENTRACKER_API Translator translator

Friends

class Event
std::istream & operator>> (std::istream &in, ot::EventAttributeBase &att)
std::ostream & operator<< (std::ostream &out, ot::EventAttributeBase &att)


Constructor & Destructor Documentation

ot::EventAttributeBase::~EventAttributeBase  )  [protected, virtual]
 

Virtual destructor. Must provide empty implementation for creation of RTTI type information.


Member Function Documentation

EventAttributeBase * ot::EventAttributeBase::create const std::type_info &  typeInfo  )  [static, protected]
 

Creates an EventAttribute according to typeInfo. Throws an exception if this type is not known by the system.

Parameters:
typeInfo RTTI type info
Returns:
pointer to the newly created attribute

EventAttributeBase * ot::EventAttributeBase::create const std::string &  genericTypeName  )  [static, protected]
 

Creates an EventAttribute according to genericTypeName. Throws an exception if this type name is not known by the system.

Parameters:
genericTypeName generic type name
Returns:
pointer to the newly created attribute

virtual void ot::EventAttributeBase::deserialize std::istream &  in  )  [protected, pure virtual]
 

Abstract function to de-serialize the attribute.

Parameters:
in the input stream

virtual const std::string& ot::EventAttributeBase::getGenericTypeName  )  const [protected, pure virtual]
 

Abstract function to get generic type name of the attribute's value.

Returns:
generic type name

virtual const std::type_info& ot::EventAttributeBase::getType  )  const [protected, pure virtual]
 

Abstract function to get RTTI type information of the attribute's value.

Returns:
RTTI type information

virtual EventAttributeBase& ot::EventAttributeBase::operator= const EventAttributeBase rv  )  [protected, pure virtual]
 

Abstract assignment operator.

Parameters:
rv the right-value, which is the attribute to copy from
Returns:
the left value

void ot::EventAttributeBase::registerType const std::string &  genericTypeName,
const std::type_info &  typeInfo,
CreateFunction  create
[static, protected]
 

Registers a new generic type name. Type names are arbitrary but must be unique. In this function, the generic type name is matched to the according creator function and the type name is registered in the translator.

Parameters:
genericTypeName the generic type name to be registered (must be unique!)
typeInfo RTTI type information of the new type
create creator function for attributes of the new type
Returns:

virtual void ot::EventAttributeBase::serialize std::ostream &  out  )  [protected, pure virtual]
 

Abstract function to serialize the attribute.

Parameters:
out the output stream


Friends And Related Function Documentation

friend class Event [friend]
 

Reimplemented in ot::EventAttribute< T >.

std::ostream& operator<< std::ostream &  out,
ot::EventAttributeBase att
[friend]
 

Output streaming operator. Streams the attribute into the output stream.

Parameters:
out the output stream
att the attribute
Returns:
the output stream

std::istream& operator>> std::istream &  in,
ot::EventAttributeBase att
[friend]
 

Input streaming operator. Streams the data provided by the input stream into the attribute.

Parameters:
in the input stream
att the attribute
Returns:
the input stream


Member Data Documentation

CreatorMap ot::EventAttributeBase::creators [static, protected]
 

Static map matching generic type names to according creator functions.

Parameters:
@return 

Translator ot::EventAttributeBase::translator [static, protected]
 

Static Translator to translate compiler dependent RTTI names to generic type names. Such translations are used to create attributes by RTTI type information.


The documentation for this class was generated from the following files:
Generated on Wed Feb 28 15:29:01 2007 for NaviTrack by  doxygen 1.4.6