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

Class: CIccTagCreator. More...

#include <IccTagFactory.h>

+ Collaboration diagram for CIccTagCreator:

Public Member Functions

 ~CIccTagCreator ()
 

Static Public Member Functions

static CIccTagCreateTag (icTagTypeSignature tagTypeSig)
 Function: CreateTag(tagTypeSig) Create a tag of type tagTypeSig.
 
static icTagSignature GetTagNameSig (const icChar *szName)
 Function: GetTagNameSig(szTagName) Get signature from tag display name.
 
static const icCharGetTagSigName (icTagSignature tagTypeSig)
 Function: GetTagSigName(tagSig) Get display name of tagSig.
 
static icTagTypeSignature GetTagTypeNameSig (const icChar *szName)
 Function: GetTagTypeNameSig(szTypeName) Get signature based on display name of tag type.
 
static const icCharGetTagTypeSigName (icTagTypeSignature tagTypeSig)
 Function: GetTagTypeSigName(tagTypeSig) Get display name of tagTypeSig.
 
static IIccTagFactoryPopFactory ()
 Function: PopFactory() Remove the top IIccTagFactory from the stack of tag factories tracked by the system.
 
static void PushFactory (IIccTagFactory *pFactory)
 Function: PushFactory(pFactory) Add an IIccTagFactory to the stack of tag factories tracked by the system.
 

Private Member Functions

 CIccTagCreator ()
 Only GetInstance() can create the signleton.
 
CIccTagDoCreateTag (icTagTypeSignature tagTypeSig)
 
icTagSignature DoGetTagNameSig (const icChar *szName)
 
const icCharDoGetTagSigName (icTagSignature tagSig)
 
icTagTypeSignature DoGetTagTypeNameSig (const icChar *szName)
 
const icCharDoGetTagTypeSigName (icTagTypeSignature tagTypeSig)
 
IIccTagFactoryDoPopFactory (bool bAll=false)
 
void DoPushFactory (IIccTagFactory *pFactory)
 

Static Private Member Functions

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

Private Attributes

CIccTagFactoryList factoryStack
 

Static Private Attributes

static CIccTagCreatorPtr theTagCreator
 

Detailed Description

Class: CIccTagCreator.

Purpose: CIccTagCreator uses a singleton pattern to provide dynamically upgradeable CIccTag derived object creation based on tag signature.

Definition at line 263 of file IccTagFactory.h.

Constructor & Destructor Documentation

◆ ~CIccTagCreator()

CIccTagCreator::~CIccTagCreator ( )

Definition at line 529 of file IccTagFactory.cpp.

530{
531 IIccTagFactory *pFactory = DoPopFactory(true);
532
533 while (pFactory) {
534 delete pFactory;
535 pFactory = DoPopFactory(true);
536 }
537}
IIccTagFactory * DoPopFactory(bool bAll=false)
Class: IIccTagFactory.

◆ CIccTagCreator()

CIccTagCreator::CIccTagCreator ( )
inlineprivate

Only GetInstance() can create the signleton.

Definition at line 372 of file IccTagFactory.h.

372{ }

Member Function Documentation

◆ CreateTag()

static CIccTag * CIccTagCreator::CreateTag ( icTagTypeSignature tagTypeSig)
inlinestatic

Function: CreateTag(tagTypeSig) Create a tag of type tagTypeSig.

Parameter(s): tagTypeSig = signature of the ICC tag type for the tag to be created

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

Definition at line 279 of file IccTagFactory.h.

280 { return CIccTagCreator::GetInstance()->DoCreateTag(tagTypeSig); }
static CIccTagCreator * GetInstance()
Function: GetInstance() Private static function to access singleton CiccTagCreator Object.
CIccTag * DoCreateTag(icTagTypeSignature tagTypeSig)

References DoCreateTag(), and GetInstance().

Referenced by CIccTag::Create(), and CIccTagArray::Read().

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

◆ DoCreateTag()

CIccTag * CIccTagCreator::DoCreateTag ( icTagTypeSignature tagTypeSig)
private

Definition at line 550 of file IccTagFactory.cpp.

551{
552 CIccTagFactoryList::iterator i;
553 CIccTag *rv = NULL;
554
555 for (i=factoryStack.begin(); i!=factoryStack.end(); i++) {
556 rv = (*i)->CreateTag(tagTypeSig);
557 if (rv)
558 break;
559 }
560 return rv;
561}
CIccTagFactoryList factoryStack
Class: CIccTag.

