PDI 1.7.1

the PDI data interface

PDI Namespace Reference

Classes

class  Array_datatype
 an Array_datatype is a Datatype that represents an array: i.e storage of multiple elements of the same type continuously in memory. More...
 
class  Callbacks
 
class  Config_error
 
class  Context
 
class  Context_proxy
 
class  Data_descriptor
 
class  Datatype
 A Datatype is a Datatype_template that accepts no argument. More...
 
class  Datatype_template
 
class  Error
 
class  Expression
 
class  Impl_error
 
class  Logger
 Wrapper for spdlog::logger with additional pattern getter method. More...
 
struct  Paraconf_wrapper
 Automatically installs a paraconf error-handler that ignores errors and uninstalls it on destruction. More...
 
class  Plugin
 The class PDI plugins should implement. More...
 
class  Plugin_error
 
class  Pointer_datatype
 
class  Record_datatype
 A Record_datatype is a Datatype that represents a fixed number of elements of potentially different types layed out in a specific way in memory. More...
 
class  Ref_any
 A dynamically typed reference to data with automatic memory management and read/write locking semantic. More...
 
class  Reference_base
 A common base for all references, whatever their access privileges. More...
 
class  Right_error
 
class  Scalar_datatype
 
class  State_error
 
class  System_error
 
class  Tuple_datatype
 A Tuple_datatype is a Datatype that represents a fixed number of elements of potentially different types layed out in a specific way in memory. More...
 
class  Type_error
 
class  Unavailable_error
 
class  Value_error
 

Typedefs

using Attributes_map = std::unordered_map< std::string, Expression >
 
using Datatype_template_ptr = std::shared_ptr< const Datatype_template >
 
using Datatype_sptr = std::shared_ptr< const Datatype >
 
typedef Ref_any< false, false > Ref
 
typedef Ref_any< true, false > Ref_r
 
typedef Ref_any< false, true > Ref_w
 
typedef Ref_any< true, true > Ref_rw
 

Enumerations

enum class  Scalar_kind : uint8_t {
  UNKNOWN ,
  SIGNED ,
  UNSIGNED ,
  FLOAT
}
 Different possible interpretations for a scalar. More...
 

Functions

int len (PC_tree_t tree)
 Returns the length of a node.
 
int len (PC_tree_t tree, int dflt)
 Returns the length of a node.
 
long to_long (PC_tree_t tree)
 Returns the int value of a scalar node.
 
long to_long (PC_tree_t tree, long dflt)
 Returns the int value of a scalar node.
 
double to_double (PC_tree_t tree)
 Returns the floating point value of a scalar node.
 
double to_double (PC_tree_t tree, double dflt)
 Returns the floating point value of a scalar node.
 
std::string to_string (PC_tree_t tree)
 Returns the string content of a scalar node.
 
std::string to_string (PC_tree_t tree, const std::string &dflt)
 Returns the string content of a scalar node.
 
bool to_bool (PC_tree_t tree)
 Returns the boolean value of a scalar node.
 
bool to_bool (PC_tree_t tree, bool dflt)
 Returns the boolean value of a scalar node.
 
bool is_list (PC_tree_t tree)
 Checks if the tree is a list.
 
bool is_map (PC_tree_t tree)
 Checks if the tree is a map.
 
bool is_scalar (PC_tree_t tree)
 Checks if the tree is a scalar.
 
void each (PC_tree_t tree, std::function< void(PC_tree_t)> operation)
 Iterates and apply the provided function to all elements of a PC list.
 
void opt_each (PC_tree_t tree, std::function< void(PC_tree_t)> operation)
 Iterates and apply the provided function to all elements of a PC list or directly to the provided element if it is not a list.
 
void each (PC_tree_t tree, std::function< void(PC_tree_t, PC_tree_t)> operation)
 Iterates and apply the provided function to all elements of a PC mapping.
 
void each_in_omap (PC_tree_t tree, std::function< void(PC_tree_t, PC_tree_t)> operation)
 Iterates and apply the provided function to all elements of a PC ordered mapping.
 
unsigned long plugin_api_version (unsigned long expected_version=0)
 Checks compatibility with a plugin API.
 

Variables

const auto UNDEF_TYPE = Scalar_datatype::make(Scalar_kind::UNKNOWN, 0)
 

Typedef Documentation

◆ Attributes_map

using PDI::Attributes_map = typedef std::unordered_map<std::string, Expression>

◆ Datatype_template_ptr

using PDI::Datatype_template_ptr = typedef std::shared_ptr<const Datatype_template>

◆ Datatype_sptr

using PDI::Datatype_sptr = typedef std::shared_ptr<const Datatype>

◆ Ref

typedef Ref_any<false, false> PDI::Ref

◆ Ref_r

typedef Ref_any<true, false> PDI::Ref_r

◆ Ref_w

typedef Ref_any<false, true> PDI::Ref_w

◆ Ref_rw

typedef Ref_any<true, true> PDI::Ref_rw

Enumeration Type Documentation

◆ Scalar_kind

enum class PDI::Scalar_kind : uint8_t
strong

Different possible interpretations for a scalar.

Enumerator
UNKNOWN 
SIGNED 
UNSIGNED 
FLOAT 

