P4C
The P4 Compiler
|
Public Member Functions | |
template<typename T > | |
bool | is () const noexcept |
virtual bool | isA (TypeId typeId) const noexcept=0 |
template<typename T > | |
const T * | to () const noexcept |
Same as to , but returns const pointer to T. | |
template<typename T > | |
T * | to () noexcept |
virtual TypeId | typeId () const noexcept=0 |
Protected Member Functions | |
virtual const void * | toImpl (TypeId typeId) const noexcept=0 |
|
inlinenodiscardnoexcept |
Checks if given object is of specified dynamic type. Same as isA
, but typeid to check with is derived from template argument.
|
nodiscardpure virtualnoexcept |
Checks if given object is of specified dynamic type.
typeid | to check with |
|
inlinenodiscardnoexcept |
Casts current object to a given type T
. Overall the semantics is similar to that of dynamic_cast
, however, relies on custom RTTI metadata and intrusive annotation.
T
(e.g. if T
is not among its base classes), casted pointer to object of T* type otherwise.
|
nodiscardpure virtualnoexcept |
Queries information about dynamic type of an object.