Core Class Reference

#include <Core.h>

Inherits Poller, and Singleton< T >< Core >.

Inheritance diagram for Core:

Inheritance graph
[legend]
Collaboration diagram for Core:

Collaboration graph
[legend]
List of all members.

Public Types

typedef unsigned int(*) MethodInstancesNumber ()
typedef String(*) MethodManual ()

Public Member Functions

int dispatch ()
int main ()
int registerService (const String &name, Fabrica fabrica, MethodInstancesNumber instancesNumberLimit, MethodInstancesNumber instancesNumber, MethodManual manual)
int spawn (const String &serviceName, const ValueList &params, ServiceBase **instance=NULL)
int spawn (const String &serviceName, ServiceBase **instance=NULL)
int fork (const ObjectId id, ServiceBase **instance=NULL)
int kill (ServiceBase *instance)
int kill (const ObjectId id)
int killAll (const String &serviceName)
int suspend (const ObjectId id)
int suspendAll (const String &serviceName)
int resume (const ObjectId id)
int resumeAll (const String &serviceName)
int suspendTimers ()
int resumeTimers ()
int notify (ServiceBase *instance, const ValueList &params=ValueList())
int notify (const ObjectId id, const ValueList &params=ValueList())
int notifyAll (const String &serviceName, const ValueList &params=ValueList())
int quit ()
 SIGNAL (idle)

Static Public Member Functions

static int init ()
static int listServices (String &text)
static int listInstances (String &text)

Private Types

typedef map< String, SpawnInfoServiceList

Private Member Functions

 Core ()
virtual ~Core ()

Private Attributes

bool _quit

Static Private Attributes

static ServiceList _services

Friends

class Singleton< Core >
class NamedObject

Classes

struct  SpawnInfo

Detailed Description

Definition at line 33 of file Core.h.


Member Typedef Documentation

typedef unsigned int(*) Core::MethodInstancesNumber()

Definition at line 42 of file Core.h.

typedef String(*) Core::MethodManual()

Definition at line 43 of file Core.h.

typedef map<String, SpawnInfo> Core::ServiceList [private]

Definition at line 93 of file Core.h.


Constructor & Destructor Documentation

Core::Core (  )  [private]

Definition at line 366 of file Core.cpp.

References _quit.

Core::~Core (  )  [private, virtual]

Definition at line 371 of file Core.cpp.


Member Function Documentation

int Core::init (  )  [static]

Definition at line 20 of file Core.cpp.

References CONFIG(), CORE(), OK, and SYSLOG().

Referenced by Application::init().

int Core::dispatch (  ) 

Definition at line 30 of file Core.cpp.

References Object::deletePostponed(), EMIT, ERROR_BACKTRACE(), FAILED(), OK, Poller::poll(), and Timer::shootTimers().

Referenced by main().

int Core::main (  ) 

Definition at line 48 of file Core.cpp.

References _quit, dispatch(), ERROR_BACKTRACE(), FAILED(), OK, and SUCCEEDED().

int Core::registerService ( const String name,
Fabrica  fabrica,
MethodInstancesNumber  instancesNumberLimit,
MethodInstancesNumber  instancesNumber,
MethodManual  manual 
)

Definition at line 59 of file Core.cpp.

References _services, CSTRING(), ERROR, MSG_CORE_SERVICE_ALREADY_REGISTERED, MSG_NULL_POINTER, and OK.

int Core::spawn ( const String serviceName,
const ValueList params,
ServiceBase **  instance = NULL 
)

Definition at line 78 of file Core.cpp.

References _services, CSTRING(), DEBUG, ERROR, Singleton< T >::instance(), MSG_CORE_SERVICE_CANNOT_SPAWN, MSG_CORE_SERVICE_NSTANCES_LIMIT_EXCEEDED, MSG_CORE_SERVICE_UNKNOWN, and OK.

Referenced by spawn().

int Core::spawn ( const String serviceName,
ServiceBase **  instance = NULL 
)

Definition at line 104 of file Core.cpp.

References ERROR_BACKTRACE(), FAILED(), Singleton< T >::instance(), OK, and spawn().

int Core::fork ( const ObjectId  id,
ServiceBase **  instance = NULL 
)

Definition at line 114 of file Core.cpp.

References CSTRING(), DEBUG, ERROR, ERROR_BACKTRACE(), FAILED(), Object::get(), Singleton< T >::instance(), MSG_CORE_SERVICE_CANNOT_FORK, MSG_CORE_SERVICE_NOT_FORKABLE, and OK.

int Core::kill ( ServiceBase instance  ) 

Definition at line 136 of file Core.cpp.

References ERROR, ERROR_BACKTRACE(), FAILED(), Singleton< T >::instance(), MSG_NULL_POINTER, and OK.

Referenced by kill().

int Core::kill ( const ObjectId  id  ) 

Definition at line 149 of file Core.cpp.

References ERROR, ERROR_BACKTRACE(), FAILED(), Object::get(), Singleton< T >::instance(), kill(), MSG_CORE_UNEXPECTED_ID, and OK.

int Core::killAll ( const String serviceName  ) 

Definition at line 167 of file Core.cpp.

References Object::_objects, ERROR_BACKTRACE(), FAILED(), ServiceBase::kill(), NamedObject::name(), and OK.

int Core::suspend ( const ObjectId  id  ) 

Definition at line 186 of file Core.cpp.

References ERROR_BACKTRACE(), FAILED(), Object::get(), OK, and Object::suspend().

int Core::suspendAll ( const String serviceName  ) 

Definition at line 200 of file Core.cpp.

References Object::_objects, ERROR_BACKTRACE(), FAILED(), NamedObject::name(), OK, and ServiceBase::suspend().

int Core::resume ( const ObjectId  id  ) 

Definition at line 219 of file Core.cpp.

References ERROR_BACKTRACE(), FAILED(), Object::get(), OK, and Object::resume().

int Core::resumeAll ( const String serviceName  ) 

Definition at line 233 of file Core.cpp.

References Object::_objects, ERROR_BACKTRACE(), FAILED(), NamedObject::name(), OK, and ServiceBase::resume().

int Core::suspendTimers (  ) 

Definition at line 252 of file Core.cpp.

References Object::_objects, ERROR_BACKTRACE(), FAILED(), OK, and Timer::suspend().

int Core::resumeTimers (  ) 

Definition at line 269 of file Core.cpp.

References Object::_objects, ERROR_BACKTRACE(), FAILED(), OK, and Timer::resume().

int Core::notify ( ServiceBase instance,
const ValueList params = ValueList() 
)

Definition at line 286 of file Core.cpp.

References ERROR, ERROR_BACKTRACE(), FAILED(), Singleton< T >::instance(), MSG_NULL_POINTER, and OK.

Referenced by notify().

int Core::notify ( const ObjectId  id,
const ValueList params = ValueList() 
)

Definition at line 299 of file Core.cpp.

References ERROR, ERROR_BACKTRACE(), FAILED(), Object::get(), Singleton< T >::instance(), MSG_CORE_UNEXPECTED_ID, notify(), and OK.

int Core::notifyAll ( const String serviceName,
const ValueList params = ValueList() 
)

Definition at line 317 of file Core.cpp.

References Object::_objects, ERROR_BACKTRACE(), FAILED(), NamedObject::name(), ServiceBase::notify(), and OK.

int Core::quit (  ) 

Definition at line 336 of file Core.cpp.

References _quit, and OK.

int Core::listServices ( String text  )  [static]

Definition at line 342 of file Core.cpp.

References _services, CORE_COLOR_TITLE(), CSTRING(), String::eol(), OK, and String::sprintf().

static int Core::listInstances ( String text  )  [static]

Reimplemented from Object.

Core::SIGNAL ( idle   ) 


Friends And Related Function Documentation

friend class Singleton< Core > [friend]

Definition at line 37 of file Core.h.

friend class NamedObject [friend]

Reimplemented from Object.

Definition at line 38 of file Core.h.


Member Data Documentation

Core::ServiceList Core::_services [static, private]

Definition at line 98 of file Core.h.

Referenced by NamedObject::apropos(), listServices(), NamedObject::manual(), NamedObject::names(), registerService(), and spawn().

bool Core::_quit [private]

Definition at line 99 of file Core.h.

Referenced by Core(), main(), and quit().


The documentation for this class was generated from the following files:
Generated on Thu Sep 6 20:13:34 2007 for Pylon Application Platform by  doxygen 1.5.1