BankAndCustomer
Loading...
Searching...
No Matches
glo::ObjCreator Class Referenceabstract

Abstract superclass for instantiation functions of persistent classes. From this class a subclass is derived for each database from a schema, which can instantiate persistent objects from the class IDs. More...

#include <GloObjCreator.h>

Inheritance diagram for glo::ObjCreator:

Public Member Functions

 ObjCreator ()
 
virtual ~ObjCreator ()
 
virtual std::string getBaseName () const =0
 
virtual bool isKnownClassID (unsigned long ulClassID) const =0
 
virtual int getPersObject (Persistent *&prNewObject, unsigned long ulClassID) const =0
 
virtual int getPersObject (std::shared_ptr< Persistent > &rNewObject, unsigned long ulClassID) const =0
 
virtual unsigned long getClassID (BaseAllSet *pAllSet) const =0
 
virtual ObjCreatorgetCopy () const =0
 

Private Member Functions

 ObjCreator (const ObjCreator &)
 
ObjCreatoroperator= (const ObjCreator &)
 

Detailed Description

Abstract superclass for instantiation functions of persistent classes. From this class a subclass is derived for each database from a schema, which can instantiate persistent objects from the class IDs.

The derived object creator is usually created by the GloDeveloper and must be included in the source files in which the Base is used.

Author
Helmut Jakoby

Constructor & Destructor Documentation

◆ ObjCreator() [1/2]

glo::ObjCreator::ObjCreator ( )
inline

Standard constructor.

◆ ~ObjCreator()

virtual glo::ObjCreator::~ObjCreator ( )
inlinevirtual

Destructor.

◆ ObjCreator() [2/2]

glo::ObjCreator::ObjCreator ( const ObjCreator & )
private

The copy constructor is not available.

See also
getCopy()

Member Function Documentation

◆ getBaseName()

virtual std::string glo::ObjCreator::getBaseName ( ) const
pure virtual

Returns the database name in the subclass.

Returns
see above.

Implemented in SelfWatchingClassObjCreator.

◆ getClassID()

virtual unsigned long glo::ObjCreator::getClassID ( BaseAllSet * pAllSet) const
pure virtual

Returns the class ID of the passed AllSet in the subclass.

Parameters
[in]pAllSetThe AllSet to be checked.
Returns
If the AllSet is known, the corresponding class ID.
Exceptions
eut::ErrorNExceptionIf the type of the AllSet is not known, an exception is thrown with the error ::ERR_UNKNOWN_OBJECT_TYPE.

Implemented in SelfWatchingClassObjCreator.

◆ getCopy()

virtual ObjCreator * glo::ObjCreator::getCopy ( ) const
pure virtual

Returns a copy of itself in the subclass.

Returns
The copy of this object.
Attention
The copy must be removed from memory by the calling instance.

Implemented in SelfWatchingClassObjCreator.

◆ getPersObject() [1/2]

virtual int glo::ObjCreator::getPersObject ( Persistent *& prNewObject,
unsigned long ulClassID ) const
pure virtual

Returns a persistent object (instantiation with the default constructor) in the subclass of the passed class ID.

Parameters
[in,out]prNewObjectThe instantiated persistent object.
[in]ulClassIDThe class ID of the object to be instantiated.
Returns
A return value < 0 indicates an error.
Attention
If prNewObject is valid, this object must be removed from memory by the calling instance using BasePersistent::forget().
Note
It is recommended, if possible, to consider using std::shared_ptr and to use the method getPersObject(std::shared_ptr<Persistent>&, unsigned long)const

Implemented in SelfWatchingClassObjCreator.

◆ getPersObject() [2/2]

virtual int glo::ObjCreator::getPersObject ( std::shared_ptr< Persistent > & rNewObject,
unsigned long ulClassID ) const
pure virtual

Returns a persistent object (instantiation with the default constructor) in the subclass of the passed class ID.

Parameters
[in,out]rNewObjectThe instantiated persistent object.
[in]ulClassIDThe class ID of the object to be instantiated.
Returns
A return value < 0 indicates an error.

Implemented in SelfWatchingClassObjCreator.

◆ isKnownClassID()

virtual bool glo::ObjCreator::isKnownClassID ( unsigned long ulClassID) const
pure virtual

Checks in the subclass whether a class ID is known.

Parameters
[in]ulClassIDThe class ID to be checked.
Returns
If true, passed class ID is known.

Implemented in SelfWatchingClassObjCreator.

◆ operator=()

ObjCreator & glo::ObjCreator::operator= ( const ObjCreator & )
private

The assignment operator is not available.


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