scc 2026.07
SystemC components library
scc::tcp4tlm::connection< TSEND, TREC > Class Template Reference

The connection class provides FlatBuffers framing primitives on top of a socket. More...

#include <serialized_connection.h>

Inheritance diagram for scc::tcp4tlm::connection< TSEND, TREC >:
Collaboration diagram for scc::tcp4tlm::connection< TSEND, TREC >:

Classes

struct  async_listener

Public Types

typedef boost::asio::ip::tcp::socket socket_t
typedef boost::asio::ip::tcp::endpoint endpoint_t
typedef boost::asio::ip::tcp::acceptor acceptor_t
typedef std::shared_ptr< connection< TSEND, TREC > > ptr

Public Member Functions

 connection (boost::asio::io_context &io_context)
socket_t & socket ()
void add_listener (std::shared_ptr< async_listener > l)
void async_write (TSEND &t)
void async_write (TSEND *t)
void async_read ()
void write_data (std::shared_ptr< TSEND > &t)
void write_data (TSEND &t)
void write_data (TSEND *t)
void write_data (TSEND *t, boost::system::error_code &ec)
bool read_data_available ()
void read_data (std::shared_ptr< TREC > &msg)
void read_data (TREC *&t)
void read_data (TREC *&t, boost::system::error_code &ec)

Protected Member Functions

void handle_async_write (const boost::system::error_code &err, size_t)
void async_read_header (const boost::system::error_code &e)
void async_read_data (const boost::system::error_code &e)

Detailed Description

template<typename TSEND, typename TREC>
class scc::tcp4tlm::connection< TSEND, TREC >

The connection class provides FlatBuffers framing primitives on top of a socket.

Each message sent using this class consists of:

  • An 8-byte header containing the length of the serialized data in hexadecimal.
  • The serialized FlatBuffer payload.

Definition at line 38 of file serialized_connection.h.

Member Typedef Documentation

◆ acceptor_t

template<typename TSEND, typename TREC>
typedef boost::asio::ip::tcp::acceptor scc::tcp4tlm::connection< TSEND, TREC >::acceptor_t

Definition at line 51 of file serialized_connection.h.

◆ endpoint_t

template<typename TSEND, typename TREC>
typedef boost::asio::ip::tcp::endpoint scc::tcp4tlm::connection< TSEND, TREC >::endpoint_t

Definition at line 50 of file serialized_connection.h.

◆ ptr

template<typename TSEND, typename TREC>
typedef std::shared_ptr<connection<TSEND, TREC> > scc::tcp4tlm::connection< TSEND, TREC >::ptr

Definition at line 53 of file serialized_connection.h.

◆ socket_t

template<typename TSEND, typename TREC>
typedef boost::asio::ip::tcp::socket scc::tcp4tlm::connection< TSEND, TREC >::socket_t

Definition at line 49 of file serialized_connection.h.

Constructor & Destructor Documentation

◆ connection()

template<typename TSEND, typename TREC>
scc::tcp4tlm::connection< TSEND, TREC >::connection ( boost::asio::io_context & io_context)
inline

Definition at line 60 of file serialized_connection.h.

Member Function Documentation

◆ add_listener()

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::add_listener ( std::shared_ptr< async_listener > l)
inline

Definition at line 64 of file serialized_connection.h.

◆ async_read()

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::async_read ( )
inline

Definition at line 92 of file serialized_connection.h.

◆ async_read_data()

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::async_read_data ( const boost::system::error_code & e)
inlineprotected

Definition at line 121 of file serialized_connection.h.

◆ async_read_header()

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::async_read_header ( const boost::system::error_code & e)
inlineprotected

Definition at line 99 of file serialized_connection.h.

◆ async_write() [1/2]

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::async_write ( TSEND & t)
inline

Definition at line 66 of file serialized_connection.h.

◆ async_write() [2/2]

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::async_write ( TSEND * t)
inline

Definition at line 68 of file serialized_connection.h.

◆ handle_async_write()

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::handle_async_write ( const boost::system::error_code & err,
size_t  )
inlineprotected

Definition at line 86 of file serialized_connection.h.

◆ read_data() [1/3]

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::read_data ( std::shared_ptr< TREC > & msg)
inline

Definition at line 175 of file serialized_connection.h.

◆ read_data() [2/3]

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::read_data ( TREC *& t)
inline

Definition at line 181 of file serialized_connection.h.

◆ read_data() [3/3]

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::read_data ( TREC *& t,
boost::system::error_code & ec )
inline

Definition at line 187 of file serialized_connection.h.

◆ read_data_available()

template<typename TSEND, typename TREC>
bool scc::tcp4tlm::connection< TSEND, TREC >::read_data_available ( )
inline

Definition at line 168 of file serialized_connection.h.

◆ socket()

template<typename TSEND, typename TREC>
socket_t & scc::tcp4tlm::connection< TSEND, TREC >::socket ( )
inline

Definition at line 63 of file serialized_connection.h.

◆ write_data() [1/4]

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::write_data ( std::shared_ptr< TSEND > & t)
inline

Definition at line 144 of file serialized_connection.h.

◆ write_data() [2/4]

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::write_data ( TSEND & t)
inline

Definition at line 146 of file serialized_connection.h.

◆ write_data() [3/4]

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::write_data ( TSEND * t)
inline

Definition at line 148 of file serialized_connection.h.

◆ write_data() [4/4]

template<typename TSEND, typename TREC>
void scc::tcp4tlm::connection< TSEND, TREC >::write_data ( TSEND * t,
boost::system::error_code & ec )
inline

Definition at line 154 of file serialized_connection.h.


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