Function Documentation

◆ len() [1/2]

int PDI::len ( PC_tree_t  tree)

Returns the length of a node.

  • for a sequence: the number of nodes,
  • for a mapping: the number of pairs,
  • for a scalar: the string length.

throws an Error if the provided tree is in error

Parameters
[in]treethe sequence or mapping
Returns
the length

◆ len() [2/2]

int PDI::len ( PC_tree_t  tree,
int  dflt 
)

Returns the length of a node.

  • for a sequence: the number of nodes,
  • for a mapping: the number of pairs,
  • for a scalar: the string length.

returns the default value in case of error

Parameters
[in]treethe sequence or mapping
[in]dfltthe default value in case of error
Returns
the length

◆ to_long() [1/2]

long PDI::to_long ( PC_tree_t  tree)

Returns the int value of a scalar node.

throws an Error if the provided tree is in error

Parameters
[in]treethe int-valued node
Returns
the int value of the scalar node

◆ to_long() [2/2]

long PDI::to_long ( PC_tree_t  tree,
long  dflt 
)

Returns the int value of a scalar node.

returns the default value in case of error

Parameters
[in]treethe int-valued node
[in]dfltthe default value in case of error
Returns
the int value of the scalar node

◆ to_double() [1/2]

double PDI::to_double ( PC_tree_t  tree)

Returns the floating point value of a scalar node.

throws an Error if the provided tree is in error

Parameters
[in]treethe floating-point-valued node
Returns
the floating point value of the scalar node

◆ to_double() [2/2]

double PDI::to_double ( PC_tree_t  tree,
double  dflt 
)

Returns the floating point value of a scalar node.

returns the default value in case of error

Parameters
[in]treethe floating-point-valued node
[in]dfltthe default value in case of error
Returns
the floating point value of the scalar node

◆ to_string() [1/2]

std::string PDI::to_string ( PC_tree_t  tree)

Returns the string content of a scalar node.

throws an Error if the provided tree is in error

Parameters
[in]treethe node
Returns
the content of the scalar node

◆ to_string() [2/2]

std::string PDI::to_string ( PC_tree_t  tree,
const std::string &  dflt 
)

Returns the string content of a scalar node.

returns the default value in case of error

Parameters
[in]treethe node
[in]dfltthe default value in case of error
Returns
the content of the scalar node

◆ to_bool() [1/2]

bool PDI::to_bool ( PC_tree_t  tree)

Returns the boolean value of a scalar node.

throws an Error if the provided tree is in error

Parameters
[in]treethe node
Returns
the boolean value of the scalar node

◆ to_bool() [2/2]

bool PDI::to_bool ( PC_tree_t  tree,
bool  dflt 
)

Returns the boolean value of a scalar node.

returns the default value in case of error

Parameters
[in]treethe node
[in]dfltthe default value in case of error
Returns
the boolean value of the scalar node

◆ is_list()

bool PDI::is_list ( PC_tree_t  tree)

Checks if the tree is a list.

Parameters
[in]treethe node
Returns
true if tree is a list, false otherwise

◆ is_map()

bool PDI::is_map ( PC_tree_t  tree)

Checks if the tree is a map.

Parameters
[in]treethe node
Returns
true if tree is a map, false otherwise

◆ is_scalar()

bool PDI::is_scalar ( PC_tree_t  tree)

Checks if the tree is a scalar.

Parameters
[in]treethe node
Returns
true if tree is a scalar, false otherwise

◆ each() [1/2]

void PDI::each ( PC_tree_t  tree,
std::function< void(PC_tree_t)>  operation 
)

Iterates and apply the provided function to all elements of a PC list.

Parameters
treethe tree containing the list
operationthe operation to apply to each element of the tree

◆ opt_each()

void PDI::opt_each ( PC_tree_t  tree,
std::function< void(PC_tree_t)>  operation 
)

Iterates and apply the provided function to all elements of a PC list or directly to the provided element if it is not a list.

Parameters
treethe tree containing the list or the single element
operationthe operation to apply to the elements

◆ each() [2/2]

void PDI::each ( PC_tree_t  tree,
std::function< void(PC_tree_t, PC_tree_t)>  operation 
)

Iterates and apply the provided function to all elements of a PC mapping.

Parameters
treethe tree containing the mapping
operationthe operation to apply to each element of the tree

◆ each_in_omap()

void PDI::each_in_omap ( PC_tree_t  tree,
std::function< void(PC_tree_t, PC_tree_t)>  operation 
)

Iterates and apply the provided function to all elements of a PC ordered mapping.

Parameters
treethe tree containing the ordered mapping
operationthe operation to apply to each element of the tree

◆ plugin_api_version()

unsigned long PDI::plugin_api_version ( unsigned long  expected_version = 0)

Checks compatibility with a plugin API.

Parameters
expected_versionthe expected version of the API or 0 for no check
Returns
the version of the API provided by PDI
Exceptions
PDI::Errorif the provided version is incompatible with the expected one

Variable Documentation

◆ UNDEF_TYPE

const auto PDI::UNDEF_TYPE = Scalar_datatype::make(Scalar_kind::UNKNOWN, 0)