CIRCT 22.0.0git
|
Channels are the basic communication primitives. More...
#include <Types.h>
Public Member Functions | |
ChannelType (const ID &id, const Type *inner) | |
const Type * | getInner () const |
std::ptrdiff_t | getBitWidth () const override |
void | ensureValid (const std::any &obj) const override |
Ensure that a std::any object is valid for this type. | |
MessageData | serialize (const std::any &obj) const override |
Serialize an object to MessageData. | |
std::pair< std::any, std::span< const uint8_t > > | deserialize (std::span< const uint8_t > data) const override |
Deserialize from a span of bytes to an object. | |
![]() | |
Type (const ID &id) | |
virtual | ~Type ()=default |
ID | getID () const |
std::optional< std::string > | isValid (const std::any &obj) const |
Private Attributes | |
const Type * | inner |
Additional Inherited Members | |
![]() | |
using | ID = std::string |
![]() | |
ID | id |
Channels are the basic communication primitives.
They are unidirectional and carry one values of one type.
|
overridevirtual |
Deserialize from a span of bytes to an object.
Returns the deserialized object as a std::any and a span to the remaining bytes.
Reimplemented from esi::Type.
Definition at line 41 of file Types.cpp.
References esi::Type::deserialize(), and inner.
|
overridevirtual |
Ensure that a std::any object is valid for this type.
Throws std::runtime_error if the object is not valid.
Reimplemented from esi::Type.
Definition at line 32 of file Types.cpp.
References esi::Type::ensureValid(), and inner.
|
inlineoverridevirtual |
Reimplemented from esi::Type.
Definition at line 106 of file Types.h.
References esi::Type::getBitWidth(), and inner.
|
inline |
|
overridevirtual |
Serialize an object to MessageData.
The object should be passed as a std::any to provide type erasure. Returns a MessageData containing the serialized representation.
Reimplemented from esi::Type.
Definition at line 36 of file Types.cpp.
References inner, and esi::Type::serialize().
|
private |
Definition at line 114 of file Types.h.
Referenced by deserialize(), ensureValid(), getBitWidth(), getInner(), and serialize().