LuciadCPillar 2023.1.04
luciad::IDataAnnotationFactory Class Referenceabstract

Factory that can create a DataAnnotation based on a complete DataType. More...

#include <luciad/datamodels/DataType.h>

Public Member Functions

virtual ~IDataAnnotationFactory ()=default
 
virtual std::shared_ptr< DataAnnotationcreateAnnotation (const DataType &dataType) const =0
 Create an annotation based on dataType. More...
 

Static Public Member Functions

static std::shared_ptr< IDataAnnotationFactorycreate (std::function< std::shared_ptr< DataAnnotation >(const DataType &)> function)
 Creates a default IDataAnnotationFactory instance that delegates IDataAnnotationFactory::createAnnotation to the given function. More...
 

Detailed Description

Factory that can create a DataAnnotation based on a complete DataType.

When the annotation needs to capture information about a data type, this allows creation of the annotation to be postponed until the data type is being built.

Constructor & Destructor Documentation

◆ ~IDataAnnotationFactory()

virtual luciad::IDataAnnotationFactory::~IDataAnnotationFactory ( )
virtualdefault

Member Function Documentation

◆ create()

static std::shared_ptr< IDataAnnotationFactory > luciad::IDataAnnotationFactory::create ( std::function< std::shared_ptr< DataAnnotation >(const DataType &)>  function)
static

Creates a default IDataAnnotationFactory instance that delegates IDataAnnotationFactory::createAnnotation to the given function.

This is a convenience function that allows to reduce boiler plate code using a lambda.

Parameters
functionthe function that is called by IDataAnnotationFactory::createAnnotation.
Returns
an IDataAnnotationFactory instance based on the given function.

◆ createAnnotation()

virtual std::shared_ptr< DataAnnotation > luciad::IDataAnnotationFactory::createAnnotation ( const DataType dataType) const
pure virtual

Create an annotation based on dataType.

Parameters
dataTypethe data type to annotate.
Returns
the annotation.