|
CIRCT 22.0.0git
|
Arrays have a compile time specified (static) size and an element type. More...
#include <Types.h>


Public Member Functions | |
| ArrayType (const ID &id, const Type *elementType, uint64_t size, bool reverse=true) | |
| const Type * | getElementType () const |
| uint64_t | getSize () const |
| bool | isReverse () 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. | |
| MutableBitVector | serialize (const std::any &obj) const override |
| Serialize an object to a MutableBitVector (LSB-first stream). | |
| std::any | deserialize (BitVector &data) const override |
| Deserialize from a BitVector stream (LSB-first). | |
| virtual std::any | deserialize (BitVector &data) const |
| Deserialize from a BitVector stream (LSB-first). | |
| std::any | deserialize (const MessageData &data) const |
Public Member Functions inherited from esi::Type | |
| Type (const ID &id) | |
| virtual | ~Type ()=default |
| ID | getID () const |
| std::any | deserialize (const MessageData &data) const |
| std::optional< std::string > | isValid (const std::any &obj) const |
Private Attributes | |
| const Type * | elementType |
| uint64_t | size |
| bool | reverse |
Additional Inherited Members | |
Public Types inherited from esi::Type | |
| using | ID = std::string |
Protected Attributes inherited from esi::Type | |
| ID | id |
Arrays have a compile time specified (static) size and an element type.
|
inlinevirtual |
|
overridevirtual |
Deserialize from a BitVector stream (LSB-first).
Implementations consume bits from 'data' in-place (via logical right shifts) and return the reconstructed value. Remaining bits stay in 'data'.
Reimplemented from esi::Type.
Definition at line 308 of file Types.cpp.
References esi::Type::deserialize(), elementType, isReverse(), and size.
|
inline |
|
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 267 of file Types.cpp.
References elementType, esi::Type::ensureValid(), and size.
Referenced by serialize().
|
inlineoverridevirtual |
Reimplemented from esi::Type.
Definition at line 251 of file Types.h.
References elementType, esi::Type::getBitWidth(), and size.
|
inline |
Definition at line 248 of file Types.h.
References elementType.
|
inline |
|
inline |
Definition at line 250 of file Types.h.
References reverse.
Referenced by deserialize(), and serialize().
|
overridevirtual |
Serialize an object to a MutableBitVector (LSB-first stream).
The object should be passed via std::any. Implementations append fields in the order they are iterated (the first serialized field occupies the least-significant bits of the result).
Reimplemented from esi::Type.
Definition at line 289 of file Types.cpp.
References elementType, ensureValid(), isReverse(), esi::Type::serialize(), and esi::BitVector::width().
|
private |
Definition at line 263 of file Types.h.
Referenced by deserialize(), ensureValid(), getBitWidth(), getElementType(), and serialize().
|
private |
Definition at line 268 of file Types.h.
Referenced by isReverse().
|
private |
Definition at line 264 of file Types.h.
Referenced by esiaccel.types.ArrayType::bit_width(), deserialize(), esiaccel.types.ArrayType::deserialize(), ensureValid(), getBitWidth(), getSize(), and esiaccel.types.ArrayType::is_valid().