PDI 0.6.1

Data exchange made easy

PDI::Context Class Referenceabstract
Inheritance diagram for PDI::Context:
PDI::Context_proxy

Classes

class  Iterator
 An iterator used to go through the descriptor store. More...
 

Public Types

typedef std::function< Datatype_template_uptr(Context &, PC_tree_t)> Datatype_template_parser
 A function that parses a PC_tree_t to create a datatype_template. More...
 

Public Member Functions

virtual ~Context ()
 
virtual Data_descriptordesc (const std::string &name)=0
 Accesses the descriptor for a specific name. More...
 
virtual Data_descriptordesc (const char *name)=0
 Accesses the descriptor for a specific name. More...
 
virtual Data_descriptoroperator[] (const std::string &name)=0
 Accesses the descriptor for a specific name. More...
 
virtual Data_descriptoroperator[] (const char *name)=0
 Accesses the descriptor for a specific name. More...
 
virtual Iterator begin ()=0
 Returns an iterator on the first descriptor. More...
 
virtual Iterator end ()=0
 Returns an iterator past the last descriptor. More...
 
virtual void event (const char *name)=0
 Triggers a PDI "event". More...
 
virtual Logger_sptr logger () const =0
 
virtual Datatype_template_uptr datatype (PC_tree_t node)=0
 Creates a new datatype template from a paraconf-style config. More...
 
virtual void add_datatype (const std::string &name, Datatype_template_parser parser)=0
 Adds new datatype parser to the context. More...
 
virtual std::function< void()> add_init_callback (const std::function< void()> &callback)=0
 Adds new init callback to context. More...
 
virtual std::function< void()> add_data_callback (const std::function< void(const std::string &, Ref)> &callback, const std::string &name={})=0
 Adds new data callback to context. More...
 
virtual std::function< void()> add_event_callback (const std::function< void(const std::string &)> &callback, const std::string &name={})=0
 Adds new event callback to context. More...
 
virtual std::function< void()> add_empty_desc_access_callback (const std::function< void(const std::string &)> &callback, const std::string &name={})=0
 Adds new empty desc access callback to context. More...
 

Protected Member Functions

Iterator get_iterator (const std::unordered_map< std::string, std::unique_ptr< Data_descriptor >>::iterator &data)
 
Iterator get_iterator (std::unordered_map< std::string, std::unique_ptr< Data_descriptor >>::iterator &&data)
 

Member Typedef Documentation

◆ Datatype_template_parser

A function that parses a PC_tree_t to create a datatype_template.

Constructor & Destructor Documentation

◆ ~Context()

virtual PDI::Context::~Context ( )
virtual

Member Function Documentation

◆ get_iterator() [1/2]

Iterator PDI::Context::get_iterator ( const std::unordered_map< std::string, std::unique_ptr< Data_descriptor >>::iterator &  data)
protected

◆ get_iterator() [2/2]

Iterator PDI::Context::get_iterator ( std::unordered_map< std::string, std::unique_ptr< Data_descriptor >>::iterator &&  data)
protected

◆ desc() [1/2]

virtual Data_descriptor& PDI::Context::desc ( const std::string &  name)
pure virtual

Accesses the descriptor for a specific name.

Might be uninitialized

Implemented in PDI::Context_proxy.

◆ desc() [2/2]

virtual Data_descriptor& PDI::Context::desc ( const char *  name)
pure virtual

Accesses the descriptor for a specific name.

Might be uninitialized

Implemented in PDI::Context_proxy.

◆ operator[]() [1/2]

virtual Data_descriptor& PDI::Context::operator[] ( const std::string &  name)
pure virtual

Accesses the descriptor for a specific name.

Might be uninitialized

Implemented in PDI::Context_proxy.

◆ operator[]() [2/2]

virtual Data_descriptor& PDI::Context::operator[] ( const char *  name)
pure virtual

Accesses the descriptor for a specific name.

Might be uninitialized

Implemented in PDI::Context_proxy.

◆ begin()

virtual Iterator PDI::Context::begin ( )
pure virtual

Returns an iterator on the first descriptor.

Implemented in PDI::Context_proxy.

◆ end()

virtual Iterator PDI::Context::end ( )
pure virtual

Returns an iterator past the last descriptor.

Implemented in PDI::Context_proxy.

◆ event()

virtual void PDI::Context::event ( const char *  name)
pure virtual

Triggers a PDI "event".

Parameters
[in]namethe event name

Implemented in PDI::Context_proxy.

◆ logger()

virtual Logger_sptr PDI::Context::logger ( ) const
pure virtual

Implemented in PDI::Context_proxy.

◆ datatype()

virtual Datatype_template_uptr PDI::Context::datatype ( PC_tree_t  node)
pure virtual

Creates a new datatype template from a paraconf-style config.

Parameters
[in]nodethe configuration to read
Returns
the type generated

Implemented in PDI::Context_proxy.

◆ add_datatype()

virtual void PDI::Context::add_datatype ( const std::string &  name,
Datatype_template_parser  parser 
)
pure virtual

Adds new datatype parser to the context.

Parameters
[in]namename of the datatype to add
[in]parserfunction that creates new datatype_template from PC_tree_t

Implemented in PDI::Context_proxy.

◆ add_init_callback()

virtual std::function<void()> PDI::Context::add_init_callback ( const std::function< void()> &  callback)
pure virtual

Adds new init callback to context.

Parameters
[in]callbackfunction to call when data and metadata are loaded
Returns
function that removes callback

Implemented in PDI::Context_proxy.

◆ add_data_callback()

virtual std::function<void()> PDI::Context::add_data_callback ( const std::function< void(const std::string &, Ref)> &  callback,
const std::string &  name = {} 
)
pure virtual

Adds new data callback to context.

Parameters
[in]callbackfunction to call when data is being available
[in]namethe name of the data on which call the callback, if not specified it's called on any data
Returns
function that removes callback

Implemented in PDI::Context_proxy.

◆ add_event_callback()

virtual std::function<void()> PDI::Context::add_event_callback ( const std::function< void(const std::string &)> &  callback,
const std::string &  name = {} 
)
pure virtual

Adds new event callback to context.

Parameters
[in]callbackfunction to call when event is called
[in]namethe name of the event on which call the callback, if not specified it's called on any event
Returns
function that removes callback

Implemented in PDI::Context_proxy.

◆ add_empty_desc_access_callback()

virtual std::function<void()> PDI::Context::add_empty_desc_access_callback ( const std::function< void(const std::string &)> &  callback,
const std::string &  name = {} 
)
pure virtual

Adds new empty desc access callback to context.

Parameters
[in]callbackfunction to call when event is called
[in]namethe name of the data on which call the callback, if not specified it's called on any data
Returns
function that removes callback

Implemented in PDI::Context_proxy.


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