#include <Core.h>
Inherits Poller, and Singleton< T >< Core >.
Inheritance diagram for Core:


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 ¶ms, 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 ¶ms=ValueList()) |
| int | notify (const ObjectId id, const ValueList ¶ms=ValueList()) |
| int | notifyAll (const String &serviceName, const ValueList ¶ms=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, SpawnInfo > | ServiceList |
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 |
Definition at line 33 of file Core.h.
| typedef unsigned int(*) Core::MethodInstancesNumber() |
| typedef String(*) Core::MethodManual() |
typedef map<String, SpawnInfo> Core::ServiceList [private] |
| int Core::init | ( | ) | [static] |
| 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().
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.
Definition at line 317 of file Core.cpp.
References Object::_objects, ERROR_BACKTRACE(), FAILED(), NamedObject::name(), ServiceBase::notify(), 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().
| Core::SIGNAL | ( | idle | ) |
friend class NamedObject [friend] |
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] |
1.5.1