Public Member Functions | Protected Types | Protected Attributes

Creator< RefType > Class Template Reference
[MemCore Cache Management of Limited Resources]

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

#include <memcore/Creator.hpp>

Inheritance diagram for Creator< RefType >:
CreatorBase< RefType > Creature Intercube Ageable

List of all members.

Public Member Functions

Protected Types

Protected Attributes


Detailed Description

template<class RefType>
class Creator< RefType >

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

template<class RefType >
Creator< RefType >::Creator ( const RefPtr< RefType > &  D,
const WeakPtr< CacheBase > &  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.


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