6#include "dawn/dev/inspector.hxx"
8#ifdef CONFIG_DAWN_INSPECT
10# include "dawn/common/object.hxx"
11# include "dawn/io/common.hxx"
12# include "dawn/io/handler.hxx"
13# include "dawn/prog/common.hxx"
14# include "dawn/prog/handler.hxx"
15# include "dawn/proto/common.hxx"
16# include "dawn/proto/handler.hxx"
37 prog_handler = handler;
42 proto_handler = handler;
47 if (io_handler ==
nullptr)
57 if (prog_handler ==
nullptr)
67 if (proto_handler ==
nullptr)
77 if (io_handler ==
nullptr)
82 const auto &objects = io_handler->
getObjects();
84 if (index >= objects.size())
89 return objects[index];
94 if (prog_handler ==
nullptr)
99 const auto &objects = prog_handler->
getObjects();
101 if (index >= objects.size())
106 return objects[index];
111 if (proto_handler ==
nullptr)
116 const auto &objects = proto_handler->
getObjects();
118 if (index >= objects.size())
123 return objects[index];
135 if (io_handler !=
nullptr)
146 if (prog_handler !=
nullptr)
157 if (proto_handler !=
nullptr)
171 size_t max_size)
const
175 const std::map<SObjectId::ObjectId, CIOCommon *> *io_map;
184 prog_common =
static_cast<const CProgCommon *
>(prog);
193 for (
const auto &pair : *io_map)
195 if (count >= max_size)
200 io_list[count] = pair.second;
209 size_t max_size)
const
213 const std::map<SObjectId::ObjectId, CIOCommon *> *obj_map;
217 if (proto ==
nullptr)
222 proto_common =
static_cast<const CProtoCommon *
>(proto);
223 obj_map = &proto_common->
getIOMap();
225 if (obj_map->empty())
231 for (
const auto &pair : *obj_map)
233 if (count >= max_size)
238 obj_list[count] = pair.second;
const std::map< SObjectId::ObjectId, CIOCommon * > & getIOMap() const
Get the I/O map for this object.
Global registry for object inspection.
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.
size_t getProgCount() const
Get number of PROG objects.
void registerProgHandler(const CProgHandler *handler)
Register PROG handler.
const CObject * getProg(size_t index) const
Get PROG object by index.
const CObject * findObject(uint32_t objid) const
Find object by ID.
const CIOCommon * getIO(size_t index) const
Get IO object by index.
void registerIOHandler(const CIOHandler *handler)
Register IO handler.
size_t getProgIOBindings(size_t prog_index, const CIOCommon **io_list, size_t max_size) const
Get IO bindings for PROG object.
void registerProtoHandler(const CProtoHandler *handler)
Register PROTO handler.
size_t getIOCount() const
Get number of IO objects.
const CObject * getProto(size_t index) const
Get PROTO object by index.
const std::vector< T * > & getObjects() const
Get read-only access to all objects.
T * getObjectById(const SObjectId::UObjectId &id) const
Get object by ObjectID.
Base class for all I/O objects.
Manages I/O object lifecycle and dispatch.
Base class for all Dawn objects (IOs, Programs, Protocols).
Base class for all PROG (processing) objects.
Manages Programs object lifecycle and dispatch.
Base class for all protocol implementations.
Manages PROTO object lifecycle and dispatch.
Out-of-tree user-extension hooks for Dawn.
32-bit encoded object identifier (union with bit field).
ObjectId v
Raw 32-bit ObjectID value (for comparison, hashing, storage).