Scopira 20080306

scopira::tool::objflowloader Class Reference

#include <objflowloader.h>

Inheritance diagram for scopira::tool::objflowloader:
scopira::tool::object

List of all members.

Public Types

typedef
scopira::tool::iterator_g
< object * > 
note_iterator
typedef object *(* loadfunc_t )(void)
 a loader function type

Public Member Functions

 objflowloader (void)
 ~objflowloader ()
 destructor
void add_type (const std::type_info &id, const std::string &name, loadfunc_t loader)
void add_type (const std::type_info &id, const char *name, loadfunc_t loader)
 alternate just for performance reasons
const std::string & get_name (const std::type_info &id) const
 gets the name, based on typeid
bool has_typeinfo (const std::type_info &id) const
 do i have this type?
bool has_typeinfo (const std::string &name) const
 do I know about this type?
const std::type_info & get_typeinfo (const std::string &name) const
 gets the typeid, based on the unique name, the name must exist
objectload_object (const std::type_info &id) const
 invokes a loader, null on fail
void set_note (const std::type_info &id, scopira::tool::object *o)
scopira::tool::objectget_note (const std::type_info &id) const
 gets the optional note object for the given name, might return null for none
note_iterator get_note_iterator (void)

Static Public Member Functions

static objflowloaderinstance (void)

Protected Attributes

scopira::tool::count_ptr< impl_t > dm_imp

Static Protected Attributes

static objflowloaderdm_loader

Detailed Description

A flow object loader and type registry.

Basically, a registration of an object contains: it's C++ type_info a universally unique name (usually the fully qualified C++ name) the loader function (in some rare cases, this is null) an optional note object

The internal maps names -> type_info -> the full payload.

Author:
Aleksander Demko

Constructor & Destructor Documentation

scopira::tool::objflowloader::objflowloader ( void  )

constructor. the objflowloader constructed will automatically register itself as the global objflowloader

it will automaitcally call scopira::tool::register_flowtypes on itself. you should explictly register any other classes

Author:
Aleksander Demko

Member Function Documentation

void scopira::tool::objflowloader::add_type ( const std::type_info &  id,
const std::string &  name,
loadfunc_t  loader 
)

adds a type to the registry. calling this one the same type is fine, as it simply does replacement

note_iterator scopira::tool::objflowloader::get_note_iterator ( void  )

Get a iterator of all the notes in the system.

Author:
Aleksander Demko
static objflowloader* scopira::tool::objflowloader::instance ( void  ) [static]

Gets the current loader. This will never return null (that is, it'll create one if need be).

However, this method ends up creating it, it will put it in a reference counted state.

Author:
Aleksander Demko
void scopira::tool::objflowloader::set_note ( const std::type_info &  id,
scopira::tool::object o 
)

sets the optional annotation object for the given name if the object already has a annotation object, it will be replaced the object will be ref counted.

Notes should have used they object(bool = true) ctor (go look it up) as notes may live outside the rec coutning debug system's lifetime.

Author:
Aleksander Demko

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