Referenced by CreateTag().

+ Here is the caller graph for this function:

◆ DoGetTagNameSig()

icTagSignature CIccTagCreator::DoGetTagNameSig ( const icChar * szName)
private

Definition at line 577 of file IccTagFactory.cpp.

578{
579 CIccTagFactoryList::iterator i;
581
582 for (i = factoryStack.begin(); i != factoryStack.end(); i++) {
583 rv = (*i)->GetTagNameSig(szName);
584 if (rv!=icSigUnknownTag)
585 return rv;
586 }
587
588 return icSigUnknownTag;
589}
const icChar * szName
#define icSigUnknownTag
Convenience Enum Definitions - Not defined in ICC specification.
icTagSignature
public tags and sizes

References icSigUnknownTag, and szName.

Referenced by GetTagNameSig().

+ Here is the caller graph for this function:

◆ DoGetTagSigName()

const icChar * CIccTagCreator::DoGetTagSigName ( icTagSignature tagSig)
private

Definition at line 563 of file IccTagFactory.cpp.

564{
565 CIccTagFactoryList::iterator i;
566 const icChar* rv;
567
568 for (i=factoryStack.begin(); i!=factoryStack.end(); i++) {
569 rv = (*i)->GetTagSigName(tagSig);
570 if (rv)
571 return rv;
572 }
573
574 return NULL;
575}
char icChar
Definition IccDefs.h:109

Referenced by GetTagSigName().

+ Here is the caller graph for this function:

◆ DoGetTagTypeNameSig()

icTagTypeSignature CIccTagCreator::DoGetTagTypeNameSig ( const icChar * szName)
private

Definition at line 606 of file IccTagFactory.cpp.

607{
608 CIccTagFactoryList::iterator i;
610
611 for (i = factoryStack.begin(); i != factoryStack.end(); i++) {
612 rv = (*i)->GetTagTypeNameSig(szName);
613 if (rv!=icSigUnknownType)
614 return rv;
615 }
616
617 return icSigUnknownType;
618}
icTagTypeSignature
#define icSigUnknownType
Convenience Enum Definitions - Not defined in ICC specification.

References icSigUnknownType, and szName.

Referenced by GetTagTypeNameSig().

+ Here is the caller graph for this function:

◆ DoGetTagTypeSigName()

const icChar * CIccTagCreator::DoGetTagTypeSigName ( icTagTypeSignature tagTypeSig)
private

Definition at line 592 of file IccTagFactory.cpp.

593{
594 CIccTagFactoryList::iterator i;
595 const icChar* rv;
596
597 for (i=factoryStack.begin(); i!=factoryStack.end(); i++) {
598 rv = (*i)->GetTagTypeSigName(tagTypeSig);
599 if (rv)
600 return rv;
601 }
602
603 return NULL;
604}

Referenced by GetTagTypeSigName().

+ Here is the caller graph for this function:

◆ DoPopFactory()

IIccTagFactory * CIccTagCreator::DoPopFactory ( bool bAll = false)
private

Definition at line 625 of file IccTagFactory.cpp.

626{
627// int nNum = (bAll ? 0 : 1);
628
629 if (factoryStack.size()>0) {
630 CIccTagFactoryList::iterator i=factoryStack.begin();
631 IIccTagFactory* rv = (*i);
632 factoryStack.pop_front();
633 return rv;
634 }
635 return NULL;
636}

Referenced by PopFactory().

+ Here is the caller graph for this function:

◆ DoPushFactory()

void CIccTagCreator::DoPushFactory ( IIccTagFactory * pFactory)
private

Definition at line 620 of file IccTagFactory.cpp.

621{
622 factoryStack.push_front(pFactory);
623}

◆ GetInstance()

CIccTagCreator * CIccTagCreator::GetInstance ( )
staticprivate

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

Parameter(s): None

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

Definition at line 539 of file IccTagFactory.cpp.

540{
541 if (!theTagCreator.get()) {
543
544 theTagCreator->DoPushFactory(new CIccSpecTagFactory);
545 }
546
547 return theTagCreator.get();
548}
std::unique_ptr< CIccTagCreator > CIccTagCreatorPtr
Class: CIccSpecTagFactory.
Class: CIccTagCreator.
static CIccTagCreatorPtr theTagCreator

