VISH  0.2
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
MemCore::Creator Class Reference

A Creator is a forwarding of some data object to its creational object. More...

#include </home/werner/origo/vish/memcore/Creator.hpp>

List of all members.

Public Member Functions

Protected Types

Protected Member Functions

Protected Attributes


Detailed Description

A Creator is a forwarding of some data object to its creational object.

Instead of referring to data objects, one can refer to CreatorBase's to this data object domain, and install Creators on this object by default. The references to the CreatorBase can be used like references to the objects, but optionally something else than an Creator of the object can be installed there. In this case, the object does not exist right from the beginning, but its creation is delayed until access.

Example code Instead of

RefPtr<Object> objPtr;
        objPtr = new Object;
Object*P = objPtr;

use

RefPtr<CreatorBase<Object> > objPtr;

        objPtr = new Creator(new Object);
Object*P = objPtr;

Constructor & Destructor Documentation

MemCore::Creator::Creator ( const RefPtr< RefType > &  D,
const WCachePtr MyCache 
) [inline]

Construct a creator with a data object.

Note that if the RefType is a Cacheable, it rather needs to get this Creator object defined as its creator (see Cacheable::setCreator() ). This constructor does not do this, because the RefType object might be anything refcountable. To automatize such functionality it needs to be implemented in a domain-specific base class.

Note that Caching is NOT activated at this moment, need to call Data::enableCaching() once this creator has been referenced.


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