Graphite  Version 3
An experimental 3D geometry processing program
OGF::Factory Class Referenceabstract

Creates instances of a specific class. More...

#include <OGF/gom/services/factory.h>

Inheritance diagram for OGF::Factory:
GEO::Counted OGF::FactoryMetaClass OGF::DynamicFactoryMetaClass

Public Member Functions

 Factory ()
 Factory constructor.
 
virtual ~Factory ()
 Factory destructor.
 
virtual Objectcreate (const ArgList &args)=0
 Creates an object based of user-supplied parameters. More...
 
- Public Member Functions inherited from GEO::Counted
void ref () const
 Increments the reference count. More...
 
void unref () const
 Decrements the reference count. More...
 
bool is_shared () const
 Check if the object is shared. More...
 
int nb_refs () const
 Gets the number of references that point to this object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from GEO::Counted
static void ref (const Counted *counted)
 Increments the reference count. More...
 
static void unref (const Counted *counted)
 Decrements the reference count. More...
 
- Protected Member Functions inherited from GEO::Counted
 Counted ()
 Creates a reference counted object. More...
 
virtual ~Counted ()
 Destroys a reference counted object. More...
 

Detailed Description

Creates instances of a specific class.

Converts the argument, stored in a generic ArgList, and passes them to the constructor. Factories are generated by the GomCodeGenerator.

Definition at line 61 of file factory.h.

Member Function Documentation

◆ create()

virtual Object* OGF::Factory::create ( const ArgList args)
pure virtual

Creates an object based of user-supplied parameters.

Parameters
[in]argsthe set of parameters supplied by client code
Return values
apointer to the created object if successful
nilif the argument list does not match any constructor of the object

Implemented in OGF::DynamicFactoryMetaClass, and OGF::FactoryMetaClass.


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