LuciadCPillar 2026.1.02
Loading...
Searching...
No Matches
luciad::DataProperty::Builder Class Referencefinal

Builder that allows DataProperty instances to be created. More...

#include <luciad/datamodels/DataProperty.h>

Public Member Functions

 Builder (Builder &&other) noexcept
 Move constructor.
 Builder (const Builder &other)
 Copy constructor.
 ~Builder ()
Builder & addAnnotation (std::shared_ptr< DataAnnotation > annotation)
 Adds an annotation to the data property under construction.
DataProperty build ()
 Build the data type, including the value type that was set on this builder.
Builder & collectionKind (DataCollectionKind type)
 Sets the collection type of the data property under construction.
Builder & name (std::string name)
 Sets the name of the data property.
Builder & operator= (Builder other) noexcept
Builder & valueType (DataType type)
 Sets the data type for the data property under construction.

Detailed Description

Builder that allows DataProperty instances to be created.

Typical usage would be to create a DataProperty::Builder using DataProperty::newBuilder, specifying the name of the data property. Then, specify the value type and finally build() the data property. The following snippet shows how this is done for a simple example data property:

return DataProperty::newBuilder().name("geometry").valueType(DataType::getGeometryType()).build();

Constructor & Destructor Documentation

◆ Builder() [1/2]

luciad::DataProperty::Builder::Builder ( const Builder & other)

Copy constructor.

Parameters
otherthe builder to copy.

◆ Builder() [2/2]

luciad::DataProperty::Builder::Builder ( Builder && other)
noexcept

Move constructor.

Parameters
otherthe builder to move from.

◆ ~Builder()

luciad::DataProperty::Builder::~Builder ( )

Member Function Documentation

◆ addAnnotation()

Builder & luciad::DataProperty::Builder::addAnnotation ( std::shared_ptr< DataAnnotation > annotation)

Adds an annotation to the data property under construction.

Parameters
annotationthe annotation to add.
Returns
this builder.
Exceptions
luciad::NullArgumentExceptionwhen a nullptr value is passed.
Since
2026.1

◆ build()

DataProperty luciad::DataProperty::Builder::build ( )

Build the data type, including the value type that was set on this builder.

After calling this function, you should no longer use this builder.

Returns
the data type.
Exceptions
luciad::LogicExceptionIf not all mandatory parameters are set.

◆ collectionKind()

Builder & luciad::DataProperty::Builder::collectionKind ( DataCollectionKind type)

Sets the collection type of the data property under construction.

Calling this function is optional. The default is DataCollectionKind::Scalar.

Parameters
typethe collection type for the data property under construction.
Returns
this builder.
Since
2026.1

◆ name()

Builder & luciad::DataProperty::Builder::name ( std::string name)

Sets the name of the data property.

Calling this function is mandatory.

Parameters
namename of the data property.
Returns
this builder.

◆ operator=()

Builder & luciad::DataProperty::Builder::operator= ( Builder other)
noexcept

◆ valueType()

Builder & luciad::DataProperty::Builder::valueType ( DataType type)

Sets the data type for the data property under construction.

For a list-typed property (see collectionKind(DataCollectionKind)), this is the type of the elements in the list.

Calling this function is mandatory.

Parameters
typethe data type for the data property under construction.
Returns
this builder.