PandA-2024.02
Public Types | Public Member Functions | Private Attributes | Static Private Attributes
action_o Class Reference

This class describes a generic systemC action. More...

#include <structural_objects.hpp>

Inheritance diagram for action_o:
Inheritance graph
[legend]
Collaboration diagram for action_o:
Collaboration graph
[legend]

Public Types

enum  process_type {
  THREAD = 0, CTHREAD, METHOD, SERVICE,
  UNKNOWN
}
 Define the possible types of a process. More...
 

Public Member Functions

 action_o (int debug_level, const structural_objectRef o)
 Constructor. More...
 
 ~action_o () override=default
 destructor More...
 
void add_parameter (structural_objectRef d)
 Add a procedure paramenter. More...
 
const structural_objectRef get_parameter (unsigned int n) const
 Return the ith input parameter. More...
 
unsigned int get_parameters_size () const
 Return the number of the parameters. More...
 
void set_fun_id (unsigned int id)
 Function that set the function with the action. More...
 
unsigned int get_fun_id () const
 Return the function id. More...
 
void set_action_type (process_type at)
 Set the type of the action. More...
 
process_type get_action_type () const
 Return the type of the action. More...
 
void add_event_to_sensitivity (structural_objectRef e)
 Add an event to the sensitivity list of the action. More...
 
unsigned int get_sensitivity_size () const
 Return tha size of the sensitivity list. More...
 
const structural_objectRef get_sensitivity (unsigned int n) const
 Return a specific event of the sensitivity list. More...
 
void set_scope (const std::string &sc)
 Set the scope of the action. More...
 
const std::string & get_scope () const
 Return the scope of the action. More...
 
bool get_process_nservice () const
 Return the type of the action: process (true) or services (false). More...
 
void copy (structural_objectRef dest) const override
 Perform a copy of the action. More...
 
structural_objectRef find_member (const std::string &id, so_kind type, const structural_objectRef owner) const override
 Return the object named id of a given type which belongs to or it is associated with the object. More...
 
structural_objectRef find_isomorphic (const structural_objectRef key) const override
 Find key in this object. More...
 
void xload (const xml_element *Enode, structural_objectRef owner, structural_managerRef const &CM) override
 Load a structural_object starting from an xml file. More...
 
void xwrite (xml_element *rootnode) override
 Add a structural_object to an xml tree. More...
 
void print (std::ostream &os) const override
 Print the action (for debug purpose) More...
 
- Public Member Functions inherited from structural_object
 structural_object (int debug_level, const structural_objectRef o)
 Constructor for the structural_object. More...
 
virtual ~structural_object ()=default
 virtual destructor More...
 
const structural_objectRef get_owner () const
 Return the owner. More...
 
void set_owner (const structural_objectRef new_owner)
 set the owner of the structural object More...
 
void set_treenode (unsigned int n)
 Set the treenode id associated with the structural_object. More...
 
unsigned int get_treenode () const
 Return the treenode id associated with the structural_object. More...
 
void set_id (const std::string &s)
 Set the identifier associated with the structural_object. More...
 
const std::string & get_id () const
 Return the identifier associated with the structural_object. More...
 
void set_type (const structural_type_descriptorRef &s)
 Set the type of the structural_object. More...
 
const structural_type_descriptorRefget_typeRef () const
 Return the type descriptor of the structural_object. More...
 
void type_resize (unsigned long long new_bit_size)
 Just resize the size of the bits of the object. More...
 
void type_resize (unsigned long long new_bit_size, unsigned long long new_vec_size)
 resizing of vector objects More...
 
void set_black_box (bool bb)
 Set the black box property associated with the structural_object. More...
 
bool get_black_box () const
 Return the black box property. More...
 
void SetParameter (const std::string &name, const std::string &value)
 Set a parameter value. More...
 
bool ExistsParameter (std::string name) const
 Check if a parameter has been specified. More...
 
std::string GetParameter (std::string name) const
 Get the value associated to parameter if it has been associated; if it has not specified returns the default. More...
 
std::string GetDefaultParameter (std::string name) const
 Get the value associated to parameter if it has been associate; It throws an exception if it has not been associated. More...
 
CustomMap< std::string, std::string > GetParameters () const
 return the whole set of parameters More...
 
virtual void AddParameter (const std::string &name, const std::string &default_value)
 Add a parameter. More...
 
const std::string get_path () const
 Return a unique identifier of the structural object. More...
 
virtual std::string get_kind_text () const =0
 Virtual function used to get the string name of a structural_object instance. More...
 
virtual enum so_kind get_kind () const =0
 Virtual function used to find the real type of a structural_object instance. More...
 

Private Attributes

std::vector< structural_objectRefparameters
 The method procedure parameter. More...
 
unsigned int function_id
 The index of the function which represents the behavior. More...
 
process_type action_type
 The type of the action. More...
 
std::vector< structural_objectRefaction_sensitivity
 Sensitivity list. More...
 
std::string scope
 Used to identify the scope of the action (public, private or protected) More...
 

Static Private Attributes

static const char * process_typeNames [] = {"THREAD", "CTHREAD", "METHOD", "SERVICE", "UNKNOWN"}
 Redefinition of get_kind_text() More...
 

Additional Inherited Members

- Protected Member Functions inherited from structural_object
std::string convert_so_short (so_kind in) const
 Convert a so_kind in a short string. More...
 
- Protected Attributes inherited from structural_object
friend structural_manager
 
int debug_level
 debug level for the object More...
 
- Static Protected Attributes inherited from structural_object
static simple_indent PP
 pretty print functor object used by all print members to indent the output of the print function. More...
 

Detailed Description

This class describes a generic systemC action.

An action can be a SystemC process or a standard service (aka a member function of a class).

Definition at line 1295 of file structural_objects.hpp.

Member Enumeration Documentation

◆ process_type

Define the possible types of a process.

Enumerator
THREAD 
CTHREAD 
METHOD 
SERVICE 
UNKNOWN 

Definition at line 1301 of file structural_objects.hpp.

Constructor & Destructor Documentation

◆ action_o()

action_o::action_o ( int  debug_level,
const structural_objectRef  o 
)

Constructor.

Parameters
ois the owner of the action.

Definition at line 1989 of file structural_objects.cpp.

◆ ~action_o()

action_o::~action_o ( )
overridedefault

destructor

Member Function Documentation

◆ add_event_to_sensitivity()

void action_o::add_event_to_sensitivity ( structural_objectRef  e)

Add an event to the sensitivity list of the action.

Parameters
eis an event.

Definition at line 2031 of file structural_objects.cpp.

References action_sensitivity, and THROW_ASSERT.

Referenced by copy(), and xload().

Here is the caller graph for this function:

◆ add_parameter()

void action_o::add_parameter ( structural_objectRef  d)

Add a procedure paramenter.

Parameters
dis the paramenter.

Definition at line 1994 of file structural_objects.cpp.

References parameters, and THROW_ASSERT.

Referenced by copy(), and xload().

Here is the caller graph for this function:

◆ copy()

void action_o::copy ( structural_objectRef  dest) const
overridevirtual

Perform a copy of the action.

Parameters
destdestination object.

Reimplemented from structural_object.

Definition at line 2063 of file structural_objects.cpp.

References action_sensitivity, action_type, add_event_to_sensitivity(), add_parameter(), structural_object::copy(), structural_object::debug_level, function_id, parameters, and scope.

Here is the call graph for this function:

◆ find_isomorphic()

structural_objectRef action_o::find_isomorphic ( const structural_objectRef  key) const
overridevirtual

Find key in this object.

Parameters
keyis the object searched.

Implements structural_object.

Definition at line 2084 of file structural_objects.cpp.

References THROW_ERROR.

◆ find_member()

structural_objectRef action_o::find_member ( const std::string &  id,
so_kind  type,
const structural_objectRef  owner 
) const
overridevirtual

Return the object named id of a given type which belongs to or it is associated with the object.

Parameters
idis the identifier of the object we are looking for.
typeis the type of the object we are looking for.
owneris the owner of the object named id.

Implements structural_object.

Definition at line 2090 of file structural_objects.cpp.

References action_o_K, action_sensitivity, bus_connection_o_K, channel_o_K, component_o_K, constant_o_K, data_o_K, event_o_K, parameters, port_o_K, port_vector_o_K, process_typeNames, signal_o_K, signal_vector_o_K, and THROW_ERROR.

◆ get_action_type()

action_o::process_type action_o::get_action_type ( ) const

Return the type of the action.

Definition at line 2026 of file structural_objects.cpp.

References action_type.

◆ get_fun_id()

unsigned int action_o::get_fun_id ( ) const

Return the function id.

Returns
the index of the function associated with the action

Definition at line 2016 of file structural_objects.cpp.

References function_id.

◆ get_parameter()

const structural_objectRef action_o::get_parameter ( unsigned int  n) const

Return the ith input parameter.

Parameters
nis the index of the input parameter.

Definition at line 2000 of file structural_objects.cpp.

References parameters, and THROW_ASSERT.

◆ get_parameters_size()

unsigned int action_o::get_parameters_size ( ) const

Return the number of the parameters.

Definition at line 2006 of file structural_objects.cpp.

References parameters.

◆ get_process_nservice()

bool action_o::get_process_nservice ( ) const

