Hoyt's FORK of DemoIccMAX 2.1.17.hoyt
Documentation for Hoyt's FORK of DemoIccMAX
Loading...
Searching...
No Matches
CIccXformCreator Class Reference

Class: CIccXformCreator. More...

#include <IccXformFactory.h>

+ Collaboration diagram for CIccXformCreator:

Public Member Functions

 ~CIccXformCreator ()
 

Static Public Member Functions

static CIccXform * CreateXform (icXformType xformType, CIccTag *pTag=NULL, CIccCreateXformHintManager *pHintManager=NULL)
 Function: CreateXform(xformTypeSig) Create a xform of type xformTypeSig.
 
static IIccXformFactoryPopFactory ()
 Function: PopFactory() Remove the top IIccXformFactory from the stack of xform factories tracked by the system.
 
static void PushFactory (IIccXformFactory *pFactory)
 Function: PushFactory(pFactory) Add an IIccXformFactory to the stack of xform factories tracked by the system.
 

Private Member Functions

 CIccXformCreator ()
 Only GetInstance() can create the signleton.
 
CIccXform * DoCreateXform (icXformType xformType, CIccTag *pTag=NULL, CIccCreateXformHintManager *pHintManager=NULL)
 
IIccXformFactoryDoPopFactory (bool bAll=false)
 
void DoPushFactory (IIccXformFactory *pFactory)
 

Static Private Member Functions

static CIccXformCreatorGetInstance ()
 Function: GetInstance() Private static function to access singleton CiccXformCreator Object.
 

Private Attributes

CIccXformFactoryList factoryStack
 

Static Private Attributes

static CIccXformCreatorPtr theXformCreator
 

Detailed Description

Class: CIccXformCreator.

Purpose: CIccXformCreator uses a singleton pattern to provide dynamically upgradeable CIccXform derived object creation based on xform type.

Definition at line 167 of file IccXformFactory.h.

Constructor & Destructor Documentation

◆ ~CIccXformCreator()

CIccXformCreator::~CIccXformCreator ( )

Definition at line 120 of file IccXformFactory.cpp.

121{
122 IIccXformFactory *pFactory = DoPopFactory(true);
123
124 while (pFactory) {
125 delete pFactory;
126 pFactory = DoPopFactory(true);
127 }
128}
IIccXformFactory * DoPopFactory(bool bAll=false)
Class: IIccXformFactory.

◆ CIccXformCreator()

CIccXformCreator::CIccXformCreator ( )
inlineprivate

Only GetInstance() can create the signleton.

Definition at line 220 of file IccXformFactory.h.

220{ }

Member Function Documentation

◆ CreateXform()

static CIccXform * CIccXformCreator::CreateXform ( icXformType xformType,
CIccTag * pTag = NULL,
CIccCreateXformHintManager * pHintManager = NULL )
inlinestatic

Function: CreateXform(xformTypeSig) Create a xform of type xformTypeSig.

Parameter(s): xformType = signature of the ICC xform type for the xform to be created pTag = tag information for created xform pHintManager = contains additional information used to create xform

Returns a new CIccXform object of the given xform type. Each factory in the factoryStack is used until a factory supports the signature type.

Definition at line 185 of file IccXformFactory.h.

186 { return CIccXformCreator::GetInstance()->DoCreateXform(xformType, pTag, pHintManager); }
CIccXform * DoCreateXform(icXformType xformType, CIccTag *pTag=NULL, CIccCreateXformHintManager *pHintManager=NULL)
static CIccXformCreator * GetInstance()
Function: GetInstance() Private static function to access singleton CiccXformCreator Object.

References DoCreateXform(), and GetInstance().

+ Here is the call graph for this function:

◆ DoCreateXform()

CIccXform * CIccXformCreator::DoCreateXform ( icXformType xformType,
CIccTag * pTag = NULL,
CIccCreateXformHintManager * pHintManager = NULL )
private

Definition at line 141 of file IccXformFactory.cpp.

142{
143 CIccXformFactoryList::iterator i;
144 CIccXform *rv = NULL;
145
146 for (i=factoryStack.begin(); i!=factoryStack.end(); i++) {
147 rv = (*i)->CreateXform(xformTypeSig, pTag, pHintManager);
148 if (rv)
149 break;
150 }
151 return rv;
152}
CIccXformFactoryList factoryStack

Referenced by CreateXform().

+ Here is the caller graph for this function:

◆ DoPopFactory()

IIccXformFactory * CIccXformCreator::DoPopFactory ( bool bAll = false)
private

Definition at line 159 of file IccXformFactory.cpp.

160{
161 //int nNum = (bAll ? 0 : 1);
162
163 if (factoryStack.size()>0) {
164 CIccXformFactoryList::iterator i=factoryStack.begin();
165 IIccXformFactory* rv = (*i);
166 factoryStack.pop_front();
167 return rv;
168 }
169 return NULL;
170}

Referenced by PopFactory().

+ Here is the caller graph for this function:

◆ DoPushFactory()

void CIccXformCreator::DoPushFactory ( IIccXformFactory * pFactory)
private

Definition at line 154 of file IccXformFactory.cpp.

155{
156 factoryStack.push_front(pFactory);
157}

◆ GetInstance()

CIccXformCreator * CIccXformCreator::GetInstance ( )
staticprivate

Function: GetInstance() Private static function to access singleton CiccXformCreator Object.

Parameter(s): None

Returns the singleton CIccXformCreator object. It will allocate a new one and push a single CIccSpecXform Factory object onto the factory stack if the singleton has not been intialized.

Definition at line 130 of file IccXformFactory.cpp.

131{
132 if (!theXformCreator.get()) {
134
135 theXformCreator->DoPushFactory(new CIccBaseXformFactory);
136 }
137
138 return theXformCreator.get();
139}
std::unique_ptr< CIccXformCreator > CIccXformCreatorPtr
Class: CIccBaseXformFactory.
Class: CIccXformCreator.
static CIccXformCreatorPtr theXformCreator

Referenced by CreateXform(), PopFactory(), and PushFactory().

+ Here is the caller graph for this function:

◆ PopFactory()

static IIccXformFactory * CIccXformCreator::PopFactory ( )
inlinestatic

Function: PopFactory() Remove the top IIccXformFactory from the stack of xform factories tracked by the system.

Parameter(s): None

Returns the top IIccXformFactory from the stack of xform factories tracked by the system. The returned xform factory is no longer owned by the system and needs to be deleted to avoid memory leaks.

Note: The initial CIccSpecXformFactory cannot be popped off the stack.

Definition at line 215 of file IccXformFactory.h.

References DoPopFactory(), and GetInstance().

+ Here is the call graph for this function:

◆ PushFactory()

static void CIccXformCreator::PushFactory ( IIccXformFactory * pFactory)
inlinestatic

Function: PushFactory(pFactory) Add an IIccXformFactory to the stack of xform factories tracked by the system.

Parameter(s): pFactory = pointer to an IIccXformFactory object to add to the system. The pFactory must be created with new, and will be owned CIccXformCreator until popped off the stack using PopFactory(). Any factories not popped off will be taken care of properly on application shutdown.

Definition at line 199 of file IccXformFactory.h.

200 { CIccXformCreator::GetInstance()->CIccXformCreator::DoPushFactory(pFactory); }

References GetInstance().

+ Here is the call graph for this function:

Member Data Documentation

◆ factoryStack

CIccXformFactoryList CIccXformCreator::factoryStack
private

Definition at line 241 of file IccXformFactory.h.

◆ theXformCreator

std::unique_ptr< CIccXformCreator > CIccXformCreator::theXformCreator
staticprivate

Definition at line 239 of file IccXformFactory.h.


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