![]() |
LuciadCPillar 2024.1.04
|
A representation of the type of a data object. More...
#include <luciad/datamodels/DataType.h>
Classes | |
class | Builder |
Builder that allows DataType instances to be created. More... | |
Public Member Functions | |
std::optional< DataProperty > | findDataProperty (const std::string &name) const |
Searches for a data property by name. More... | |
const std::vector< std::shared_ptr< DataAnnotation > > & | getAnnotations () const |
Returns the list of annotations attached to this data type. More... | |
const std::vector< DataProperty > & | getDataProperties () const |
Returns the list of properties of this data type. More... | |
size_t | getHash () const |
Returns the hash code. More... | |
const std::string & | getName () const |
Returns the name of this data type. More... | |
bool | hasDataProperty (const DataProperty &property) const |
Returns if the given property is declared in this data type. More... | |
bool | isPrimitive () const |
Returns whether this is a primitive type, i.e. More... | |
bool | operator!= (const DataType &other) const |
bool | operator== (const DataType &other) const |
Static Public Member Functions | |
static const DataType & | getBooleanType () |
Returns the type that corresponds to bool values. More... | |
static const DataType & | getDoubleType () |
Returns the type that corresponds to double values. More... | |
static const DataType & | getFloatType () |
Returns the type that corresponds to float values. More... | |
static const DataType & | getGeometryType () |
Returns the type that corresponds to Geometry values. More... | |
static const DataType & | getIntType () |
Returns the type that corresponds to int32_t values. More... | |
static const DataType & | getLongType () |
Returns the type that corresponds to int64_t values. More... | |
static const DataType & | getStringType () |
Returns the type that corresponds to std::string values. More... | |
static Builder | newBuilder () |
Creates a new DataType builder. More... | |
A representation of the type of a data object.
A type describes the structure of a data object as a list of properties. Each of these properties is itself of a certain type.
A type is either a primitive type or a data object type. Primitive types are types which have no internal structure (no properties) and typically represent simple object such as strings, numbers etc. All primitive types are accessible from this class (see e.g. getIntType(), getStringType() ...).
Application-specific metadata can be attached to a type in the form of a DataAnnotation.
New types can be defined using a DataType::Builder (see newBuilder()).
Instances of this class are thread safe. Once an instance has been created, there is no public API to modify it.
std::optional< DataProperty > luciad::DataType::findDataProperty | ( | const std::string & | name | ) | const |
Searches for a data property by name.
name | the name of a property |
const std::vector< std::shared_ptr< DataAnnotation > > & luciad::DataType::getAnnotations | ( | ) | const |
Returns the list of annotations attached to this data type.
|
static |
Returns the type that corresponds to bool
values.
bool
values. const std::vector< DataProperty > & luciad::DataType::getDataProperties | ( | ) | const |
Returns the list of properties of this data type.
|
static |
Returns the type that corresponds to double
values.
double
values.
|
static |
Returns the type that corresponds to float
values.
float
values.
|
static |
size_t luciad::DataType::getHash | ( | ) | const |
Returns the hash code.
|
static |
Returns the type that corresponds to int32_t
values.
int32_t
values.
|
static |
Returns the type that corresponds to int64_t
values.
int64_t
values. const std::string & luciad::DataType::getName | ( | ) | const |
Returns the name of this data type.
|
static |
Returns the type that corresponds to std::string
values.
std::string
values. bool luciad::DataType::hasDataProperty | ( | const DataProperty & | property | ) | const |
Returns if the given property is declared in this data type.
property | Data property. |
bool luciad::DataType::isPrimitive | ( | ) | const |
Returns whether this is a primitive type, i.e.
a type without any properties.
|
static |
bool luciad::DataType::operator!= | ( | const DataType & | other | ) | const |
bool luciad::DataType::operator== | ( | const DataType & | other | ) | const |
other | another data type. |