KSquare Utilities
KKB::XmlFactory Class Referenceabstract

#include <XmlStream.h>

+ Inheritance diagram for KKB::XmlFactory:

Public Member Functions

 XmlFactory (const KKStr &_clasName)
 
virtual const KKStrClassName () const
 
virtual XmlElementPtr ManufatureXmlElement (XmlTagPtr tag, XmlStream &s, VolConstBool &cancelFlag, RunLog &log)=0
 

Static Public Member Functions

static XmlFactoryFactoryLookUp (const KKStr &className)
 
static void FinalCleanUp ()
 
static void RegisterFactory (XmlFactory *factory)
 

Static Public Attributes

static XmlFactoryManagerPtr globalXmlFactoryManager = NULL
 

Detailed Description

Definition at line 382 of file XmlStream.h.

Constructor & Destructor Documentation

XmlFactory::XmlFactory ( const KKStr _clasName)

Definition at line 931 of file XmlStream.cpp.

References KKB::KKStr::KKStr().

Referenced by XmlFactoryModelOldSVM::XmlFactoryModelOldSVM(), and XmlFactoryTrainingClass::XmlFactoryTrainingClass().

931  :
932  className (_clasName)
933 {
934 }

Member Function Documentation

virtual const KKStr& KKB::XmlFactory::ClassName ( ) const
inlinevirtual

Definition at line 387 of file XmlStream.h.

Referenced by KKB::XmlFactoryManager::RegisterFactory().

387 {return className;}
XmlFactory * XmlFactory::FactoryLookUp ( const KKStr className)
static

summary>Register a instance of a Derives Factory class for the Global XmlFactoryManager.

param name = 'factory'> The instance that is being registered; factories will take ownership and the method 'XmlStream' will be responsible for deleting upon application shutdown.

Definition at line 879 of file XmlStream.cpp.

References KKB::GlobalGoalKeeper::EndBlock(), KKB::XmlFactoryManager::FactoryLookUp(), globalXmlFactoryManager, KKB::GlobalGoalKeeper::StartBlock(), and KKB::XmlFactoryManager::XmlFactoryManager().

Referenced by KKB::XmlStream::GetNextToken().

880 {
882  if (globalXmlFactoryManager == NULL)
883  {
884  globalXmlFactoryManager = new XmlFactoryManager ("globalXmlFactoryManager");
885  atexit (FinalCleanUp);
886  }
887 
888  XmlFactory* factory = globalXmlFactoryManager->FactoryLookUp (className);
889 
891 
892  return factory;
893 } /* FactoryLookUp */
XmlFactory * FactoryLookUp(const KKStr &className) const
Definition: XmlStream.cpp:979
static XmlFactoryManagerPtr globalXmlFactoryManager
Definition: XmlStream.h:402
static void FinalCleanUp()
Definition: XmlStream.cpp:921
void XmlFactory::FinalCleanUp ( )
static

Definition at line 921 of file XmlStream.cpp.

References globalXmlFactoryManager.

922 {
926 }
static XmlFactoryManagerPtr globalXmlFactoryManager
Definition: XmlStream.h:402
void XmlFactory::RegisterFactory ( XmlFactory factory)
static

Definition at line 897 of file XmlStream.cpp.

References KKB::KKStr::Concat(), KKB::GlobalGoalKeeper::EndBlock(), globalXmlFactoryManager, KKB::KKException::KKException(), KKB::XmlFactoryManager::RegisterFactory(), KKB::GlobalGoalKeeper::StartBlock(), and KKB::XmlFactoryManager::XmlFactoryManager().

Referenced by XmlFactoryTrainingClass::FactoryInstance(), and XmlFactoryModelOldSVM::FactoryInstance().

898 {
899  if (!factory)
900  {
901  KKStr errMsg = "XmlStream::RegisterFactory ***ERROR*** (factory == NULL).";
902  cerr << endl << errMsg << endl << endl;
903  throw KKException (errMsg);
904  }
905 
907 
909  {
910  globalXmlFactoryManager = new XmlFactoryManager ("globalXmlFactoryManager");
911  atexit (FinalCleanUp);
912  }
913 
915 
917 }
HTMLReport &__cdecl endl(HTMLReport &htmlReport)
Definition: HTMLReport.cpp:240
void RegisterFactory(XmlFactory *factory)
Definition: XmlStream.cpp:959
static XmlFactoryManagerPtr globalXmlFactoryManager
Definition: XmlStream.h:402
static void FinalCleanUp()
Definition: XmlStream.cpp:921

Member Data Documentation

XmlFactoryManagerPtr XmlFactory::globalXmlFactoryManager = NULL
static

Definition at line 402 of file XmlStream.h.

Referenced by FactoryLookUp(), FinalCleanUp(), and RegisterFactory().


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