10#include "dawn/io/common.hxx"
11#include "dawn/porting/config.hxx"
39 IO_FILE_CFG_FIRST = 0,
50 , writeOnceLocked(false)
56#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
57 const char *getClassNameStr()
const override
65 int getDataImpl(IODataCmn &data,
size_t len)
override;
67 int getDataAtImpl(IODataCmn &data,
size_t len,
size_t offset)
override;
70#ifdef CONFIG_DAWN_IO_NOTIFY
71 int getFd()
const override;
76 bool isRead()
const override;
122 char path[PATH_MAX] = {};
126 bool writeOnceLocked;
128 int configureDesc(
const CDescObject &desc);
Descriptor wrapper for individual object configuration.
Template helper for creating ObjectIDs for I/O types without timestamp support.
static SObjectId::ObjectId create(uint16_t inst)
Create ObjectID with fixed data type and no timestamp.
Base class for all I/O objects.
virtual int getFd() const
Get file descriptor for notifications.
@ IO_CLASS_FILE
File system I/O.
bool isSeekable() const
Check if IO supports partial (seekable) access.
bool isBatch() const
Check if IO supports batch operations.
int setDataImpl(IODataCmn &data)
Set data implementation (override in derived classes).
@ IO_FILE_PERM_RW
Read-write.
@ IO_FILE_PERM_WRITE
Write-only.
@ IO_FILE_PERM_WRITE_ONCE
Write-once.
@ IO_FILE_PERM_READ
Read-only.
bool isNotify() const
Check if IO supports notifications.
int getDataImpl(IODataCmn &data, size_t len)
Get data implementation (override in derived classes).
size_t getDataDim() const
Get data vector dimension.
int getDataAtImpl(IODataCmn &data, size_t len, size_t offset)
Get data at byte offset (override in seekable IOs).
int deinit()
De-initialize object.
@ IO_FILE_CFG_PATH
File path (null-terminated string, DTYPE_CHAR).
@ IO_FILE_CFG_PERM
Permission mode (EIOFilePerm, DTYPE_UINT8).
size_t getDataSize() const
Get data size in bytes.
bool isWrite() const
Check if IO supports write operations.
bool isRead() const
Check if IO supports read operations.
int setDataAtImpl(IODataCmn &data, size_t offset)
Set data at byte offset (override in seekable IOs).
int configure()
Configure object from descriptor data.
static ObjectCfgId objectCfg(uint8_t type, uint16_t cls, uint8_t dtype, bool rw, uint16_t size, uint8_t id)
Construct 32-bit ConfigID from component fields.
uint32_t ObjectCfgId
ConfigID type - single 32-bit value.
Out-of-tree user-extension hooks for Dawn.
@ OBJTYPE_IO
Input/Output object type.
@ DTYPE_UINT8
Unsigned 8-bit integer (0 to 255).
@ DTYPE_CHAR
Character/string type (null-terminated, 4-byte aligned).
uint32_t ObjectId
ObjectID type - single 32-bit value.