Dawn Framework 1.0
Universal data acquisition framework for embedded systems
descselector.hxx
1// dawn/include/dawn/io/descselector.hxx
2//
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#pragma once
7
8#include "dawn/common/descriptor.hxx"
9#include "dawn/dev/descriptor.hxx"
10#include "dawn/dev/descswitch.hxx"
11#include "dawn/io/common.hxx"
12#include "dawn/porting/config.hxx"
13
14namespace dawn
15{
19{
20public:
21 explicit CIODescSelector(CDescObject &desc)
22 : CIOCommon(desc)
23 {
24 }
25
26 ~CIODescSelector() override;
27
28#ifdef CONFIG_DAWN_OBJECT_HAS_NAME
29 const char *getClassNameStr() const override
30 {
31 return "descselector";
32 }
33#endif
34
35 int configure() override;
36 int deinit() override;
37 int getDataImpl(IODataCmn &data, size_t len) override;
38 int setDataImpl(IODataCmn &data) override;
39
40 size_t getDataSize() const override
41 {
42 return sizeof(uint32_t);
43 }
44
45 size_t getDataDim() const override
46 {
47 return 1;
48 }
49
50 bool isRead() const override
51 {
52 return true;
53 }
54
55 bool isWrite() const override
56 {
57 return true;
58 }
59
60 bool isNotify() const override
61 {
62 return false;
63 }
64
65 bool isBatch() const override
66 {
67 return false;
68 }
69
70 using ObjectIdHelper =
72
73 constexpr static SObjectId::ObjectId objectId(uint16_t inst)
74 {
75 return ObjectIdHelper::create(inst);
76 }
77
78private:
79 int configureDesc(const CDescObject &desc);
80};
81
82} // Namespace dawn
Descriptor wrapper for individual object configuration.
Template helper for creating ObjectIDs for I/O types without timestamp support.
Definition common.hxx:303
static SObjectId::ObjectId create(uint16_t inst)
Create ObjectID with fixed data type and no timestamp.
Definition common.hxx:312
Base class for all I/O objects.
Definition common.hxx:27
Runtime descriptor slot selector I/O.
int setDataImpl(IODataCmn &data)
Set data implementation (override in derived classes).
bool isBatch() const
Check if IO supports batch operations.
size_t getDataDim() const
Get data vector dimension.
bool isRead() const
Check if IO supports read operations.
int deinit()
De-initialize object.
bool isWrite() const
Check if IO supports write operations.
bool isNotify() const
Check if IO supports notifications.
int configure()
Configure object from descriptor data.
int getDataImpl(IODataCmn &data, size_t len)
Get data implementation (override in derived classes).
size_t getDataSize() const
Get data size in bytes.
Out-of-tree user-extension hooks for Dawn.
Definition bindable.hxx:13
Base interface for I/O data buffers (static and dynamic).
Definition idata.hxx:21
uint32_t ObjectId
ObjectID type - single 32-bit value.
Definition objectid.hxx:44