scc  2022.4.0
SystemC components library
scc::sc_variable< T > Struct Template Reference

SystemC variable. More...

#include <sc_variable.h>

Inheritance diagram for scc::sc_variable< T >:
Collaboration diagram for scc::sc_variable< T >:

Classes

struct  creator
 

Public Types

using this_type = sc_variable< T >
 

Public Member Functions

const T & operator* ()
 get a reference to the wrapped value More...
 
 sc_variable (const std::string &name, const T &value)
 constructor taking a name and a reference of the variable to be wrapped More...
 
std::string to_string () const override
 create a textual representation of the wrapped value More...
 
get () const
 value getter
 
 operator bool () const
 bool conversion operator
 
 operator T () const
 cast operator
 
sc_variableoperator= (const T other)
 
bool operator== (T other) const
 
bool operator!= (T other) const
 
bool operator> (T other) const
 
bool operator< (T other) const
 
bool operator>= (T other) const
 
bool operator<= (T other) const
 
sc_variableoperator++ ()
 overloaded prefix ++ operator
 
operator++ (int)
 overloaded postfix ++ operator
 
sc_variableoperator-- ()
 overloaded prefix – operator
 
operator-- (int)
 overloaded postfix – operator
 
operator+= (const T other)
 
operator-= (const T other)
 
operator*= (const T other)
 
operator/= (const T other)
 
operator+ (const T other) const
 
operator- (const T other) const
 
operator* (const T other) const
 
operator/ (const T other) const
 
operator+ (const this_type &other) const
 
operator- (const this_type &other) const
 
operator* (const this_type &other) const
 
operator/ (const this_type &other) const
 
void trace (sc_core::sc_trace_file *tf) const override
 register the value with the SystemC trace implementation More...
 
void trace (observer *obs) const override
 
- Public Member Functions inherited from scc::sc_variable_b
 sc_variable_b (const char *name)
 
const char * kind () const
 get the kind of this sc_object More...
 

Static Public Member Functions

static sc_variable< T > create (const char *n, size_t i, T default_val)
 

Detailed Description

template<typename T>
struct scc::sc_variable< T >

SystemC variable.

the sc_variable for a particular plain data type

This class makes plain and composite C++ datatype variables visible to the SystemC kernel by registering them in the SystemC object hierarchy.

Template Parameters
Tthe data type of the wrapped value

Definition at line 80 of file sc_variable.h.

Constructor & Destructor Documentation

◆ sc_variable()

template<typename T >
scc::sc_variable< T >::sc_variable ( const std::string &  name,
const T &  value 
)
inline

constructor taking a name and a reference of the variable to be wrapped

Parameters
namethe name
valuethe variable reference to be wrapped

Definition at line 96 of file sc_variable.h.

Member Function Documentation

◆ operator!=()

template<typename T >
bool scc::sc_variable< T >::operator!= ( other) const
inline

inequality comparison

Parameters
other
Returns

Definition at line 147 of file sc_variable.h.

◆ operator*()

template<typename T >
const T & scc::sc_variable< T >::operator* ( )
inline

get a reference to the wrapped value

Returns

Definition at line 88 of file sc_variable.h.

◆ operator<()

template<typename T >
bool scc::sc_variable< T >::operator< ( other) const
inline

less than comparison

Parameters
other
Returns

Definition at line 159 of file sc_variable.h.

◆ operator<=()

template<typename T >
bool scc::sc_variable< T >::operator<= ( other) const
inline

less than or equal comparison

Parameters
other
Returns

Definition at line 171 of file sc_variable.h.

◆ operator==()

template<typename T >
bool scc::sc_variable< T >::operator== ( other) const
inline

equality comparison

Parameters
other
Returns

Definition at line 141 of file sc_variable.h.

◆ operator>()

template<typename T >
bool scc::sc_variable< T >::operator> ( other) const
inline

greater than comparison

Parameters
other
Returns

Definition at line 153 of file sc_variable.h.

◆ operator>=()

template<typename T >
bool scc::sc_variable< T >::operator>= ( other) const
inline

greater than or equal comparison

Parameters
other
Returns

Definition at line 165 of file sc_variable.h.

◆ to_string()

template<typename T >
std::string scc::sc_variable< T >::to_string ( ) const
inlineoverridevirtual

create a textual representation of the wrapped value

Returns
the string representing the value

Reimplemented from scc::sc_variable_b.

Definition at line 108 of file sc_variable.h.

◆ trace()

template<typename T >
void scc::sc_variable< T >::trace ( sc_core::sc_trace_file *  tf) const
inlineoverride

register the value with the SystemC trace implementation

Parameters
tf

Definition at line 244 of file sc_variable.h.


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