PDI 1.0.1

Data exchange made easy

PDI::Callbacks Class Reference

Public Member Functions

 Callbacks (Context &ctx)
 
std::function< void()> add_init_callback (const std::function< void()> &callback)
 Adds new init callback to context. More...
 
std::function< void()> add_data_callback (const std::function< void(const std::string &, Ref)> &callback, const std::string &name={})
 Adds new data callback to context. More...
 
std::function< void()> add_data_remove_callback (const std::function< void(const std::string &, Ref)> &callback, const std::string &name={})
 Adds new data callback to context. More...
 
std::function< void()> add_event_callback (const std::function< void(const std::string &)> &callback, const std::string &name={})
 Adds new event callback to context. More...
 
std::function< void()> add_empty_desc_access_callback (const std::function< void(const std::string &)> &callback, const std::string &name={})
 Adds new empty desc access callback to context. More...
 
void call_init_callbacks () const
 Calls init callbacks. More...
 
void call_data_callbacks (const std::string &name, Ref ref) const
 Calls data callbacks. More...
 
void call_data_remove_callbacks (const std::string &name, Ref ref) const
 Calls data remove callbacks. More...
 
void call_event_callbacks (const std::string &name) const
 Calls event callbacks. More...
 
void call_empty_desc_access_callbacks (const std::string &name) const
 Calls empty desc callbacks. More...
 

Constructor & Destructor Documentation

◆ Callbacks()

PDI::Callbacks::Callbacks ( Context ctx)

Member Function Documentation

◆ add_init_callback()

std::function<void()> PDI::Callbacks::add_init_callback ( const std::function< void()> &  callback)

Adds new init callback to context.

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

◆ add_data_callback()

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

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

◆ add_data_remove_callback()

std::function<void()> PDI::Callbacks::add_data_remove_callback ( const std::function< void(const std::string &, Ref)> &  callback,
const std::string &  name = {} 
)

Adds new data callback to context.

Parameters
[in]callbackfunction to call when data is reclaimed/released
[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

◆ add_event_callback()

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

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

◆ add_empty_desc_access_callback()

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

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

◆ call_init_callbacks()

void PDI::Callbacks::call_init_callbacks ( ) const

Calls init callbacks.

◆ call_data_callbacks()

void PDI::Callbacks::call_data_callbacks ( const std::string &  name,
Ref  ref 
) const

Calls data callbacks.

Parameters
namename of the shared descriptor
refshared reference

◆ call_data_remove_callbacks()

void PDI::Callbacks::call_data_remove_callbacks ( const std::string &  name,
Ref  ref 
) const

Calls data remove callbacks.

Parameters
namename of the descriptor that will be reclaimed/released
refreference that will be reclaimed/released

◆ call_event_callbacks()

void PDI::Callbacks::call_event_callbacks ( const std::string &  name) const

Calls event callbacks.

Parameters
namename of the event

◆ call_empty_desc_access_callbacks()

void PDI::Callbacks::call_empty_desc_access_callbacks ( const std::string &  name) const

Calls empty desc callbacks.

Parameters
namename of the accessed descriptor

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