LIBRCSC Docs
Documentation for HELIOS's BASE LIBRCSC library for RoboCup 2D Simulation League.
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions | List of all members
rcss::Factory< Cre, I, Com > Class Template Reference

An Generic Object Factory (aka Class Store) More...

#include <factory.h>

Public Types

typedef Cre Creator
 creator type
 
typedef I Index
 index type
 
typedef Com Compare
 compare function type
 

Public Member Functions

 Factory ()
 constructor
 
 ~Factory ()
 destructor
 
void reg (Creator c, const Index &idx)
 register the creator with index variable More...
 
void dereg (const Index &idx)
 deregister the specified creator More...
 
bool getCreator (Creator &c, const Index &idx) const
 get the specified create object More...
 
std::list< Indexlist () const
 get the index list More...
 
std::ostream & printList (std::ostream &o=std::cout) const
 print index and the size of creators More...
 
size_t size () const
 get the size of registered index More...
 
size_t size (const Index &idx) const
 get the size of registered creators for the input index More...
 
RegHolder autoReg (Creator c, const Index &i)
 register the creator using AutoReger. used for the automatic registration. More...
 

Detailed Description

template<class Cre, class I = const char *, class Com = less< I >>
class rcss::Factory< Cre, I, Com >

An Generic Object Factory (aka Class Store)

Member Function Documentation

◆ autoReg()

template<class Cre , class I = const char *, class Com = less< I >>
RegHolder rcss::Factory< Cre, I, Com >::autoReg ( Creator  c,
const Index i 
)
inline

register the creator using AutoReger. used for the automatic registration.

Parameters
ccreator object
iconst reference to the index variable
Returns
RegHolder instance

◆ dereg()

template<class Cre , class I = const char *, class Com = less< I >>
void rcss::Factory< Cre, I, Com >::dereg ( const Index idx)
inline

deregister the specified creator

Parameters
idxderegistered index value

◆ getCreator()

template<class Cre , class I = const char *, class Com = less< I >>
bool rcss::Factory< Cre, I, Com >::getCreator ( Creator c,
const Index idx 
) const
inline

get the specified create object

Parameters
creference to the creator variable
idxindex value
Returns
if creator is found, return true

◆ list()

template<class Cre , class I = const char *, class Com = less< I >>
std::list< Index > rcss::Factory< Cre, I, Com >::list ( ) const
inline

get the index list

Returns
index list

◆ printList()

template<class Cre , class I = const char *, class Com = less< I >>
std::ostream & rcss::Factory< Cre, I, Com >::printList ( std::ostream &  o = std::cout) const
inline

print index and the size of creators

Parameters
oreference to the output stream
Returns
reference to the output stream

◆ reg()

template<class Cre , class I = const char *, class Com = less< I >>
void rcss::Factory< Cre, I, Com >::reg ( Creator  c,
const Index idx 
)
inline

register the creator with index variable

Parameters
ccreator object
idxconst reference to the index variable

◆ size() [1/2]

template<class Cre , class I = const char *, class Com = less< I >>
size_t rcss::Factory< Cre, I, Com >::size ( ) const
inline

get the size of registered index

Returns
the size of registered index

◆ size() [2/2]

template<class Cre , class I = const char *, class Com = less< I >>
size_t rcss::Factory< Cre, I, Com >::size ( const Index idx) const
inline

get the size of registered creators for the input index

Parameters
idxindex value
Returns
the size of registered creators

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