scc 2025.09
SystemC components library
tlm::nw::tlm_network_payload< CMDENUM > Struct Template Reference

A class for TLM network payloads with support for extensions and memory management. More...

#include <tlm_network_gp.h>

Inheritance diagram for tlm::nw::tlm_network_payload< CMDENUM >:
Collaboration diagram for tlm::nw::tlm_network_payload< CMDENUM >:

Classes

struct  gp_mm

Public Member Functions

 tlm_network_payload ()
 Default constructor.
 tlm_network_payload (tlm_base_mm_interface *mm)
 Constructor with memory management interface.
 tlm_network_payload (const tlm_network_payload< CMDENUM > &x)=delete
virtual ~tlm_network_payload ()=default
void deep_copy_from (const tlm_network_payload &other)
 Non-virtual deep-copying of the object.
CMDENUM get_command () const
 Gets the command from the payload.
void set_command (const CMDENUM command)
 Sets the command in the payload.
std::vector< uint8_t > const & get_data () const
 Gets the data from the payload.
std::vector< uint8_t > & get_data ()
 Gets the data from the payload.
void set_data (std::vector< uint8_t > const &value)
 Sets the data in the payload.
bool is_response_ok () const
 Checks if the response status is OK.
bool is_response_error () const
 Checks if the response status is an error.
tlm_response_status get_response_status () const
 Gets the response status from the payload.
void set_response_status (const tlm_response_status response_status)
 Sets the response status in the payload.
std::string get_response_string () const
 Gets the response status as a string.
Public Member Functions inherited from tlm::nw::tlm_network_payload_base
 tlm_network_payload_base ()
 Default constructor.
 tlm_network_payload_base (tlm_base_mm_interface *mm)
 Constructor with memory management interface.
virtual ~tlm_network_payload_base ()
void reset ()
 Constructor with memory management interface.
void acquire ()
 Acquires a reference to the payload.
void release ()
 Releases a reference to the payload.
int get_ref_count () const
 Gets the reference count of the payload.
void set_mm (tlm_base_mm_interface *mm)
bool has_mm () const
void copy_extensions_from (const tlm_network_payload_base &other)
void update_extensions_from (const tlm_network_payload_base &other)
void free_all_extensions ()
template<typename T>
T * set_extension (T *ext)
tlm_extension_base * set_extension (unsigned int index, tlm_extension_base *ext)
template<typename T>
T * set_auto_extension (T *ext)
tlm_extension_base * set_auto_extension (unsigned int index, tlm_extension_base *ext)
template<typename T>
void get_extension (T *&ext) const
template<typename T>
T * get_extension () const
tlm_extension_base * get_extension (unsigned int index) const
template<typename T>
void clear_extension (const T *ext)
template<typename T>
void clear_extension ()
template<typename T>
void release_extension (T *ext)
template<typename T>
void release_extension ()
size_t get_extension_count ()
void resize_extensions ()

Static Public Member Functions

static tlm_network_payload< CMDENUM > * create ()
 Creates a new instance of the tlm_network_payload using a thread-local memory manager.

Protected Member Functions

tlm_network_payload< CMDENUM > & operator= (const tlm_network_payload< CMDENUM > &x)

Protected Attributes

CMDENUM m_command
std::vector< uint8_t > m_data
tlm_response_status m_response_status

Detailed Description

template<typename CMDENUM>
struct tlm::nw::tlm_network_payload< CMDENUM >

A class for TLM network payloads with support for extensions and memory management.

The tlm_network_payload class provides a foundation for creating custom TLM network payloads. It includes methods for managing extensions, memory management, and response status.

Template Parameters
CMDENUMThe type of command enumeration used by the payload.
Author
Your Name
Date
YYYY-MM-DD

Definition at line 199 of file tlm_network_gp.h.

Constructor & Destructor Documentation

◆ tlm_network_payload() [1/2]

template<typename CMDENUM>
tlm::nw::tlm_network_payload< CMDENUM >::tlm_network_payload ( )
inline

Default constructor.

Initializes the tlm_network_payload object with default values.

Definition at line 357 of file tlm_network_gp.h.

◆ tlm_network_payload() [2/2]

template<typename CMDENUM>
tlm::nw::tlm_network_payload< CMDENUM >::tlm_network_payload ( tlm_base_mm_interface * mm)
inlineexplicit

Constructor with memory management interface.

Initializes the tlm_network_payload object with a specified memory management interface.

Parameters
mmThe memory management interface.

Definition at line 363 of file tlm_network_gp.h.

◆ ~tlm_network_payload()

template<typename CMDENUM>
virtual tlm::nw::tlm_network_payload< CMDENUM >::~tlm_network_payload ( )
virtualdefault

virtual destructor.

Member Function Documentation

◆ create()

template<typename CMDENUM>
tlm_network_payload< CMDENUM > * tlm::nw::tlm_network_payload< CMDENUM >::create ( )
inlinestatic

