|
Dawn Framework 1.0
Universal data acquisition framework for embedded systems
|
Manages Programs object lifecycle and dispatch. More...
#include <handler.hxx>
Public Member Functions | |
| CProgHandler () | |
| Construct the Programs handler. | |
| ~CProgHandler ()=default | |
| Destruct the Programs handler. | |
| int | configureAll () |
| Configure all objects managed by this handler. | |
| int | deinitAll () |
| Deinitialize all Programs objects. | |
| CObject * | getObject (const SObjectId::ObjectId id) |
| Get a Programs object by object ID. | |
| CProgCommon * | getObjectAt (size_t index) const |
| Get object at index. | |
| CProgCommon * | getObjectById (const SObjectId::UObjectId &id) const |
| Get object by ObjectID. | |
| size_t | getObjectCount () const |
| Get total number of registered objects. | |
| const std::vector< CProgCommon * > & | getObjects () const |
| Get read-only access to all objects. | |
| CProgCommon * | getProg (SObjectId::UObjectId &id) const |
| Get a Programs object by object ID (type-safe). | |
| bool | hasThread () const |
| Check if any Programs are running. | |
| int | init (CDescriptor &desc, CIOHandler *io, IProgFactory *f) |
| Initialize the Programs handler. | |
| int | initAll () |
| Configure, bind, and initialize all Program objects. | |
| bool | isObjectValid (SObjectId::UObjectId &obj) const |
| Validate object ID in handler collection. | |
| int | objalloc (CDescriptor &desc, CDescriptor::allocobj_func_t func) |
| Allocate objects from descriptor. | |
| int | startAll () |
| Start all Programs objects. | |
| int | stopAll () |
| Stop all Programs objects. | |
Protected Member Functions | |
| const char * | getObjectTypeName () const |
| Get object type name for logging. | |
| virtual void | onInitObject (CProgCommon *obj) |
| Hook for subclass-specific post-object-init handling. | |
| virtual void | onStartObject (CProgCommon *obj) |
| Hook for subclass-specific pre-start operations. | |
| int | registerObject (CProgCommon *obj) |
| Register object. | |
Protected Attributes | |
| std::vector< CProgCommon * > | objects |
| Vector of registered objects. | |
Manages Programs object lifecycle and dispatch.
Creates, initializes, starts, stops, and provides lookup for all Programs objects in the system.
Definition at line 27 of file handler.hxx.
|
inline |
Construct the Programs handler.
Creates an empty handler with no Programs objects.
Definition at line 36 of file handler.hxx.
|
default |
Destruct the Programs handler.
Destroys all managed Programs objects.
|
inlineinherited |
Configure all objects managed by this handler.
Definition at line 114 of file generic_handler.hxx.
|
inlinevirtual |
Deinitialize all Programs objects.
Called during shutdown to clean up all Programs objects.
Reimplemented from dawn::CGenericHandler< CProgCommon >.
Definition at line 82 of file handler.hxx.
References dawn::CGenericHandler< T >::deinitAll().
|
virtual |
Get a Programs object by object ID.
Generic lookup method returning any CObject pointer.
| [in] | id | Object ID to look up. |
Implements dawn::IHandler.
Definition at line 134 of file handler.cxx.
References getProg(), and dawn::SObjectId::UObjectId::v.
|
inlineinherited |
Get object at index.
| index | Zero-based index. |
Definition at line 311 of file generic_handler.hxx.
|
inlineinherited |
Get object by ObjectID.
| id | ObjectID to retrieve. |
Definition at line 323 of file generic_handler.hxx.
|
inlineinherited |
Get read-only access to all objects.
Definition at line 298 of file generic_handler.hxx.
|
inlineprotectedvirtual |
Get object type name for logging.
Used in debug output and error messages.
Reimplemented from dawn::CGenericHandler< CProgCommon >.
Definition at line 171 of file handler.hxx.
| CProgCommon * CProgHandler::getProg | ( | SObjectId::UObjectId & | id | ) | const |
Get a Programs object by object ID (type-safe).
Retrieves a Programs object from the handler's collection.
| [in] | id | Object ID to look up. |
Definition at line 141 of file handler.cxx.
References dawn::CGenericHandler< T >::getObjectById().
|
inlinevirtual |
Check if any Programs are running.
Returns current operational state.
Reimplemented from dawn::CGenericHandler< CProgCommon >.
Definition at line 123 of file handler.hxx.
References dawn::CGenericHandler< T >::hasThread().
| int CProgHandler::init | ( | CDescriptor & | desc, |
| CIOHandler * | io, | ||
| IProgFactory * | f | ||
| ) |
Initialize the Programs handler.
Performs full Programs handler initialization.
| [in] | desc | Device descriptor. |
| [in] | io | I/O handler for I/O object lookup. |
| [in] | f | Optional user factory, or nullptr for built-in only. |
Definition at line 72 of file handler.cxx.
References dawn::CDevInspector::getInst(), and dawn::CDevInspector::registerProgHandler().
|
virtual |
Configure, bind, and initialize all Program objects.
Performs the Program lifecycle setup sequence: configure() for each object, bind IO dependencies, then object init().
Reimplemented from dawn::CGenericHandler< CProgCommon >.
Definition at line 99 of file handler.cxx.
References dawn::CGenericHandler< T >::configureAll(), dawn::CBindableObject::getIOMap(), dawn::CGenericHandler< CProgCommon >::getObjectAt(), dawn::CGenericHandler< CProgCommon >::getObjectCount(), dawn::CGenericHandler< T >::initAll(), and dawn::CBindableObject::setObjectMapItem().
|
virtual |
Validate object ID in handler collection.
Checks if the given object ID corresponds to a valid Program in the handler's collection.
| [in] | obj | Object ID to validate. |
Implements dawn::IHandler.
Definition at line 129 of file handler.cxx.
References dawn::SObjectId::objectIsProg().
|
inlineinherited |
Allocate objects from descriptor.
Generic descriptor allocation using callback pattern.
| desc | Device descriptor containing object definitions. |
| func | Static callback: void func(CHandler& handler, CDescObject&). |
Definition at line 339 of file generic_handler.hxx.
|
inlineprotectedvirtualinherited |
Hook for subclass-specific post-object-init handling.
| obj | Pointer to object that was just initialized. |
Definition at line 60 of file generic_handler.hxx.
|
inlineprotectedvirtualinherited |
Hook for subclass-specific pre-start operations.
| obj | Pointer to object about to start. |
Definition at line 70 of file generic_handler.hxx.
|
inlineprotectedinherited |
Register object.
| obj | Pointer to object to register. |
Definition at line 37 of file generic_handler.hxx.
|
inlinevirtual |
Start all Programs objects.
Activates all Programs for operation (e.g., start sampling thread, enable event processing).
Reimplemented from dawn::CGenericHandler< CProgCommon >.
Definition at line 96 of file handler.hxx.
References dawn::CGenericHandler< T >::startAll().
|
inlinevirtual |
Stop all Programs objects.
Deactivates all Programs (e.g., stop sampling thread, disable event processing).
Reimplemented from dawn::CGenericHandler< CProgCommon >.
Definition at line 110 of file handler.hxx.
References dawn::CGenericHandler< T >::stopAll().