commore
1.0.6-SNAPSHOT
|
#include <RefObject.h>
Public Member Functions | |
virtual const AChar * | factory_name () const |
virtual AutoRefBase | create (const AChar *s) const |
virtual AutoRefBase | bind (const AChar *s) const |
Static Public Member Functions | |
static AutoRefBase | lookup_create (const AChar *factory_name, const AChar *s, const AutoRefBase &def) |
static AutoRefBase | lookup_bind (const AChar *factory_name, const AChar *s, const AutoRefBase &def) |
General purpose factory for RefObject. Create or Bind to a real object, based on a string specification. A RefFactory must be instantiated once : it is usually done with a single static declaration in the source file, as the factory constructor is responsible for adding itself to a global list of factories (factory_list_ in AutoRef.cpp).
|
virtual |
Bind to an existing object, from a string spec. Must return NULL if the spec is not handled by this factory.
|
virtual |
Create an object from a string specification. If this specific factory is not intended to handle instantiation for this spec, it must return NULL.
s | optional creation parameter |
|
virtual |
Name of the type this factory claims to be able to instanciate. This factory is a pretender for the creation of RefObjects which have the same factory_name.
|
static |
Same as lookup_create, but for binding.
|
static |
Check all the factories in the global list, to instantiate an object of type 'factory_name', with spec 's'. Return the instantiated object, or 'def' (the given default object) if no factory was able to create the object.
factory_name | name of a factory |
s | optional creation parameter |
def | default value |