PFPObject.h
A multiple-producer, multiple-consumer, thread-safe queue implemented using SystemC primitives The MT...
Definition: MTQueue.h:49
virtual bool add_counter(const std::string &counter_name, std::size_t counter_value=0)
Add a counter to the PFPObject.
Definition: PFPObject.cpp:180
PFPObserver.h.
virtual bool remove_counter(const std::string &counter_name)
Remove a counter from the PFPObject.
Definition: PFPObject.cpp:208
void notify_data_dropped(const std::shared_ptr< DATA_TYPE > data, std::string &drop_reason, double sim_time)
Notify all observers of data drop.
Definition: PFPObject.h:250
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 no...
Definition: PFPObject.cpp:224
void AddChildModule(std::string module_name, PFPObject *module)
Add a child module to the PFPObject.
Definition: PFPObject.cpp:322
virtual void data_written(const std::string &from_module, const std::shared_ptr< pfp::core::TrType > data, double simulation_time)=0
Function called by the NPU when data is written by a module.
Definition: ConfigurationParameters.h:48
std::vector< std::shared_ptr< PFPObserver > > observers_
List of observers attached to this PFPObject.
Definition: PFPObject.h:278
void notify_data_read(const std::shared_ptr< DATA_TYPE > data, double sim_time)
Notify all observers of data read.
Definition: PFPObject.h:236
Definition: PFPObject.h:102
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.
Definition: PFPObject.cpp:309
virtual void data_read(const std::string &to_module, const std::shared_ptr< pfp::core::TrType > data, double simulation_time)=0
Function called by the NPU when data is read by a module.
virtual void data_dropped(const std::string &in_module, const std::shared_ptr< pfp::core::TrType > data, const std::string &drop_reason, double simulation_time)=0
Function called by the NPU when data is dropped in a module.
static MTQueue< std::function< void(void)> > events_
Definition: PFPObject.h:268
virtual bool set_counter(const std::string &counter_name, std::size_t counter_value)
Set the value of a counter.
Definition: PFPObject.cpp:191
virtual std::size_t num_counters() const
Get the number of counters in the PFPObject.
Definition: PFPObject.cpp:318
std::map< std::string, PFPObject * > childModules_
Internal list of submodules.
Definition: PFPObject.h:280
virtual bool decrement_counter(const std::string &counter_name)
Decrement the specified counter.
Definition: PFPObject.cpp:253
void notify_data_written(const std::shared_ptr< DATA_TYPE > data, double sim_time)
Notify all observers of data written.
Definition: PFPObject.h:222
virtual void attach_observer(std::shared_ptr< PFPObserver > observer)
Attach an observer that will be notified when events occur.
Definition: PFPObject.cpp:286
std::map< std::string, std::string > configMap
Definition: PFPObject.h:274
std::map< std::string, std::size_t > counters_
Store counters and values.
Definition: PFPObject.h:276
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.
Definition: PFPObject.cpp:302
virtual bool increment_counter(const std::string &counter_name)
Increment the specified counter.
Definition: PFPObject.cpp:228
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.
Definition: PFPObject.cpp:293