CIRCT 23.0.0git
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
esi::TypeAliasType Class Reference

Type aliases provide a named type which forwards to an inner type. More...

#include <Types.h>

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

Public Member Functions

 TypeAliasType (const ID &id, std::string name, const Type *innerType)
 
const std::string & getName () const
 
const TypegetInnerType () 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
 
void dump (std::ostream &os, bool oneLine=false) const
 
std::string toString (bool oneLine=false) const
 

Private Attributes

std::string name
 
const TypeinnerType
 

Additional Inherited Members

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

Detailed Description

Type aliases provide a named type which forwards to an inner type.

Definition at line 159 of file Types.h.

Constructor & Destructor Documentation

◆ TypeAliasType()

esi::TypeAliasType::TypeAliasType ( const ID id,
std::string  name,
const Type innerType 
)
inline

Definition at line 163 of file Types.h.

References assert(), and innerType.

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

◆ deserialize() [2/3]

std::any esi::TypeAliasType::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 174 of file Types.cpp.

References esi::Type::deserialize(), and innerType.

◆ deserialize() [3/3]

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

Definition at line 63 of file Types.h.

◆ ensureValid()

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

References esi::Type::ensureValid(), and innerType.

◆ getBitWidth()

std::optional< int64_t > TypeAliasType::getBitWidth ( ) const
inlineoverridevirtual

Reimplemented from esi::Type.

Definition at line 172 of file Types.h.

References esi::Type::getBitWidth(), and innerType.

◆ getInnerType()

const Type * esi::TypeAliasType::getInnerType ( ) const
inline

Definition at line 170 of file Types.h.

References innerType.

Referenced by NB_MODULE().

◆ getName()

const std::string & esi::TypeAliasType::getName ( ) const
inline

Definition at line 169 of file Types.h.

References name.

Referenced by NB_MODULE().

◆ serialize()

MutableBitVector esi::TypeAliasType::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 170 of file Types.cpp.

References innerType, and esi::Type::serialize().

Member Data Documentation

◆ innerType

const Type* esi::TypeAliasType::innerType
private

Definition at line 182 of file Types.h.

Referenced by deserialize(), ensureValid(), getBitWidth(), getInnerType(), serialize(), and TypeAliasType().

◆ name

std::string esi::TypeAliasType::name
private

Definition at line 181 of file Types.h.

Referenced by esiaccel.types.TypeAlias::__str__(), and getName().


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