CNORXZ
Container with Native Operation Routines and Expressions
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
CNORXZ::RangeFactoryBase Class Referenceabstract

#include <range_base.h>

Inheritance diagram for CNORXZ::RangeFactoryBase:
CNORXZ::CRangeFactory CNORXZ::MRangeFactory< Ranges > CNORXZ::PRangeFactory< RangeT > CNORXZ::SRangeFactory< MetaT, S > CNORXZ::URangeFactory< MetaT > CNORXZ::YRangeFactory

Public Member Functions

 RangeFactoryBase ()=default
 
virtual ~RangeFactoryBase ()=default
 
RangePtr create ()
 

Static Public Member Functions

static RangePtr getRegistered (const TypeInfo &info, const RangePtr &r)
 

Protected Member Functions

virtual void make ()=0
 
RangePtr fromCreated (const TypeInfo &info, const Vector< Uuid > &rids) const
 
void addToCreated (const TypeInfo &info, const Vector< Uuid > &rids, const RangePtr &r)
 

Protected Attributes

RangePtr mProd
 

Detailed Description

Abstract factory base class for creating ranges.

Ranges can exclusively create through range factories.

All ranges that are ever created are stored in a product map (sCreated). The object type hash and the uuid of all ranges the created depends on serve as keys. In the case the range does not depend on any other range, its own uuid is used as key. If the range is a result of a cast from another range, the latter's uuid is used as key.

Derived factories are supposed to look for an existing range by calling fromCreated() and, if nullptr returned, add the new range to the map by calling addToCreated(). These steps are supposed to be implemented by overloading the purely virtual function make().

The product is publicly accessible throught the function create().

Definition at line 48 of file range_base.h.

Constructor & Destructor Documentation

◆ RangeFactoryBase()

CNORXZ::RangeFactoryBase::RangeFactoryBase ( )
default

Default constructor

◆ ~RangeFactoryBase()

virtual CNORXZ::RangeFactoryBase::~RangeFactoryBase ( )
virtualdefault

Default destructor

Member Function Documentation

◆ addToCreated()

void CNORXZ::RangeFactoryBase::addToCreated ( const TypeInfo & info,
const Vector< Uuid > & rids,
const RangePtr & r )
protected

add newly created range to the product map

Definition at line 44 of file range_base.cc.

◆ create()

RangePtr CNORXZ::RangeFactoryBase::create ( )

Return the product

Definition at line 24 of file range_base.cc.

◆ fromCreated()

RangePtr CNORXZ::RangeFactoryBase::fromCreated ( const TypeInfo & info,
const Vector< Uuid > & rids ) const
protected

access the product map (read-only)

Definition at line 33 of file range_base.cc.

◆ getRegistered()

RangePtr CNORXZ::RangeFactoryBase::getRegistered ( const TypeInfo & info,
const RangePtr & r )
static

Definition at line 49 of file range_base.cc.

◆ make()

virtual void CNORXZ::RangeFactoryBase::make ( )
protectedpure virtual

Abstract method to create the product.

Implemented in CNORXZ::CRangeFactory.

Member Data Documentation

◆ mProd

RangePtr CNORXZ::RangeFactoryBase::mProd
protected

shared pointer to the product

Definition at line 75 of file range_base.h.


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