![]() |
Kigs Framework
Doc version 0.8
Open source multi purpose Rapid Application Development framework
|
#include <Core.h>
Classes | |
struct | DecorateMethodPair |
decorator map More... | |
Public Member Functions | |
InstanceFactory * | GetInstanceFactory () |
return instance factory More... | |
MiniInstanceFactory * | GetUpgradorFactory () const |
kigs::unordered_map< kstl::string, CoreItemOperatorCreateMethod > & | GetDefaultCoreItemOperatorConstructMap () |
return the map for CoreItemOperator creation in general purpose case More... | |
void | CleanSingletonMap () |
MEMORYMANAGEMENT_START MemoryManager * | GetMemoryManager () |
retreive the memory manager More... | |
void | GetSemaphore () |
add a semaphore to the core | |
void | ReleaseSemaphore () |
release a semaphore from the core | |
template<> | |
CMSP | GetInstanceOf (const kstl::string &instancename, const KigsID &classname) |
Static Public Member Functions | |
static void | Init () |
Init create the unique instance and all members (memory manager, instance factory...) More... | |
static void | ModuleInit (KigsCore *core, ModuleBase *module) |
register a module in the map More... | |
static void | Close (bool closeMemoryManager=true) |
delete all unique instance members More... | |
static KigsCore * | Instance () |
return unique instance of KigsCore More... | |
static CoreBaseApplication * | GetCoreApplication () |
static NotificationCenter * | GetNotificationCenter () |
static ModuleBase * | GetModule (const KigsID &classname) |
get the registered module given its name | |
template<typename... Args> | |
static CMSP | GetInstanceOf (const kstl::string &instancename, const KigsID &classname, Args &&... args) |
return an instance of the given class More... | |
static CMSP & | GetSingleton (const KigsID &classname) |
return an unique instance of the given class (Design Pattern Singleton) More... | |
static void | ReleaseSingleton (KigsID classname) |
destroy the unique instance of the given class More... | |
static CoreTreeNode * | GetRootNode () |
return inheritance tree root node | |
static void | ModuleStaticInit (KigsCore *core) |
for the core unique instance to be unique even in windows dll More... | |
static bool | IsInit () |
check for init More... | |
static bool | IsMultiThread () |
check for multithread More... | |
template<class Module_Type > | |
static Module_Type * | LoadKigsModule (const std::string &Module_Type_Name, const kstl::vector< CoreModifiableAttribute * > *params=0) |
Load and initialize the given module. More... | |
static const char * | GetErrorBuffer () |
get the error buffer More... | |
static void | DumpMessageBuffer () |
dump the message buffer More... | |
static void | SetMessagePrintf (int(*)(const char *format...)) |
print function | |
static void | SetMessagePrintf (void *func) |
print function | |
static void | AddError (const char *, long, const kstl::string &, int errorLevel=0) |
add an error in the error buffer More... | |
static void | AddWarning (const char *, long, const kstl::string &, int warningLevel=0) |
add a warning in the error buffer More... | |
static void | AddMessage (const kstl::string &) |
add a message in the error buffer More... | |
static GlobalProfilerManager * | GetProfileManager () |
Get the unique instance of GlobalProfilerManager. More... | |
static CoreModifiable * | GetThreadProfiler () |
Get the unique instance of ThreadProfiler. More... | |
static kigs::unordered_map< CoreModifiable *, kstl::vector< CoreModifiableAttribute * > > & | getReferenceMap () |
Get the map of referenced CoreModifiable (maReference) More... | |
static bool | ParseXml (const kstl::string &filename, CoreModifiable *delegateObject, const char *force_as_format=0) |
Parse the given xml file, using delegateObject as delegate. More... | |
Protected Member Functions | |
void | ProtectedAddError (const kstl::string &Error) |
add a message in the error buffer More... | |
void | ProtectedDumpMessageBuffer () |
dump the message buffer | |
KigsCore () | |
protected constructor | |
~KigsCore () | |
protected destructor | |
void | ManagePostDestruction () |
manage post destruction | |
Static Protected Member Functions | |
static void | SetCoreApplication (CoreBaseApplication *_instance) |
static void | SetNotificationCenter (NotificationCenter *_instance) |
static void | SetMultiThread () |
set the KigsCore multiTread | |
static void | CloseMultiThread () |
remove the multiThread management of the KigsCore | |
Protected Attributes | |
InstanceFactory * | mInstanceFactory |
pointer to instance factory singleton | |
kigs::unordered_map< KigsID, ModuleBase * > * | mModuleBaseInstanceMap |
pointer to initialised modules | |
kigs::unordered_map< KigsID, CMSP > * | mSingletonMap |
pointer to created singletons | |
std::mutex | mPostDestructionListMutex |
manage post destruction | |
kigs::unordered_map< CoreModifiable *, kstl::vector< CoreModifiableAttribute * > > * | mReferenceMap |
CoreModifiable referenced by maReference. | |
MEMORYMANAGEMENT_START MemoryManager * | mMemoryInstance |
pointer the memory manager instance | |
MEMORYMANAGEMENT_END CoreTreeNode * | mRootNode |
pointer to the root of the class inheritance tree | |
CMSP | mSemaphore |
list of semaphore | |
bool * | mMultiThread |
TRUE if the KigsCore is multiThread. | |
kstl::vector< kstl::string > * | mErrorList |
list of error | |
int(* | KigsMsgPrintf )(const char *format...) |
output function for error and warning msb | |
GlobalProfilerManager * | mProfilerManager |
Profilers management. | |
Static Protected Attributes | |
static KigsCore * | mCoreInstance =0 |
static pointer to the KigsCore singleton More... | |
Friends | |
class | CoreBaseApplication |
class | ModuleThread |
Singleton class used to manage all others.
|
static |
add an error in the error buffer
char* | : file in which the error appears |
long | : line number of the error appears |
string | : error message |
errorLevel | : error level in [0,3] |
|
static |
add a message in the error buffer
string | : message |
|
static |
add a warning in the error buffer
char | : file in which the warning appears |
long | : line number of the warning appears |
string | : warning message |
warningLevel | : warning level in [0,3] |
void KigsCore::CleanSingletonMap | ( | ) |
do nothing if no instance of the class
|
static |
|
static |
dump the message buffer
use KIGS_DUMP_MESSAGES
|
static |
Get the GetCoreApplication instance (Design Pattern Singleton)
kigs::unordered_map< kstl::string, CoreItemOperatorCreateMethod > & KigsCore::GetDefaultCoreItemOperatorConstructMap | ( | ) |
return the map for CoreItemOperator creation in general purpose case
|
static |
get the error buffer
use Macro KIGS_ERROR to add errors
InstanceFactory * KigsCore::GetInstanceFactory | ( | ) |
return instance factory
Get the instance factory instance (Design Pattern Singleton)
|
inline |
if instance factory fail then create a DoNothingObject (and print debug messages)
|
inlinestatic |
return an instance of the given class
instancename | : name of the instance |
classname | : name of the class |
get the instance of 'classname' named 'instancename' or call the instance factory if not exist
return a DoNothingObject if the factory failed
if instance factory fail then create a DoNothingObject (and print debug messages)
MEMORYMANAGEMENT_START MemoryManager * KigsCore::GetMemoryManager | ( | ) |
retreive the memory manager
return memory manager
|
static |
Get the NotificationCenter instance (Design Pattern Singleton)
|
static |
Get the unique instance of GlobalProfilerManager.
|
inlinestatic |
Get the map of referenced CoreModifiable (maReference)
|
static |
return an unique instance of the given class (Design Pattern Singleton)
classname | : name of the class |
get the instance of 'classname' or call the instance factory if not exist
return NULL if the factory failed
search for an already existing instance
and return it if found
else create a new instance
|
inlinestatic |
Get the unique instance of ThreadProfiler.
|
inline |
Get the MiniInstanceFactory used by Upgrador mechanism
|
static |
Init create the unique instance and all members (memory manager, instance factory...)
Init KigsCore singleton and all its members
root node used by inheritance tree
memory manager
instance factory
map for all initialised modules
map for all singleton
init error management
map for references
declare DoNothingObject (created when unknown object is asked to InstanceFactory)
|
static |
|
static |
check for init
|
static |
check for multithread
return true if thread module is init
|
inlinestatic |
Load and initialize the given module.
|
static |
register a module in the map
Called by modules to be registered in KigsCore
core | : link to the core, NOT NULL |
module | : module to register, CAN BE NULL |
|
static |
for the core unique instance to be unique even in windows dll
called by dll module to init correctly their unique instance (Windows dll => each dll has its own static members)
core | : instance of the KigsCore |
|
static |
Parse the given xml file, using delegateObject as delegate.
filename | : the name of the file to parse |
delegateObject | : the CoreModifiable used as delegate |
force_as_format | : "xml" or "kxml". if nothing is specified, use real extension to define xml or kxml. |
The delegateObject will receive the parse information using the following method if it declare/implement them :
DECLARE_METHOD(XMLElementStartDescription); DECLARE_METHOD(XMLElementEndDescription); DECLARE_METHOD(XMLDeclHandler); DECLARE_METHOD(XMLCharacterHandler); COREMODIFIABLE_METHODS(XMLElementStartDescription,XMLElementEndDescription,XMLDeclHandler,XMLCharacterHandler); If the format is force, the extension of the file can be anything (plist, dat, ...)
|
protected |
add a message in the error buffer
Error | : message |
|
static |
destroy the unique instance of the given class
classname | : name of the class |
destroy the instance of 'classname' and remove reference as singleton (allow to create another one)
search for an already existing instance
do nothing if no instance of the class
|
staticprotected |
Set current CoreBaseApplication
_instance | CoreBaseApplication instance |
|
staticprotected |
Set the NotificationCenter member
_instance | NotificationCenter instance |
|
staticprotected |
static pointer to the KigsCore singleton
core unique instance, used also in all dll