MIP_SDK  v3.0.0
MicroStrain Communications Library for embedded systems
Public Member Functions | List of all members
microstrain::connections::RecordingConnectionWrapper< ConnectionType > Class Template Reference

Template wrapper for a recording connection. More...

#include <recording_connection.hpp>

Inheritance diagram for microstrain::connections::RecordingConnectionWrapper< ConnectionType >:
microstrain::connections::RecordingConnection microstrain::Connection

Public Member Functions

template<class... Args>
 RecordingConnectionWrapper (std::ostream *recvStream, std::ostream *sendStream, Args &&... args)
 Creates a RecordingConnectionWrapper that will write received bytes to recvStream, sent bytes to sendStream, and construct a connection object from args. More...
 
 ~RecordingConnectionWrapper ()
 Deconstructs the RecordingConnectionWrapper as well as the underlying connection object made in the constructor. More...
 
- Public Member Functions inherited from microstrain::connections::RecordingConnection
 RecordingConnection (Connection *connection, std::ostream *recvStream=nullptr, std::ostream *sendStream=nullptr)
 Creates a RecordingConnection that will write received bytes to recvStream, and sent bytes to sendStream. More...
 
 ~RecordingConnection ()=default
 
bool sendToDevice (const uint8_t *data, size_t length) override
 Sends bytes to the device. More...
 
bool recvFromDevice (uint8_t *buffer, size_t max_length, unsigned int wait_time_ms, size_t *length_out, EmbeddedTimestamp *timestamp_out) override
 Receives bytes from the device. More...
 
bool isConnected () const override
 
bool connect () override
 
bool disconnect () override
 
const char * interfaceName () const override
 
uint32_t parameter () const override
 
uint64_t recvFileBytesWritten () const
 
uint64_t sendFileBytesWritten () const
 
- Public Member Functions inherited from microstrain::Connection
 Connection ()
 
virtual ~Connection ()
 
const char * type () const
 

Additional Inherited Members

- Static Public Attributes inherited from microstrain::connections::RecordingConnection
static constexpr auto TYPE = "Recording"
 
- Static Public Attributes inherited from microstrain::Connection
static constexpr auto TYPE = "None"
 
- Protected Attributes inherited from microstrain::connections::RecordingConnection
ConnectionmConnection
 
std::ostream * mRecvFile
 
std::ostream * mSendFile
 
uint64_t mRecvFileWritten = 0
 
uint64_t mSendFileWritten = 0
 
- Protected Attributes inherited from microstrain::Connection
const char * mType
 

Detailed Description

template<typename ConnectionType>
class microstrain::connections::RecordingConnectionWrapper< ConnectionType >

Template wrapper for a recording connection.

Parameters
ConnectionTypeThe type of connection used to actually communicate.

Constructor & Destructor Documentation

◆ RecordingConnectionWrapper()

template<typename ConnectionType >
template<class... Args>
microstrain::connections::RecordingConnectionWrapper< ConnectionType >::RecordingConnectionWrapper ( std::ostream *  recvStream,
std::ostream *  sendStream,
Args &&...  args 
)
inline

Creates a RecordingConnectionWrapper that will write received bytes to recvStream, sent bytes to sendStream, and construct a connection object from args.

Parameters
recvStreamThe stream to write to when bytes are received. Null if received bytes should not be written to a stream
sendStreamThe stream to write to when bytes are sent. Null if sent bytes should not be written to a stream
argsArguments required to construct the ConnectionType

◆ ~RecordingConnectionWrapper()

template<typename ConnectionType >
microstrain::connections::RecordingConnectionWrapper< ConnectionType >::~RecordingConnectionWrapper ( )
inline

Deconstructs the RecordingConnectionWrapper as well as the underlying connection object made in the constructor.


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