Pothos
0.5.0-ga4964040
The Pothos dataflow programming software suite
|
#include <DType.hpp>
Public Member Functions | |
DType (void) | |
Create an unknown DType of size 1. More... | |
DType (const char *markup) | |
DType (const std::string &markup) | |
DType (const std::string &alias, const size_t dimension) | |
DType (const std::type_info &type, const size_t dimension=1) | |
const std::string & | name (void) const |
size_t | elemType (void) const |
Get the element type descriptor. More... | |
size_t | elemSize (void) const |
Get the size of a single element in bytes. More... | |
size_t | dimension (void) const |
Get the dimensionality of this type. More... | |
size_t | size (void) const |
Get the size of this DType in bytes. More... | |
std::string | toString (void) const |
Create a printable string representation. More... | |
std::string | toMarkup (void) const |
operator bool (void) const | |
bool | isCustom (void) const |
bool | isFloat (void) const |
bool | isInteger (void) const |
bool | isSigned (void) const |
bool | isComplex (void) const |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialization support. More... | |
Static Public Member Functions | |
static DType | fromDType (const DType &dtype, const size_t dimension) |
DType provides meta-information about a data type. A DType consists of a primitive element type and dimensionality. The dimensionality is a simple number that allows a DType to represent an integer number of primitive element per object.
DType will recognize the alias names for the most common types like: primitive integers, fixed width types, floating point types, complex...
Recognized name strings:
Special name strings:
|
inline |
Create an unknown DType of size 1.
Pothos::DType::DType | ( | const char * | markup | ) |
Pothos::DType::DType | ( | const std::string & | markup | ) |
Pothos::DType::DType | ( | const std::string & | alias, |
const size_t | dimension | ||
) |
Create a DType from a type alias and dimensionality.
DTypeUnknownError | when the name is not known |
alias | a string identfier for a known data type |
dimension | the number of elements per type |
Pothos::DType::DType | ( | const std::type_info & | type, |
const size_t | dimension = 1 |
||
) |
Create a DType from a type_info identifier and optional dimensionality. The size and type enum are inferred from the type info.
DTypeUnknownError | when the type is not known |
type | a recognized type info object |
dimension | the number of elements per type |
|
inline |
Get the dimensionality of this type.
|
inline |
Get the size of a single element in bytes.
|
inline |
Get the element type descriptor.
bool Pothos::DType::isComplex | ( | void | ) | const |
Does this dtype represent a complex data type?
bool Pothos::DType::isCustom | ( | void | ) | const |
Does this dtype represent a custom type?
bool Pothos::DType::isFloat | ( | void | ) | const |
Does this dtype represent a floating point data type?
bool Pothos::DType::isInteger | ( | void | ) | const |
Does this dtype represent an integer data type?
bool Pothos::DType::isSigned | ( | void | ) | const |
Does this dtype represent a signed data type?
const std::string& Pothos::DType::name | ( | void | ) | const |
Get a name that describes an element. Example: int32, uint16, complex_float32, etc...
|
inlineexplicit |
Does this dtype specify a non-empty type?
void Pothos::DType::serialize | ( | Archive & | ar, |
const unsigned int | version | ||
) |
Serialization support.
|
inline |
Get the size of this DType in bytes.
std::string Pothos::DType::toMarkup | ( | void | ) | const |
Create a markup string which can be parsed by the constructor.
std::string Pothos::DType::toString | ( | void | ) | const |
Create a printable string representation.