Dawn Framework 1.0
Universal data acquisition framework for embedded systems
Public Types | Public Member Functions | Static Public Member Functions | List of all members
dawn::CDevInspector Class Reference

Global registry for object inspection. More...

#include <inspector.hxx>

Public Types

enum  EHandlerType { HANDLER_TYPE_IO = 0 , HANDLER_TYPE_PROG = 1 , HANDLER_TYPE_PROTO = 2 , HANDLER_TYPE_MAX = 3 }
 Handler types that can be registered. More...
 

Public Member Functions

const CObjectfindObject (uint32_t objid) const
 Find object by ID.
 
const CIOCommongetIO (size_t index) const
 Get IO object by index.
 
size_t getIOCount () const
 Get number of IO objects.
 
const CObjectgetProg (size_t index) const
 Get PROG object by index.
 
size_t getProgCount () const
 Get number of PROG objects.
 
size_t getProgIOBindings (size_t prog_index, const CIOCommon **io_list, size_t max_size) const
 Get IO bindings for PROG object.
 
const CObjectgetProto (size_t index) const
 Get PROTO object by index.
 
size_t getProtoBindings (size_t proto_index, const CObject **obj_list, size_t max_size) const
 Get object bindings for PROTO object.
 
size_t getProtoCount () const
 Get number of PROTO objects.
 
void registerIOHandler (const CIOHandler *handler)
 Register IO handler.
 
void registerProgHandler (const CProgHandler *handler)
 Register PROG handler.
 
void registerProtoHandler (const CProtoHandler *handler)
 Register PROTO handler.
 

Static Public Member Functions

static void destroy ()
 Destroy singleton.
 
static CDevInspectorgetInst ()
 Get singleton instance.
 

Detailed Description

Global registry for object inspection.

Provides read-only access to handlers for debugging and introspection. Only compiled when CONFIG_DAWN_INSPECT is enabled. Uses singleton pattern to avoid breaking handler independence while enabling cross-handler inspection.

This class follows the same architectural pattern as CDevDescriptor, providing a graceful way to overcome architecture limits without introducing direct coupling between handlers.

Definition at line 37 of file inspector.hxx.

Member Enumeration Documentation

◆ EHandlerType

Handler types that can be registered.

Enumerator
HANDLER_TYPE_IO 

I/O handler.

HANDLER_TYPE_PROG 

Program handler.

HANDLER_TYPE_PROTO 

Protocol handler.

HANDLER_TYPE_MAX 

Maximum handler count.

Definition at line 42 of file inspector.hxx.

Member Function Documentation

◆ destroy()

static void dawn::CDevInspector::destroy ( )
inlinestatic

Destroy singleton.

Deletes the singleton instance and sets pointer to nullptr. Call this during framework shutdown.

Definition at line 76 of file inspector.hxx.

◆ findObject()

const CObject * CDevInspector::findObject ( uint32_t  objid) const

Find object by ID.

Searches all handlers for object with given ID.

Parameters
objidObject ID to find.
Returns
Const pointer to object, nullptr if not found.

Definition at line 126 of file inspector.cxx.

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

Here is the call graph for this function:

◆ getInst()

static CDevInspector * dawn::CDevInspector::getInst ( )
inlinestatic

Get singleton instance.

Creates the singleton on first call, returns existing instance on subsequent calls.

Returns
Pointer to singleton instance.

Definition at line 59 of file inspector.hxx.

Here is the caller graph for this function:

◆ getIO()

const CIOCommon * CDevInspector::getIO ( size_t  index) const

Get IO object by index.

Parameters
indexObject index (0 to getIOCount()-1).
Returns
Const pointer to IO object, nullptr if index out of range.

Definition at line 75 of file inspector.cxx.

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

Here is the call graph for this function:

◆ getIOCount()

size_t CDevInspector::getIOCount ( ) const

Get number of IO objects.

Returns
Count of IO objects, 0 if handler not registered.

Definition at line 45 of file inspector.cxx.

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

Here is the call graph for this function:

◆ getProg()

const CObject * CDevInspector::getProg ( size_t  index) const

Get PROG object by index.

Parameters
indexObject index (0 to getProgCount()-1).
Returns
Const pointer to PROG object, nullptr if index out of range.

Definition at line 92 of file inspector.cxx.

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

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

◆ getProgCount()

size_t CDevInspector::getProgCount ( ) const

Get number of PROG objects.

Returns
Count of PROG objects, 0 if handler not registered.

Definition at line 55 of file inspector.cxx.

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

Here is the call graph for this function:

◆ getProgIOBindings()

size_t CDevInspector::getProgIOBindings ( size_t  prog_index,
const CIOCommon **  io_list,
size_t  max_size 
) const

Get IO bindings for PROG object.

Returns list of IO objects bound to specified PROG.

Parameters
prog_indexPROG object index.
[out]io_listArray to fill with IO pointers.
max_sizeMaximum entries in io_list.
Returns
Number of bindings returned, 0 if none or invalid index.

Definition at line 169 of file inspector.cxx.

References dawn::CBindableObject::getIOMap(), and getProg().

Here is the call graph for this function:

◆ getProto()

const CObject * CDevInspector::getProto ( size_t  index) const

Get PROTO object by index.

Parameters
indexObject index (0 to getProtoCount()-1).
Returns
Const pointer to PROTO object, nullptr if index out of range.

Definition at line 109 of file inspector.cxx.

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

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

◆ getProtoBindings()

size_t CDevInspector::getProtoBindings ( size_t  proto_index,
const CObject **  obj_list,
size_t  max_size 
) const

Get object bindings for PROTO object.

Returns list of objects (IO or PROG) bound to specified PROTO.

Parameters
proto_indexPROTO object index.
[out]obj_listArray to fill with object pointers.
max_sizeMaximum entries in obj_list.
Returns
Number of bindings returned, 0 if none or invalid index.

Definition at line 207 of file inspector.cxx.

References dawn::CBindableObject::getIOMap(), and getProto().

Here is the call graph for this function:

◆ getProtoCount()

size_t CDevInspector::getProtoCount ( ) const

Get number of PROTO objects.

Returns
Count of PROTO objects, 0 if handler not registered.

Definition at line 65 of file inspector.cxx.

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

Here is the call graph for this function:

◆ registerIOHandler()

void CDevInspector::registerIOHandler ( const CIOHandler handler)

Register IO handler.

Called by CIOHandler during initialization to register itself for inspection. Ownership is NOT transferred - handler lifetime is managed independently.

Parameters
handlerPointer to IO handler (must remain valid).

Definition at line 30 of file inspector.cxx.

Here is the caller graph for this function:

◆ registerProgHandler()

void CDevInspector::registerProgHandler ( const CProgHandler handler)

Register PROG handler.

Called by CProgHandler during initialization to register itself for inspection. Ownership is NOT transferred - handler lifetime is managed independently.

Parameters
handlerPointer to PROG handler (must remain valid).

Definition at line 35 of file inspector.cxx.

Here is the caller graph for this function:

◆ registerProtoHandler()

void CDevInspector::registerProtoHandler ( const CProtoHandler handler)

Register PROTO handler.

Called by CProtoHandler during initialization to register itself for inspection. Ownership is NOT transferred - handler lifetime is managed independently.

Parameters
handlerPointer to PROTO handler (must remain valid).

Definition at line 40 of file inspector.cxx.

Here is the caller graph for this function:

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