IccMAX 2.1.27
Color Profile Tools
Loading...
Searching...
No Matches
CIccXformCreator Class Reference

#include <IccXformFactory.h>

Public Member Functions

 ~CIccXformCreator ()
 

Static Public Member Functions

static CIccXform * CreateXform (icXformType xformType, CIccTag *pTag=NULL, CIccCreateXformHintManager *pHintManager=NULL)
 
static IIccXformFactoryPopFactory ()
 
static void PushFactory (IIccXformFactory *pFactory)
 

Private Member Functions

 CIccXformCreator ()
 
CIccXform * DoCreateXform (icXformType xformType, CIccTag *pTag=NULL, CIccCreateXformHintManager *pHintManager=NULL)
 
IIccXformFactoryDoPopFactory (bool bAll=false)
 
void DoPushFactory (IIccXformFactory *pFactory)
 

Static Private Member Functions

static CIccXformCreatorGetInstance ()
 

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.

Constructor & Destructor Documentation

◆ ~CIccXformCreator()

CIccXformCreator::~CIccXformCreator ( )
121{
122 IIccXformFactory *pFactory = DoPopFactory(true);
123
124 while (pFactory) {
125 delete pFactory;
126 pFactory = DoPopFactory(true);
127 }
128}
Definition IccXformFactory.h:100
IIccXformFactory * DoPopFactory(bool bAll=false)
Definition IccXformFactory.cpp:159

References DoPopFactory().

+ Here is the call graph for this function:

◆ CIccXformCreator()

CIccXformCreator::CIccXformCreator ( )
inlineprivate

Only GetInstance() can create the signleton

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.

186 { return CIccXformCreator::GetInstance()->DoCreateXform(xformType, pTag, pHintManager); }
CIccXform * DoCreateXform(icXformType xformType, CIccTag *pTag=NULL, CIccCreateXformHintManager *pHintManager=NULL)
Definition IccXformFactory.cpp:141
static CIccXformCreator * GetInstance()
Definition IccXformFactory.cpp:130

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
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
Definition IccXformFactory.h:241

References IIccXformFactory::CreateXform(), and factoryStack.

Referenced by CreateXform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ DoPopFactory()

IIccXformFactory * CIccXformCreator::DoPopFactory ( bool  bAll = false)
private
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}

References factoryStack.

Referenced by ~CIccXformCreator(), and PopFactory().

+ Here is the caller graph for this function:

◆ DoPushFactory()

void CIccXformCreator::DoPushFactory ( IIccXformFactory pFactory)
private
155{
156 factoryStack.push_front(pFactory);
157}

References factoryStack.

Referenced by GetInstance(), and PushFactory().

+ Here is the caller graph for this function:

◆ 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.

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

References DoPushFactory(), and theXformCreator.

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

+ Here is the call graph for this function:
+ 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.

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.

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

References DoPushFactory(), and GetInstance().

+ Here is the call graph for this function:

Field Documentation

◆ factoryStack

CIccXformFactoryList CIccXformCreator::factoryStack
private

◆ theXformCreator

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

Referenced by GetInstance().


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