PDI 1.4.3

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

Public Member Functions

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

Static Public Member Functions

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

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

◆ clone()

virtual Datatype_template_uptr PDI::Datatype_template::clone ( ) const
pure virtual

Creates a new datatype as an exact copy of this one.

Returns
the dense type that is produced

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

◆ evaluate()

virtual Datatype_uptr 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::Record_datatype, PDI::Scalar_datatype, and PDI::Pointer_datatype.

◆ attribute()

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

Returns attribute of given name as Expression.

Parameters
attribute_keyattribute 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: