6#include "dawn/proto/handler.hxx"
8#include "dawn/debug.hxx"
9#include "dawn/io/common.hxx"
10#include "dawn/io/handler.hxx"
12#ifdef CONFIG_DAWN_INSPECT
13# include "dawn/dev/inspector.hxx"
30 DAWNERR(
"Failed to create PROTO object 0x%" PRIx32
"\n", desc.
getObjectIdV());
31 h.allocError = -ENOMEM;
35 DAWNINFO(
"created PROTO: 0x%" PRIx32
" %p\n", desc.
getObjectIdV(), tmp);
49 if (userFactory !=
nullptr)
51 ret = userFactory->
create(desc);
58 return factory.
create(desc);
65 return ioHandler->
getIO(uid);
90#ifdef CONFIG_DAWN_INSPECT
113 if (proto ==
nullptr)
119 for (
auto const &[
id, io] : proto->
getIOMap())
void setObjectMapItem(SObjectId::ObjectId id, CObject *obj)
Set an item in the object map.
const std::map< SObjectId::ObjectId, CIOCommon * > & getIOMap() const
Get the I/O map for this object.
Descriptor wrapper for individual object configuration.
SObjectId::ObjectId getObjectIdV() const
Get object identifier as raw 32-bit value.
SObjectId::UObjectId & getObjectId() const
Get object identifier as union structure.
Binary device descriptor manager.
Global registry for object inspection.
static CDevInspector * getInst()
Get singleton instance.
void registerProtoHandler(const CProtoHandler *handler)
Register PROTO handler.
int initAll()
Run one-time init() for all configured objects.
size_t getObjectCount() const
Get total number of registered objects.
int registerObject(T *obj)
Register object.
T * getObjectById(const SObjectId::UObjectId &id) const
Get object by ObjectID.
int configureAll()
Configure all objects managed by this handler.
int objalloc(CDescriptor &desc, CDescriptor::allocobj_func_t func)
Allocate objects from descriptor.
CProtoCommon * getObjectAt(size_t index) const
Get object at index.
Base implementation of IHandler interface.
Base class for all I/O objects.
Manages I/O object lifecycle and dispatch.
CIOCommon * getIO(SObjectId::UObjectId &id) const
Get I/O object by ObjectID as CIOCommon*.
Base class for all Dawn objects (IOs, Programs, Protocols).
Base class for all protocol implementations.
CProtoCommon * create(CDescObject &desc)
Create a protocol object from descriptor.
Manages PROTO object lifecycle and dispatch.
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.
CProtoCommon * getProto(SObjectId::UObjectId &id) const
Get protocol object interface.
CObject * getObject(const SObjectId::ObjectId id)
Get protocol object by ID.
Abstract factory interface for protocol creation.
virtual CProtoCommon * create(CDescObject &desc)=0
Create a protocol object.
Out-of-tree user-extension hooks for Dawn.
static bool objectIsProto(const UObjectId &objid)
Check if object is Protocol type (raw 32-bit version).
uint32_t ObjectId
ObjectID type - single 32-bit value.
32-bit encoded object identifier (union with bit field).
ObjectId v
Raw 32-bit ObjectID value (for comparison, hashing, storage).