|
Dawn Framework 1.0
Universal data acquisition framework for embedded systems
|
Manages PROTO object lifecycle and dispatch. More...
#include <handler.hxx>
Public Member Functions | |
| CProtoHandler () | |
| Constructor. | |
| ~CProtoHandler ()=default | |
| Destructor. | |
| int | configureAll () |
| Configure all objects managed by this handler. | |
| int | deinitAll () |
| Deinitialize all protocol objects. | |
| CObject * | getObject (const SObjectId::ObjectId id) |
| Get protocol object by ID. | |
| CProtoCommon * | getObjectAt (size_t index) const |
| Get object at index. | |
| CProtoCommon * | getObjectById (const SObjectId::UObjectId &id) const |
| Get object by ObjectID. | |
| size_t | getObjectCount () const |
| Get total number of registered objects. | |
| const std::vector< CProtoCommon * > & | getObjects () const |
| Get read-only access to all objects. | |
| CProtoCommon * | getProto (SObjectId::UObjectId &id) const |
| Get protocol object interface. | |
| bool | hasThread () const |
| Check if any protocol is running. | |
| int | init (CDescriptor &desc, CIOHandler *io, IProtoFactory *f) |
| Initialize protocol handler and instances. | |
| int | initAll () |
| Configure, bind, and initialize all protocol objects. | |
| bool | isObjectValid (SObjectId::UObjectId &obj) const |
| Validate protocol object ID. | |
| int | objalloc (CDescriptor &desc, CDescriptor::allocobj_func_t func) |
| Allocate objects from descriptor. | |
| int | startAll () |
| Start all protocol objects. | |
| int | stopAll () |
| Stop all protocol objects. | |
Protected Member Functions | |
| const char * | getObjectTypeName () const |
| Get object type name for logging. | |
| virtual void | onInitObject (CProtoCommon *obj) |
| Hook for subclass-specific post-object-init handling. | |
| virtual void | onStartObject (CProtoCommon *obj) |
| Hook for subclass-specific pre-start operations. | |
| int | registerObject (CProtoCommon *obj) |
| Register object. | |
Protected Attributes | |
| std::vector< CProtoCommon * > | objects |
| Vector of registered objects. | |
Manages PROTO object lifecycle and dispatch.
Creates, initializes, starts, stops, and provides lookup for all PROTO objects in the system.
Definition at line 27 of file handler.hxx.
|
inline |
Constructor.
Initializes the protocol handler with default state.
Definition at line 36 of file handler.hxx.
|
default |
Destructor.
Cleans up all protocol objects and handler state.
|
inlineinherited |
Configure all objects managed by this handler.
Definition at line 114 of file generic_handler.hxx.
|
inlinevirtual |
Deinitialize all protocol objects.
Calls deinit() on each protocol object.
Reimplemented from dawn::CGenericHandler< CProtoCommon >.
Definition at line 82 of file handler.hxx.
References dawn::CGenericHandler< T >::deinitAll().
|
virtual |
Get protocol object by ID.
Retrieves a protocol instance by its object ID.
| [in] | id | Protocol object ID. |
Implements dawn::IHandler.
Definition at line 135 of file handler.cxx.
References getProto(), 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.
Reimplemented from dawn::CGenericHandler< CProtoCommon >.
Definition at line 164 of file handler.hxx.
| CProtoCommon * CProtoHandler::getProto | ( | SObjectId::UObjectId & | id | ) | const |
Get protocol object interface.
Retrieves a protocol instance for external use.
| [in] | id | Protocol object ID. |
Definition at line 142 of file handler.cxx.
References dawn::CGenericHandler< T >::getObjectById().
|
inlinevirtual |
Check if any protocol is running.
Reimplemented from dawn::CGenericHandler< CProtoCommon >.
Definition at line 119 of file handler.hxx.
References dawn::CGenericHandler< T >::hasThread().
| int CProtoHandler::init | ( | CDescriptor & | desc, |
| CIOHandler * | io, | ||
| IProtoFactory * | f | ||
| ) |
Initialize protocol handler and instances.
Creates protocol objects from the descriptor and binds them to I/O.
| [in] | desc | Device descriptor with protocol configurations. |
| [in] | io | I/O handler reference for protocol I/O access. |
| [in] | f | User-provided factory (nullptr = use built-in factory). |
Definition at line 73 of file handler.cxx.
References dawn::CDevInspector::getInst(), and dawn::CDevInspector::registerProtoHandler().
|
virtual |
Configure, bind, and initialize all protocol objects.
Performs the Protocol lifecycle setup sequence: configure() for each object, bind IO dependencies, then object init().
Reimplemented from dawn::CGenericHandler< CProtoCommon >.
Definition at line 100 of file handler.cxx.
References dawn::CGenericHandler< T >::configureAll(), dawn::CBindableObject::getIOMap(), dawn::CGenericHandler< CProtoCommon >::getObjectAt(), dawn::CGenericHandler< CProtoCommon >::getObjectCount(), dawn::CGenericHandler< T >::initAll(), and dawn::CBindableObject::setObjectMapItem().
|
virtual |
Validate protocol object ID.
Checks if a protocol object ID is valid and registered.
| [in] | obj | Protocol object ID. |
Implements dawn::IHandler.
Definition at line 130 of file handler.cxx.
References dawn::SObjectId::objectIsProto().
|
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 protocol objects.
Calls start() on each protocol object.
Reimplemented from dawn::CGenericHandler< CProtoCommon >.
Definition at line 95 of file handler.hxx.
References dawn::CGenericHandler< T >::startAll().
|
inlinevirtual |
Stop all protocol objects.
Calls stop() on each protocol object.
Reimplemented from dawn::CGenericHandler< CProtoCommon >.
Definition at line 108 of file handler.hxx.
References dawn::CGenericHandler< T >::stopAll().