Referenced by CreateTag(), GetTagNameSig(), GetTagSigName(), GetTagTypeNameSig(), GetTagTypeSigName(), PopFactory(), and PushFactory().

+ Here is the caller graph for this function:

◆ GetTagNameSig()

static icTagSignature CIccTagCreator::GetTagNameSig ( const icChar * szName)
inlinestatic

Function: GetTagNameSig(szTagName) Get signature from tag display name.

Parameter(s): szTagName = name of tag

Returns tag signature of tag if tag name is recognized by the factory, icSigUnknownTag if the tag name is not recognized.

Definition at line 306 of file IccTagFactory.h.

307 {
309 }
icTagSignature DoGetTagNameSig(const icChar *szName)

References DoGetTagNameSig(), GetInstance(), and szName.

Referenced by icGetTagNameSig().

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

◆ GetTagSigName()

static const icChar * CIccTagCreator::GetTagSigName ( icTagSignature tagTypeSig)
inlinestatic

Function: GetTagSigName(tagSig) Get display name of tagSig.

Parameter(s): tagSig = signature of the ICC tag to get a name for

Returns ptr to string containing name of tag type if it is recognized by any factory, NULL if all factories do not create tagTypeSig tags.

Definition at line 292 of file IccTagFactory.h.

293 { return CIccTagCreator::GetInstance()->DoGetTagSigName(tagTypeSig); }
const icChar * DoGetTagSigName(icTagSignature tagSig)

References DoGetTagSigName(), and GetInstance().

Referenced by CIccInfo::GetTagSigName(), and icGetTagSigName().

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

◆ GetTagTypeNameSig()

static icTagTypeSignature CIccTagCreator::GetTagTypeNameSig ( const icChar * szName)
inlinestatic

Function: GetTagTypeNameSig(szTypeName) Get signature based on display name of tag type.

Parameter(s): szTypeName = name of the ICC tag type to get a signature for

Returns tag type signature of tag type name if type name is recognized by the factory, icSigUnknownType if the type name is not recognized.

Definition at line 335 of file IccTagFactory.h.

336 {
338 }
icTagTypeSignature DoGetTagTypeNameSig(const icChar *szName)

References DoGetTagTypeNameSig(), GetInstance(), and szName.

Referenced by icGetTypeNameTagSig().

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

◆ GetTagTypeSigName()

static const icChar * CIccTagCreator::GetTagTypeSigName ( icTagTypeSignature tagTypeSig)
inlinestatic

Function: GetTagTypeSigName(tagTypeSig) Get display name of tagTypeSig.

Parameter(s): tagTypeSig = signature of the ICC tag type to get a name for

Returns ptr to string containing name of tag type if it is recognized by any factory, NULL if all factories do not create tagTypeSig tags.

Definition at line 322 of file IccTagFactory.h.

323 { return CIccTagCreator::GetInstance()->DoGetTagTypeSigName(tagTypeSig); }
const icChar * DoGetTagTypeSigName(icTagTypeSignature tagTypeSig)

References DoGetTagTypeSigName(), and GetInstance().

Referenced by CIccTagZipUtf8Text::Describe(), CIccInfo::GetTagTypeSigName(), icGetTagSigTypeName(), and CIccTagZipUtf8Text::Validate().

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

◆ PopFactory()

static IIccTagFactory * CIccTagCreator::PopFactory ( )
inlinestatic

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

Parameter(s): None

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

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

Definition at line 367 of file IccTagFactory.h.

References DoPopFactory(), and GetInstance().

+ Here is the call graph for this function:

◆ PushFactory()

static void CIccTagCreator::PushFactory ( IIccTagFactory * pFactory)
inlinestatic

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

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

Definition at line 351 of file IccTagFactory.h.

352 { CIccTagCreator::GetInstance()->CIccTagCreator::DoPushFactory(pFactory); }

References GetInstance().

Referenced by main().

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

Member Data Documentation

◆ factoryStack

CIccTagFactoryList CIccTagCreator::factoryStack
private

Definition at line 397 of file IccTagFactory.h.

◆ theTagCreator

std::unique_ptr< CIccTagCreator > CIccTagCreator::theTagCreator
staticprivate

Definition at line 395 of file IccTagFactory.h.


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