PDI 1.7.1

the PDI data interface

PDI::Datatype_template Class Referenceabstract
Inheritance diagram for PDI::Datatype_template:
PDI::Datatype PDI::Array_datatype PDI::Pointer_datatype PDI::Record_datatype PDI::Scalar_datatype PDI::Tuple_datatype

Public Member Functions

 Datatype_template (const Attributes_map &attributes={})
 Creates datatype template with given attributes.
 
 Datatype_template (PC_tree_t datatype_tree)
 Creates datatype template.
 
virtual ~Datatype_template ()
 Destroys the template.
 
virtual Datatype_sptr evaluate (Context &ctx) const =0
 Creates a new datatype by resolving the value of all metadata references.
 
Expression attribute (const std::string &attribute_name) const
 Returns attribute of given name as Expression.
 
const Attributes_mapattributes () const
 Returns all attributes as a unordered map.
 

Static Public Member Functions

static void load_basic_datatypes (Context &ctx)
 Adds to the context the basic Array, Record, C and Fortran datatypes.
 
static void load_user_datatypes (Context &ctx, PC_tree_t types_tree)
 Adds to the context the user defined datatypes.
 

Protected Attributes

Attributes_map m_attributes
 

Constructor & Destructor Documentation

◆ Datatype_template() [1/2]

PDI::Datatype_template::Datatype_template ( const Attributes_map attributes = {})

Creates datatype template with given attributes.

Parameters
attributesattributes of datatype template

◆ Datatype_template() [2/2]

PDI::Datatype_template::Datatype_template ( PC_tree_t  datatype_tree)

Creates datatype template.

If attributes are defined in datatype_tree, they will be included in datatype template

Parameters
datatype_treedatatype tree

◆ ~Datatype_template()

virtual PDI::Datatype_template::~Datatype_template ( )
virtual

Destroys the template.

Member Function Documentation

◆ evaluate()

virtual Datatype_sptr PDI::Datatype_template::evaluate ( Context ctx) const
pure virtual

Creates a new datatype by resolving the value of all metadata references.

Parameters
ctxthe context in which to evaluate this template
Returns
the evaluated type that is produced

Implemented in PDI::Array_datatype, PDI::Pointer_datatype, PDI::Record_datatype, PDI::Scalar_datatype, and PDI::Tuple_datatype.

◆ attribute()

Expression PDI::Datatype_template::attribute ( const std::string &  attribute_name) const

Returns attribute of given name as Expression.

Parameters
attribute_nameattribute to get
Returns
value of attribute as Expression

◆ attributes()

const Attributes_map & PDI::Datatype_template::attributes ( ) const

Returns all attributes as a unordered map.

Returns
all attributes as a unordered map

◆ load_basic_datatypes()

static void PDI::Datatype_template::load_basic_datatypes ( Context ctx)
static

Adds to the context the basic Array, Record, C and Fortran datatypes.

Parameters
[in,out]ctxthe context where to add the datatypes

◆ load_user_datatypes()

static void PDI::Datatype_template::load_user_datatypes ( Context ctx,
PC_tree_t  types_tree 
)
static

Adds to the context the user defined datatypes.

Parameters
[in,out]ctxthe context where to add the datatypes
[in]types_treewith defined types

Member Data Documentation

◆ m_attributes

Attributes_map PDI::Datatype_template::m_attributes
protected

The documentation for this class was generated from the following file: