+ Collaboration diagram for pfp::core::PFPObject:

Public Member Functions

 PFPObject (const std::string &module_name, PFPObject *parent=0, bool enable_dicp=false)
 
 PFPObject (const std::string &module_name, std::string BaseConfigFile, std::string InstanceConfigFile="", PFPObject *parent=0, bool enable_dicp=false)
 
 PFPObject (const PFPObject &other, bool enable_dicp=false)
 
void LoadBaseConfiguration (std::string)
 
void LoadInstanceConfiguration (std::string)
 
pfp::core::ConfigurationParameterNode GetParameter (std::string param)
 
pfp::core::ConfigurationParameterNode GetParameterfromParent (std::string param, PFPObject *parent)
 
std::vector< std::string > ModuleHierarchy ()
 
const std::string & module_name () const
 
PFPObjectGetParent ()
 
virtual bool add_counter (const std::string &counter_name, std::size_t counter_value=0)
 Add a counter to the PFPObject. More...
 
virtual bool set_counter (const std::string &counter_name, std::size_t counter_value)
 Set the value of a counter. More...
 
virtual bool remove_counter (const std::string &counter_name)
 Remove a counter from the PFPObject. More...
 
virtual std::size_t counter_value (const std::string &counter_name) const
 Get the value of a counter Note: This will throw a std::out_of_range exception if the counter does not exist in the PFPObject. More...
 
virtual bool increment_counter (const std::string &counter_name)
 Increment the specified counter. More...
 
virtual bool increment_counter (const std::string &counter_name, const int incr_amount)
 
virtual bool decrement_counter (const std::string &counter_name)
 Decrement the specified counter. More...
 
virtual bool decrement_counter (const std::string &counter_name, const int decr_amount)
 
virtual void attach_observer (std::shared_ptr< PFPObserver > observer)
 Attach an observer that will be notified when events occur. More...
 
virtual void notify_counter_changed (const std::string &counter_name, std::size_t counter_value, double sim_time)
 Notify all attached observers when a counter is changed. More...
 
virtual void notify_counter_added (const std::string &counter_name, double sim_time)
 Notify all attached observers when a counter is added to the PFPObject. More...
 
virtual void notify_counter_removed (const std::string &counter_name, double sim_time)
 Notify all attached observers when a counter is removed from the PFPObject. More...
 
virtual std::size_t num_counters () const
 Get the number of counters in the PFPObject. More...
 
void AddChildModule (std::string module_name, PFPObject *module)
 Add a child module to the PFPObject. More...
 
template<typename DATA_TYPE >
void notify_data_written (const std::shared_ptr< DATA_TYPE > data, double sim_time)
 Notify all observers of data written. More...
 
template<typename DATA_TYPE >
void notify_data_read (const std::shared_ptr< DATA_TYPE > data, double sim_time)
 Notify all observers of data read. More...
 
template<typename DATA_TYPE >
void notify_data_dropped (const std::shared_ptr< DATA_TYPE > data, std::string &drop_reason, double sim_time)
 Notify all observers of data drop. More...
 
template<typename DATA_TYPE >
void drop_data (const std::shared_ptr< DATA_TYPE > data, std::string drop_reason)
 

Public Attributes

const bool dicp_enabled
 
pfp::core::ConfigurationParameterNode SimulationParameters
 

Static Public Attributes

static MTQueue< std::function
< void(void)> > 
events_
 

Protected Attributes

const std::string GlobalConfigPath
 
const std::string module_name_
 
PFPObjectparent_
 
std::map< std::string,
std::string > 
configMap
 
std::map< std::string,
std::size_t > 
counters_
 Store counters and values.
 
std::vector< std::shared_ptr
< PFPObserver > > 
observers_
 List of observers attached to this PFPObject.
 
std::map< std::string,
PFPObject * > 
childModules_
 Internal list of submodules.
 

Member Function Documentation

bool pfp::core::PFPObject::add_counter ( const std::string &  counter_name,
std::size_t  counter_value = 0 
)
virtual

Add a counter to the PFPObject.

Parameters
counter_nameName of the counter
counter_valueValue of the counter (default: 0)
Returns
True if the counter was added; false if the counter already exists

+ Here is the call graph for this function:

void pfp::core::PFPObject::AddChildModule ( std::string  module_name,
PFPObject module 
)

