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

Signed integer. More...

#include <Types.h>

Inheritance diagram for esi::SIntType:
Inheritance graph
[legend]
Collaboration diagram for esi::SIntType:
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.
 
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::IntegerType
 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::any deserialize (const MessageData &data) 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

Signed integer.

Definition at line 182 of file Types.h.

Member Function Documentation

◆ deserialize() [1/3]

virtual std::any esi::Type::deserialize ( BitVector data) const
inlinevirtual

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 54 of file Types.h.

◆ deserialize() [2/3]

std::any esi::SIntType::deserialize ( BitVector data) const
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 168 of file Types.cpp.

References esi::BitVectorType::getWidth().

◆ deserialize() [3/3]

std::any esi::Type::deserialize ( const MessageData data) const
inline

Definition at line 61 of file Types.h.

◆ ensureValid()

void esi::SIntType::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 150 of file Types.cpp.

References esi::getIntLikeFromAny(), and esi::BitVectorType::getWidth().

◆ serialize()

MutableBitVector esi::SIntType::serialize ( const std::any &  obj) const
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 160 of file Types.cpp.

References esi::getIntLikeFromAny(), esi::BitVectorType::getWidth(), and esi::BitVector::width().


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