LuciadCPillar 2023.1.04
luciad::DataType Class Referencefinal

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< DataPropertyfindDataProperty (const std::string &name) const
 Searches for a data property by name. More...
 
const std::vector< std::shared_ptr< DataAnnotation > > & getAnnotations () const
 
const std::vector< DataProperty > & getDataProperties () const
 
size_t getHash () const
 
const std::string & getName () const
 
bool hasDataProperty (const DataProperty &property) const
 Checks if the given property is declared in this data type. More...
 
bool isPrimitive () const
 
bool operator!= (const DataType &other) const
 
bool operator== (const DataType &other) const
 

Static Public Member Functions

static const DataTypegetBooleanType ()
 
static const DataTypegetDoubleType ()
 
static const DataTypegetFloatType ()
 
static const DataTypegetGeometryType ()
 
static const DataTypegetIntType ()
 
static const DataTypegetLongType ()
 
static const DataTypegetStringType ()
 
static Builder newBuilder ()
 Creates a new DataType builder. More...
 

Detailed Description

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.

See also
DataProperty

Member Function Documentation

◆ findDataProperty()

std::optional< DataProperty > luciad::DataType::findDataProperty ( const std::string &  name) const

Searches for a data property by name.

Parameters
namethe name of a property
Returns
the data property with the given name, if available
See also
hasDataProperty

◆ getAnnotations()

const std::vector< std::shared_ptr< DataAnnotation > > & luciad::DataType::getAnnotations ( ) const

◆ getBooleanType()

static const DataType & luciad::DataType::getBooleanType ( )
static
Returns
type that corresponds to bool values.

◆ getDataProperties()

const std::vector< DataProperty > & luciad::DataType::getDataProperties ( ) const

◆ getDoubleType()

static const DataType & luciad::DataType::getDoubleType ( )
static
Returns
type that corresponds to double values.

◆ getFloatType()

static const DataType & luciad::DataType::getFloatType ( )
static
Returns
type that corresponds to float values.

◆ getGeometryType()

static const DataType & luciad::DataType::getGeometryType ( )
static
Returns
type that corresponds to Geometry values.

◆ getHash()

size_t luciad::DataType::getHash ( ) const

◆ getIntType()

static const DataType & luciad::DataType::getIntType ( )
static
Returns
type that corresponds to int32_t values.

◆ getLongType()

static const DataType & luciad::DataType::getLongType ( )
static
Returns
type that corresponds to int64_t values.

◆ getName()

const std::string & luciad::DataType::getName ( ) const

◆ getStringType()

static const DataType & luciad::DataType::getStringType ( )
static
Returns
type that corresponds to std::string values.

◆ hasDataProperty()

bool luciad::DataType::hasDataProperty ( const DataProperty property) const

Checks if the given property is declared in this data type.

Parameters
propertyData property.
Returns
true if the data property is declared; false otherwise.
See also
findDataProperty

◆ isPrimitive()

bool luciad::DataType::isPrimitive ( ) const
Returns
whether this is a primitive type, i.e. a type without any properties.

◆ newBuilder()

static Builder luciad::DataType::newBuilder ( )
static

Creates a new DataType builder.

Returns
a new DataType builder.

◆ operator!=()

bool luciad::DataType::operator!= ( const DataType other) const

◆ operator==()

bool luciad::DataType::operator== ( const DataType other) const
Parameters
otheranother data type.
Returns
whether this type and other have the same name, properties and annotations.