CIRCT 22.0.0git
Loading...
Searching...
No Matches
Public Member Functions | List of all members
esi::BitsType Class Reference

Bits are just an array of bits. More...

#include <Types.h>

Inheritance diagram for esi::BitsType:
Inheritance graph
[legend]
Collaboration diagram for esi::BitsType:
Collaboration graph
[legend]

Public Member Functions

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.
 
 BitVectorType (const ID &id, uint64_t width)
 
- Public Member Functions inherited from esi::BitVectorType
 BitVectorType (const ID &id, uint64_t width)
 
uint64_t getWidth () const
 
std::ptrdiff_t getBitWidth () const override
 
- Public Member Functions inherited from esi::Type
 Type (const ID &id)
 
virtual ~Type ()=default
 
ID getID () const
 
std::optional< std::string > isValid (const std::any &obj) const
 

Additional Inherited Members

- Public Types inherited from esi::Type
using ID = std::string
 
- Protected Attributes inherited from esi::Type
ID id
 

Detailed Description

Bits are just an array of bits.

They are not interpreted as a number but are identified in the manifest as "signless" ints.

Definition at line 154 of file Types.h.

Member Function Documentation

◆ BitVectorType()

esi::BitVectorType::BitVectorType ( const ID id,
uint64_t  width 
)
inline

Definition at line 143 of file Types.h.

◆ deserialize()

std::pair< std::any, std::span< const uint8_t > > esi::BitsType::deserialize ( std::span< const uint8_t >  data) const
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.

◆ ensureValid()

void esi::BitsType::ensureValid ( const std::any &  obj) const
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 76 of file Types.cpp.

References esi::BitVectorType::getWidth().

Referenced by serialize().

◆ serialize()

MessageData esi::BitsType::serialize ( const std::any &  obj) const
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 89 of file Types.cpp.

References ensureValid().


The documentation for this class was generated from the following files: