Transaction-Level Modeling Framework for Space Applications
Template specialized base class for configuration parameters. More...
#include <sr_param_t.h>
Public Member Functions | |
my_type & | operator+= (val_type) |
my_type & | operator-= (val_type) |
my_type & | operator/= (val_type) |
my_type & | operator*= (val_type) |
val_type | operator+ (val_type) |
val_type | operator- (val_type) |
val_type | operator/ (val_type) |
val_type | operator* (val_type) |
my_type & | operator%= (val_type) |
my_type & | operator^= (val_type) |
my_type & | operator&= (val_type) |
my_type & | operator|= (val_type) |
my_type & | operator<<= (val_type) |
my_type & | operator>>= (val_type) |
my_type & | operator-- () |
val_type | operator-- (int) |
my_type & | operator++ () |
val_type | operator++ (int) |
sr_param_t () | |
Empty constructor. Name will be set in base. Avoid using it! You MUST call init() after instantiation! More... | |
sr_param_t (const bool force_top_level_name, gs_param_array *parent_array, const bool register_at_db) | |
Constructor with the special parameters. Name will be set in base. Avoid using it! You MUST call init() after instantiation! More... | |
sr_param_t (const std::string &nam) | |
Constructor with (local or hierarchical) name. You MUST call init() after instantiation! More... | |
sr_param_t (const std::string &nam, const bool force_top_level_name, gs_param_array *parent_array, const bool register_at_db) | |
Constructor with (local or hierarchical) name and special parameters. You MUST call init() after instantiation! More... | |
void | init (const val_type &default_val) |
Init method to set the value and add the parameter to the plugin db. More... | |
void | init () |
Init method without value. More... | |
virtual | ~sr_param_t () |
Destructor. More... | |
my_type & | operator= (const my_type &v) |
Set the value of this parameter to the value of another gs_param. More... | |
my_type & | operator= (const val_type &v) |
Set the value of this parameter. More... | |
operator const val_type & () const | |
Get the value of this parameter. More... | |
void | setValue (const val_type &val) |
Set the value of this parameter. More... | |
const val_type & | getValue () const |
Returns the value of this parameter. More... | |
const void * | get_value_pointer () const |
bool | setString (const std::string &str) |
Set the value of this parameter with a string. More... | |
const std::string & | getString () const |
Get the value of this parameter as a string. More... | |
virtual std::string | convertValueToString (const val_type &val) const =0 |
Conversion method value type –> string. To be implemented by the specialization. More... | |
virtual const bool | deserialize (val_type &target_val, const std::string &str)=0 |
Deserialize for this parameter. To be implemented by the specialization. More... | |
void | mirror (T &original) |
Serialize this parameter. More... | |
void | mirror (sr_param_t< T > &original) |
Public Member Functions inherited from sr_param_base | |
sr_param_base (const std::string &n, const bool register_at_db=true, gs::cnf::gs_param_array *parent_array=NULL, const bool force_top_level_name=false) | |
void | setProperty (std::string key, std::string value) |
std::string | getProperty (std::string key) |
std::map< std::string, std::string > | getProperties () |
void | deleteProperty (std::string key) |
bool | exists (std::string key) |
easy_init | add_properties () |
Protected Member Functions | |
gs::cnf::callback_return_type | mirror_callback (gs::gs_param_base &changed_param, gs::cnf::callback_type reason) |
const val_type & | convertStringToValue (const std::string &str) |
Get the value the string. Needed for construction of gs_param. More... | |
Protected Attributes | |
val_type | my_value |
Value of this parameter. More... | |
std::string | return_string |
String whose reference can be returned as string value. More... | |
sr_param_t< T > * | m_mirror_param |
T * | m_mirror_val |
Template specialized base class for configuration parameters.
|
inlineexplicit |
Empty constructor. Name will be set in base. Avoid using it! You MUST call init() after instantiation!
|
inlineexplicit |
Constructor with the special parameters. Name will be set in base. Avoid using it! You MUST call init() after instantiation!
register_at_db | see gs::cnf::gs_param_base, default = true. |
parent_array | see gs::cnf::gs_param_base, default=NULL. |
force_top_level_name | If the given name n should be a top-level name (then no prefeix is attached to the name), default false, be carefull in using this. |
|
inlineexplicit |
Constructor with (local or hierarchical) name. You MUST call init() after instantiation!
This constructor may be called with local or hierarchical name.
Explicit constructor to avoid implicit construction of parameters.
gs_param MUST call init() or init(value) after construction to add the parameter to the plugin database!!!
nam | The local (or full hierarchical) parameter name (local: not including points) (local: unique inside a module, hierarchical: unique in the system). |
|
inlineexplicit |
Constructor with (local or hierarchical) name and special parameters. You MUST call init() after instantiation!
This constructor may be called with local or hierarchical name.
Explicit constructor to avoid implicit construction of parameters.
gs_param MUST call init() or init(value) after construction to add the parameter to the plugin database!!!
nam | The local (or full hierarchical) parameter name (local: not including points) (local: unique inside a module, hierarchical: unique in the system). |
register_at_db | see gs::cnf::gs_param_base, default = true. |
parent_array | see gs::cnf::gs_param_base, default=NULL. |
force_top_level_name | If the given name n should be a top-level name (then no prefeix is attached to the name), default false, be carefull in using this. |
|
inlinevirtual |
Destructor.
|
inlineprotected |
Get the value the string. Needed for construction of gs_param.
Conversion string –> value type.
str | String that should be converted to a value |
Referenced by sr_param_t< sc_dt::sc_uint< W > >::init(), and sr_param< std::string >::sr_param().
|
pure virtual |
Conversion method value type –> string. To be implemented by the specialization.
May not make use of m_par_name because it is called inside constructor!
val | Value that should be converted to string. |
Implemented in sr_param< unsigned short >, sr_param< char >, sr_param< signed char >, sr_param< unsigned char >, sr_param< sc_core::sc_event >, sr_param< long long >, sr_param< unsigned long long >, sr_param< sc_core::sc_time >, sr_param< sc_dt::sc_logic >, sr_param< std::vector< std::string > >, sr_param< int64_t >, sr_param< sc_dt::sc_bit >, sr_param< std::string >, sr_param< uint64_t >, sr_param< sc_dt::sc_biguint< W > >, sr_param< sc_dt::sc_unsigned >, sr_param< float >, sr_param< sc_dt::sc_bigint< W > >, sr_param< double >, sr_param< sc_dt::sc_signed >, sr_param< int16_t >, sr_param< bool >, sr_param< sc_dt::sc_uint_base >, sr_param< unsigned int >, sr_param< sc_dt::sc_int< W > >, sr_param< T >, sr_param< uint16_t >, sr_param< sc_time >, sr_param< sc_dt::sc_int_base >, and sr_param< int >.
Referenced by sr_param_t< sc_dt::sc_uint< W > >::getString(), and sr_param_t< sc_dt::sc_uint< W > >::init().
|
pure virtual |
Deserialize for this parameter. To be implemented by the specialization.
Conversion string –> value type.
User implemented for each template specialization of gs_param: Do not write to target_val if deserialization fails!
Set target_val to the default value if str is empty (=="").
Do not use ANY member variables. Act as if the method is static.
target_val | Reference to the value that should be set. |
str | String that should be converted to a value. |
Implemented in sr_param< sc_core::sc_event >, and sr_param< std::string >.
Referenced by sr_param_t< sc_dt::sc_uint< W > >::convertStringToValue(), and sr_param_t< sc_dt::sc_uint< W > >::setString().
|
inline |
|
inline |
Get the value of this parameter as a string.
|
inline |
Returns the value of this parameter.
Referenced by Mctrl::end_of_simulation(), sr_param_t< sc_dt::sc_uint< W > >::mirror_callback(), sr_param_t< sc_dt::sc_uint< W > >::operator const val_type &(), sr_param_t< sc_dt::sc_uint< W > >::operator=(), operator==(), sr_param< sc_dt::sc_bit >::operator==(), sr_param< sc_dt::sc_logic >::operator==(), and Mctrl::switch_power_mode().
|
inline |
Init method to set the value and add the parameter to the plugin db.
Has to be called by the gs_param class after construction! Does set the value and add the parameter to the plugin db.
|
inline |
Init method without value.
Referenced by sr_param< unsigned int >::sr_param(), sr_param< std::string >::sr_param(), sr_param< uint64_t >::sr_param(), sr_param< sc_dt::sc_bit >::sr_param(), sr_param< int64_t >::sr_param(), sr_param< sc_dt::sc_logic >::sr_param(), sr_param< sc_core::sc_event >::sr_param(), and sr_param< long long >::sr_param().
|
inline |
Serialize this parameter.
Uses the convertValueToString method
|
inline |
|
inlineprotected |
|
inline |
Get the value of this parameter.
my_type& sr_param_t< T >::operator%= | ( | val_type | ) |
my_type& sr_param_t< T >::operator&= | ( | val_type | ) |
val_type sr_param_t< T >::operator* | ( | val_type | ) |
my_type& sr_param_t< T >::operator*= | ( | val_type | ) |
val_type sr_param_t< T >::operator+ | ( | val_type | ) |
my_type& sr_param_t< T >::operator++ | ( | ) |
val_type sr_param_t< T >::operator++ | ( | int | ) |
my_type& sr_param_t< T >::operator+= | ( | val_type | ) |
val_type sr_param_t< T >::operator- | ( | val_type | ) |
my_type& sr_param_t< T >::operator-- | ( | ) |
val_type sr_param_t< T >::operator-- | ( | int | ) |
my_type& sr_param_t< T >::operator-= | ( | val_type | ) |
val_type sr_param_t< T >::operator/ | ( | val_type | ) |
my_type& sr_param_t< T >::operator/= | ( | val_type | ) |
my_type& sr_param_t< T >::operator<<= | ( | val_type | ) |
|
inline |
Set the value of this parameter to the value of another gs_param.
To resolve the correct = operator in the (not specialized) class which inherits from this class has to use
v | Parameter where the value should be read from. |
|
inline |
Set the value of this parameter.
To resolve the correct = operator in the (not specialized) class which inherits from this class has to use
v | Value which has to be set. |
my_type& sr_param_t< T >::operator>>= | ( | val_type | ) |
my_type& sr_param_t< T >::operator^= | ( | val_type | ) |
my_type& sr_param_t< T >::operator|= | ( | val_type | ) |
|
inline |
Set the value of this parameter with a string.
str | The new value for this parameter, represented as a string. |
|
inline |
Set the value of this parameter.
Calls conversion value type –> string.
val | The new value for this parameter. |
Referenced by sr_param_t< sc_dt::sc_uint< W > >::mirror_callback(), sr_param_t< sc_dt::sc_uint< W > >::operator=(), sr_param< sc_dt::sc_bit >::operator=(), sr_param< std::string >::operator=(), sr_param< sc_dt::sc_logic >::operator=(), sr_param< unsigned char >::operator=(), sr_param< signed char >::operator=(), sr_param< char >::operator=(), and sr_param< sc_dt::sc_bit >::setValue().
|
protected |
|
protected |
|
protected |
Value of this parameter.
Referenced by sr_param< sc_core::sc_event >::cancel(), sr_param_t< sc_dt::sc_uint< W > >::convertStringToValue(), sr_param< std::vector< std::string > >::empty(), sr_param< sc_core::sc_event >::eventthread(), sr_param_t< sc_dt::sc_uint< W > >::get_value_pointer(), sr_param_t< sc_dt::sc_uint< W > >::getString(), sr_param_t< sc_dt::sc_uint< W > >::getValue(), sr_param_t< sc_dt::sc_uint< W > >::init(), sr_param< std::vector< std::string > >::operator[](), sr_param< std::string >::serialize(), sr_param_t< sc_dt::sc_uint< W > >::setString(), sr_param_t< sc_dt::sc_uint< W > >::setValue(), and sr_param< std::vector< std::string > >::size().
|
mutableprotected |
String whose reference can be returned as string value.
Referenced by sr_param_t< sc_dt::sc_uint< W > >::getString().