Add a child module to the PFPObject.

Parameters
module_namename of module
modulepointer to the module
void pfp::core::PFPObject::attach_observer ( std::shared_ptr< PFPObserver observer)
virtual

Attach an observer that will be notified when events occur.

Parameters
observerObserver to attach
std::size_t pfp::core::PFPObject::counter_value ( const std::string &  counter_name) const
virtual

Get the value of a counter Note: This will throw a std::out_of_range exception if the counter does not exist in the PFPObject.

Parameters
counter_nameName of the counter
Returns
Value of the counter

+ Here is the caller graph for this function:

bool pfp::core::PFPObject::decrement_counter ( const std::string &  counter_name)
virtual

Decrement the specified counter.

Parameters
counter_nameName of the counter
Returns
True if the counter was decremented

+ Here is the call graph for this function:

bool pfp::core::PFPObject::increment_counter ( const std::string &  counter_name)
virtual

Increment the specified counter.

Parameters
counter_nameName of the counter
Returns
True if the counter was incremented

+ Here is the call graph for this function:

void pfp::core::PFPObject::notify_counter_added ( const std::string &  counter_name,
double  sim_time 
)
virtual

Notify all attached observers when a counter is added to the PFPObject.

Parameters
counter_nameName of the counter
sim_timeSimulation time at which the counter was added (this will usually be 0)

+ Here is the caller graph for this function:

void pfp::core::PFPObject::notify_counter_changed ( const std::string &  counter_name,
std::size_t  counter_value,
double  sim_time 
)
virtual

Notify all attached observers when a counter is changed.

Parameters
counter_nameName of the counter
counter_valueNew value of the counter
sim_timeSimulation time at which the event occurred

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void pfp::core::PFPObject::notify_counter_removed ( const std::string &  counter_name,
double  sim_time 
)
virtual

Notify all attached observers when a counter is removed from the PFPObject.

Parameters
counter_nameName of the counter
sim_timeSimulation time at which the counter was removed (this will usually be 0)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename DATA_TYPE >
void pfp::core::PFPObject::notify_data_dropped ( const std::shared_ptr< DATA_TYPE >  data,
std::string &  drop_reason,
double  sim_time 
)
inline

Notify all observers of data drop.

Parameters
dataData that was dropped
sim_timeSimulation time of the event

+ Here is the call graph for this function:

template<typename DATA_TYPE >
void pfp::core::PFPObject::notify_data_read ( const std::shared_ptr< DATA_TYPE >  data,
double  sim_time 
)
inline

Notify all observers of data read.

Parameters
dataData that was read
sim_timeSimulation time of the event

+ Here is the call graph for this function:

template<typename DATA_TYPE >
void pfp::core::PFPObject::notify_data_written ( const std::shared_ptr< DATA_TYPE >  data,
double  sim_time 
)
inline

Notify all observers of data written.

Parameters
dataData that was written
sim_timeSimulation time of the event

+ Here is the call graph for this function:

std::size_t pfp::core::PFPObject::num_counters ( ) const
virtual

Get the number of counters in the PFPObject.

Returns
Number of counters

+ Here is the caller graph for this function:

bool pfp::core::PFPObject::remove_counter ( const std::string &  counter_name)
virtual

Remove a counter from the PFPObject.

Parameters
counter_nameName of the counter
Returns
True if the counter was removed; false if the PFPObject does not contain the counter

+ Here is the call graph for this function:

bool pfp::core::PFPObject::set_counter ( const std::string &  counter_name,
std::size_t  counter_value 
)
virtual

Set the value of a counter.

Parameters
counter_nameName of the counter
counter_valueValue of the counter
Returns
True if the value was changed; false if the PFPObject does not contain the counter

+ Here is the call graph for this function:

Member Data Documentation

std::map<std::string, std::string> pfp::core::PFPObject::configMap
protected

Configuration Map used >

MTQueue< std::function< void(void)> > pfp::core::PFPObject::events_
static

Global event queue

PFPObject* pfp::core::PFPObject::parent_
protected

Parent of this PFPObject


The documentation for this class was generated from the following files:
  • /home/lemniscate/workspace/PFPSim/pfpsim/core/PFPObject.h
  • /home/lemniscate/workspace/PFPSim/pfpsim/core/PFPObject.cpp