Creates a new instance of the tlm_network_payload using a thread-local memory manager.

Returns a new instance of the tlm_network_payload, using a thread-local memory manager to allocate the object.

Returns
A new instance of the tlm_network_payload.

Definition at line 339 of file tlm_network_gp.h.

◆ deep_copy_from()

template<typename CMDENUM>
void tlm::nw::tlm_network_payload< CMDENUM >::deep_copy_from ( const tlm_network_payload< CMDENUM > & other)

Non-virtual deep-copying of the object.

Performs a deep copy of the object, including copying the command, response status, data, and extensions.

Parameters
otherThe object to copy from.

Definition at line 378 of file tlm_network_gp.h.

◆ get_command()

template<typename CMDENUM>
CMDENUM tlm::nw::tlm_network_payload< CMDENUM >::get_command ( ) const
inline

Gets the command from the payload.

Returns the command stored in the payload.

Returns
The command.

Definition at line 236 of file tlm_network_gp.h.

◆ get_data() [1/2]

template<typename CMDENUM>
std::vector< uint8_t > & tlm::nw::tlm_network_payload< CMDENUM >::get_data ( )
inline

Gets the data from the payload.

Returns a reference to the data stored in the payload.

Returns
A reference to the data.

Definition at line 260 of file tlm_network_gp.h.

◆ get_data() [2/2]

template<typename CMDENUM>
std::vector< uint8_t > const & tlm::nw::tlm_network_payload< CMDENUM >::get_data ( ) const
inline

Gets the data from the payload.

Returns a reference to the data stored in the payload.

Returns
A reference to the data.

Definition at line 252 of file tlm_network_gp.h.

◆ get_response_status()

template<typename CMDENUM>
tlm_response_status tlm::nw::tlm_network_payload< CMDENUM >::get_response_status ( ) const
inline

Gets the response status from the payload.

Returns the response status stored in the payload.

Returns
The response status.

Definition at line 292 of file tlm_network_gp.h.

◆ get_response_string()

template<typename CMDENUM>
std::string tlm::nw::tlm_network_payload< CMDENUM >::get_response_string ( ) const

Gets the response status as a string.

Returns the response status stored in the payload as a string.

Returns
The response status as a string.

Definition at line 385 of file tlm_network_gp.h.

◆ is_response_error()

template<typename CMDENUM>
bool tlm::nw::tlm_network_payload< CMDENUM >::is_response_error ( ) const
inline

Checks if the response status is an error.

Returns true if the response status is an error, indicating an unsuccessful transaction.

Returns
True if the response status is an error, false otherwise.

Definition at line 284 of file tlm_network_gp.h.

◆ is_response_ok()

template<typename CMDENUM>
bool tlm::nw::tlm_network_payload< CMDENUM >::is_response_ok ( ) const
inline

Checks if the response status is OK.

Returns true if the response status is OK, indicating a successful transaction.

Returns
True if the response status is OK, false otherwise.

Definition at line 276 of file tlm_network_gp.h.

◆ operator=()

template<typename CMDENUM>
tlm_network_payload< CMDENUM > & tlm::nw::tlm_network_payload< CMDENUM >::operator= ( const tlm_network_payload< CMDENUM > & x)
inlineprotected

Definition at line 345 of file tlm_network_gp.h.

◆ set_command()

template<typename CMDENUM>
void tlm::nw::tlm_network_payload< CMDENUM >::set_command ( const CMDENUM command)
inline

Sets the command in the payload.

Updates the command stored in the payload.

Parameters
commandThe new command.

Definition at line 244 of file tlm_network_gp.h.

◆ set_data()

template<typename CMDENUM>
void tlm::nw::tlm_network_payload< CMDENUM >::set_data ( std::vector< uint8_t > const & value)
inline

Sets the data in the payload.

Updates the data stored in the payload.

Parameters
valueThe new data.

Definition at line 268 of file tlm_network_gp.h.

◆ set_response_status()

template<typename CMDENUM>
void tlm::nw::tlm_network_payload< CMDENUM >::set_response_status ( const tlm_response_status response_status)
inline

Sets the response status in the payload.

Updates the response status stored in the payload.

Parameters
response_statusThe new response status.

Definition at line 300 of file tlm_network_gp.h.

Member Data Documentation

◆ m_command

template<typename CMDENUM>
CMDENUM tlm::nw::tlm_network_payload< CMDENUM >::m_command
protected

Definition at line 351 of file tlm_network_gp.h.

◆ m_data

template<typename CMDENUM>
std::vector<uint8_t> tlm::nw::tlm_network_payload< CMDENUM >::m_data
protected

Definition at line 352 of file tlm_network_gp.h.

◆ m_response_status

template<typename CMDENUM>
tlm_response_status tlm::nw::tlm_network_payload< CMDENUM >::m_response_status
protected

Definition at line 353 of file tlm_network_gp.h.


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