scc 2025.09
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
const T * operator-> ()
 sc_variable (const std::string &name, const T &value)
 constructor taking a name and a reference of the variable to be wrapped
 sc_variable (sc_variable< T > const &)=delete
 sc_variable (sc_variable< T > &&)=delete
sc_variableoperator= (sc_variable< T > &&other)=delete
std::string to_string () const override
 create a textual representation of the wrapped value
get () const
 value getter
 operator bool () const
 bool conversion operator
 operator T () const
 cast operator
sc_variableoperator= (T other)
sc_variableoperator= (const sc_variable< 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
void trace (observer *obs) const override
Public Member Functions inherited from scc::sc_variable_b
 sc_variable_b (const char *name)
 sc_variable_b (sc_variable_b const &)=delete
 sc_variable_b (sc_variable_b &&)=delete
sc_variable_b & operator= (const sc_variable_b &other)=delete
sc_variable_b & operator= (sc_variable_b &&other)=delete
const char * kind () const
 get the kind of this sc_object

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 87 of file sc_variable.h.

Member Typedef Documentation

◆ this_type

template<typename T>
using scc::sc_variable< T >::this_type = sc_variable<T>

Definition at line 88 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 110 of file sc_variable.h.

Member Function Documentation

◆ get()

template<typename T>
T scc::sc_variable< T >::get ( ) const
inline

value getter

Definition at line 136 of file sc_variable.h.

◆ operator bool()

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

bool conversion operator

Definition at line 141 of file sc_variable.h.

◆ operator T()

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

cast operator

Definition at line 147 of file sc_variable.h.

◆ operator!=()

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

inequality comparison

Parameters
other
Returns

Definition at line 173 of file sc_variable.h.

◆ operator*() [1/3]

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

get a reference to the wrapped value

Returns

Definition at line 95 of file sc_variable.h.

◆ operator*() [2/3]

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

Definition at line 258 of file sc_variable.h.

◆ operator*() [3/3]

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

Definition at line 262 of file sc_variable.h.

◆ operator*=()

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

Definition at line 244 of file sc_variable.h.

◆ operator+() [1/2]

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

Definition at line 256 of file sc_variable.h.

◆ operator+() [2/2]

template<typename T>
T scc::sc_variable< T >::operator+ ( const this_type & other) const
inline

Definition at line 260 of file sc_variable.h.

◆ operator++() [1/2]

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

overloaded prefix ++ operator

Definition at line 199 of file sc_variable.h.

◆ operator++() [2/2]

template<typename T>
T scc::sc_variable< T >::operator++ ( int )
inline

overloaded postfix ++ operator

Definition at line 207 of file sc_variable.h.

◆ operator+=()

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

Definition at line 232 of file sc_variable.h.

◆ operator-() [1/2]

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

Definition at line 257 of file sc_variable.h.

◆ operator-() [2/2]

template<typename T>
T scc::sc_variable< T >::operator- ( const this_type & other) const
inline

Definition at line 261 of file sc_variable.h.

◆ operator--() [1/2]

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

overloaded prefix – operator

Definition at line 215 of file sc_variable.h.

◆ operator--() [2/2]

template<typename T>
T scc::sc_variable< T >::operator-- ( int )
inline

overloaded postfix – operator

Definition at line 223 of file sc_variable.h.

◆ operator-=()

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

Definition at line 238 of file sc_variable.h.

◆ operator->()

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

Definition at line 102 of file sc_variable.h.

◆ operator/() [1/2]

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

Definition at line 259 of file sc_variable.h.

◆ operator/() [2/2]

template<typename T>
T scc::sc_variable< T >::operator/ ( const this_type & other) const
inline

Definition at line 263 of file sc_variable.h.

◆ operator/=()

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

Definition at line 250 of file sc_variable.h.

◆ operator<()

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

less than comparison

Parameters
other
Returns

Definition at line 185 of file sc_variable.h.

◆ operator<=()

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

less than or equal comparison

Parameters
other
Returns

Definition at line 197 of file sc_variable.h.

◆ operator=() [1/2]

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

Definition at line 156 of file sc_variable.h.

◆ operator=() [2/2]

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

Definition at line 149 of file sc_variable.h.

◆ operator==()

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

equality comparison

Parameters
other
Returns

Definition at line 167 of file sc_variable.h.

◆ operator>()

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

greater than comparison

Parameters
other
Returns

Definition at line 179 of file sc_variable.h.

◆ operator>=()

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

greater than or equal comparison

Parameters
other
Returns

Definition at line 191 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 127 of file sc_variable.h.

◆ trace() [1/2]

template<typename T>
void scc::sc_variable< T >::trace ( observer * obs) const
inlineoverridevirtual

Implements scc::sc_variable_b.

Definition at line 277 of file sc_variable.h.

◆ trace() [2/2]

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 270 of file sc_variable.h.


The documentation for this struct was generated from the following file:
  • /home/eyck/Projects/MINRES/SystemC-Components/src/sysc/scc/sc_variable.h