Return the type of the action: process (true) or services (false).

Definition at line 2058 of file structural_objects.cpp.

References action_type, and SERVICE.

◆ get_scope()

const std::string & action_o::get_scope ( ) const

Return the scope of the action.

Definition at line 2053 of file structural_objects.cpp.

References scope.

◆ get_sensitivity()

const structural_objectRef action_o::get_sensitivity ( unsigned int  n) const

Return a specific event of the sensitivity list.

Parameters
nis the index of the event.

Definition at line 2042 of file structural_objects.cpp.

References action_sensitivity, and THROW_ASSERT.

◆ get_sensitivity_size()

unsigned int action_o::get_sensitivity_size ( ) const

Return tha size of the sensitivity list.

Definition at line 2037 of file structural_objects.cpp.

References action_sensitivity.

◆ print()

void action_o::print ( std::ostream &  os) const
overridevirtual

Print the action (for debug purpose)

Parameters
osis an output stream

Reimplemented from structural_object.

Definition at line 2200 of file structural_objects.cpp.

References action_sensitivity, action_type, parameters, structural_object::PP, structural_object::print(), process_typeNames, scope, and SERVICE.

Here is the call graph for this function:

◆ set_action_type()

void action_o::set_action_type ( process_type  at)

Set the type of the action.

Parameters
atis the type of the action.

Definition at line 2021 of file structural_objects.cpp.

References action_type.

◆ set_fun_id()

void action_o::set_fun_id ( unsigned int  id)

Function that set the function with the action.

Parameters
idis the index of the function

Definition at line 2011 of file structural_objects.cpp.

References function_id.

◆ set_scope()

void action_o::set_scope ( const std::string &  sc)

Set the scope of the action.

Parameters
scis the actual scope.

Definition at line 2048 of file structural_objects.cpp.

References scope.

◆ xload()

void action_o::xload ( const xml_element Enode,
structural_objectRef  owner,
structural_managerRef const &  CM 
)
overridevirtual

Load a structural_object starting from an xml file.

Parameters
nodeis a node of the xml tree.
owneris the refcount version of this.
CMis the circuit manager.

someone has to take care of GM

Reimplemented from structural_object.

Definition at line 2133 of file structural_objects.cpp.

References action_type, add_event_to_sensitivity(), add_parameter(), CE_XVM, xml_child::get_children(), GET_CLASS_NAME, structural_manager::get_debug_level(), LOAD_XVFM, LOAD_XVM, process_typeNames, scope, UNKNOWN, and structural_object::xload().

Here is the call graph for this function:

◆ xwrite()

void action_o::xwrite ( xml_element rootnode)
overridevirtual

Add a structural_object to an xml tree.

Parameters
rootnodeis the root node at which the xml representation of the structural object is attached.

someone has to take care of GM

Reimplemented from structural_object.

Definition at line 2177 of file structural_objects.cpp.

References action_sensitivity, action_type, xml_child::add_child_element(), structural_object::get_kind_text(), parameters, process_typeNames, scope, WRITE_XNVM, WRITE_XVM, and structural_object::xwrite().

Here is the call graph for this function:

Field Documentation

◆ action_sensitivity

std::vector<structural_objectRef> action_o::action_sensitivity
private

◆ action_type

process_type action_o::action_type
private

The type of the action.

Definition at line 1318 of file structural_objects.hpp.

Referenced by copy(), get_action_type(), get_process_nservice(), print(), set_action_type(), xload(), and xwrite().

◆ function_id

unsigned int action_o::function_id
private

The index of the function which represents the behavior.

Definition at line 1315 of file structural_objects.hpp.

Referenced by copy(), get_fun_id(), and set_fun_id().

◆ parameters

std::vector<structural_objectRef> action_o::parameters
private

The method procedure parameter.

Definition at line 1312 of file structural_objects.hpp.

Referenced by add_parameter(), copy(), find_member(), get_parameter(), get_parameters_size(), print(), and xwrite().

◆ process_typeNames

const char * action_o::process_typeNames = {"THREAD", "CTHREAD", "METHOD", "SERVICE", "UNKNOWN"}
staticprivate

Redefinition of get_kind_text()

Redefinition of get_kind()store the names of the enumerative process_type.

Definition at line 1461 of file structural_objects.hpp.

Referenced by find_member(), print(), xload(), and xwrite().

◆ scope

std::string action_o::scope
private

Used to identify the scope of the action (public, private or protected)

Definition at line 1324 of file structural_objects.hpp.

Referenced by copy(), get_scope(), print(), set_scope(), xload(), and xwrite().


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

Generated on Mon Feb 12 2024 13:03:43 for PandA-2024.02 by doxygen 1.8.13