Dawn Framework 1.0
Universal data acquisition framework for embedded systems
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dawn::CSystemHandler Class Reference

Handler for SYSTEM objects (OBJTYPE_ANY, cls != 0). More...

#include <handler.hxx>

Inheritance diagram for dawn::CSystemHandler:
[legend]
Collaboration diagram for dawn::CSystemHandler:
[legend]

Public Member Functions

int configureAll ()
 Configure all objects managed by this handler.
 
int deinitAll ()
 De-initialize all objects managed by this handler.
 
CObjectgetObject (const SObjectId::ObjectId id)
 Get object from this handler by ID.
 
CSystemCommongetObjectAt (size_t index) const
 Get object at index.
 
CSystemCommongetObjectById (const SObjectId::UObjectId &id) const
 Get object by ObjectID.
 
size_t getObjectCount () const
 Get total number of registered objects.
 
const std::vector< CSystemCommon * > & getObjects () const
 Get read-only access to all objects.
 
bool hasThread () const
 Check if any thread is currently running.
 
int initAll ()
 Run one-time init() for all configured objects.
 
bool isObjectValid (SObjectId::UObjectId &obj) const
 Validate if object ID is valid for this handler.
 
int objalloc (CDescriptor &desc, CDescriptor::allocobj_func_t func)
 Allocate objects from descriptor.
 
int startAll ()
 Start all objects managed by this handler.
 
int stopAll ()
 Stop all objects managed by this handler.
 

Protected Member Functions

const char * getObjectTypeName () const
 Get object type name for logging.
 
virtual void onInitObject (CSystemCommon *obj)
 Hook for subclass-specific post-object-init handling.
 
virtual void onStartObject (CSystemCommon *obj)
 Hook for subclass-specific pre-start operations.
 
int registerObject (CSystemCommon *obj)
 Register object.
 

Protected Attributes

std::vector< CSystemCommon * > objects
 Vector of registered objects.
 

Detailed Description

Handler for SYSTEM objects (OBJTYPE_ANY, cls != 0).

Definition at line 16 of file handler.hxx.

Member Function Documentation

◆ configureAll()

int dawn::CGenericHandler< CSystemCommon >::configureAll ( )
inlineinherited

Configure all objects managed by this handler.

Returns
OK on success, negative error code on failure.

Definition at line 114 of file generic_handler.hxx.

◆ deinitAll()

int dawn::CSystemHandler::deinitAll ( )
inlinevirtual

De-initialize all objects managed by this handler.

Returns OK without cleanup when lifecycle teardown is disabled.

Returns
OK on success, negative error code on failure.

Reimplemented from dawn::CGenericHandler< CSystemCommon >.

Definition at line 37 of file handler.hxx.

References dawn::CGenericHandler< T >::deinitAll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getObject()

CObject * dawn::CSystemHandler::getObject ( const SObjectId::ObjectId  id)
inlinevirtual

Get object from this handler by ID.

Retrieves a specific object by its ID.

Parameters
idObject ID.
Returns
Pointer to CObject if found, nullptr if not found.

Implements dawn::IHandler.

Definition at line 62 of file handler.hxx.

References dawn::CGenericHandler< T >::getObjectById(), and dawn::SObjectId::UObjectId::v.

Here is the call graph for this function:

◆ getObjectAt()

CSystemCommon * dawn::CGenericHandler< CSystemCommon >::getObjectAt ( size_t  index) const
inlineinherited

Get object at index.

Parameters
indexZero-based index.
Returns
Pointer to object, nullptr if out of bounds.

Definition at line 311 of file generic_handler.hxx.

◆ getObjectById()

CSystemCommon * dawn::CGenericHandler< CSystemCommon >::getObjectById ( const SObjectId::UObjectId id) const
inlineinherited

Get object by ObjectID.

Parameters
idObjectID to retrieve.
Returns
Pointer to object, nullptr if not found.

Definition at line 323 of file generic_handler.hxx.

◆ getObjects()

const std::vector< CSystemCommon * > & dawn::CGenericHandler< CSystemCommon >::getObjects ( ) const
inlineinherited

Get read-only access to all objects.

Returns
Const reference to object vector.

Definition at line 298 of file generic_handler.hxx.

◆ hasThread()

bool dawn::CSystemHandler::hasThread ( ) const
inlinevirtual

Check if any thread is currently running.

Returns
True if at least one object is running.

Reimplemented from dawn::CGenericHandler< CSystemCommon >.

Definition at line 52 of file handler.hxx.

References dawn::CGenericHandler< T >::hasThread().

Here is the call graph for this function:

◆ initAll()

int dawn::CSystemHandler::initAll ( )
inlinevirtual

Run one-time init() for all configured objects.

Returns
OK on success, negative error code on failure.

Reimplemented from dawn::CGenericHandler< CSystemCommon >.

Definition at line 26 of file handler.hxx.

References dawn::CGenericHandler< T >::configureAll(), and dawn::CGenericHandler< T >::initAll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isObjectValid()

bool dawn::CSystemHandler::isObjectValid ( SObjectId::UObjectId obj) const
inlinevirtual

Validate if object ID is valid for this handler.

Checks whether a given object ID represents a valid object managed by this handler.

Parameters
objObject ID to validate.
Returns
True if object ID is valid for this handler, false otherwise.

Implements dawn::IHandler.

Definition at line 57 of file handler.hxx.

References dawn::SObjectId::objectIsSystem().

Here is the call graph for this function:

◆ objalloc()

int dawn::CGenericHandler< CSystemCommon >::objalloc ( CDescriptor desc,
CDescriptor::allocobj_func_t  func 
)
inlineinherited

Allocate objects from descriptor.

Generic descriptor allocation using callback pattern.

Parameters
descDevice descriptor containing object definitions.
funcStatic callback: void func(CHandler& handler, CDescObject&).

Definition at line 339 of file generic_handler.hxx.

◆ onInitObject()

virtual void dawn::CGenericHandler< CSystemCommon >::onInitObject ( CSystemCommon obj)
inlineprotectedvirtualinherited

Hook for subclass-specific post-object-init handling.

Parameters
objPointer to object that was just initialized.

Definition at line 60 of file generic_handler.hxx.

◆ onStartObject()

virtual void dawn::CGenericHandler< CSystemCommon >::onStartObject ( CSystemCommon obj)
inlineprotectedvirtualinherited

Hook for subclass-specific pre-start operations.

Parameters
objPointer to object about to start.

Definition at line 70 of file generic_handler.hxx.

◆ registerObject()

int dawn::CGenericHandler< CSystemCommon >::registerObject ( CSystemCommon obj)
inlineprotectedinherited

Register object.

Parameters
objPointer to object to register.

Definition at line 37 of file generic_handler.hxx.

◆ startAll()

int dawn::CSystemHandler::startAll ( )
inlinevirtual

Start all objects managed by this handler.

Returns
OK on success, negative error code on failure.

Reimplemented from dawn::CGenericHandler< CSystemCommon >.

Definition at line 42 of file handler.hxx.

References dawn::CGenericHandler< T >::startAll().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopAll()

int dawn::CSystemHandler::stopAll ( )
inlinevirtual

Stop all objects managed by this handler.

Returns OK without stopping objects when lifecycle teardown is disabled.

Returns
OK on success, negative error code on failure.

Reimplemented from dawn::CGenericHandler< CSystemCommon >.

Definition at line 47 of file handler.hxx.

References dawn::CGenericHandler< T >::stopAll().

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: