rohdeschwarz  0.2.0
TCPIP socket library for Rohde & Schwarz instrument control
Public Member Functions | List of all members
rohdeschwarz::scpi::BlockData Class Reference

Object-oriented Block Data storage and manipulation. More...

#include <block_data.hpp>

Public Member Functions

 BlockData ()
 Default Constructor. More...
 
 BlockData (std::vector< unsigned char > data)
 Constructor. More...
 
bool isHeaderError () const
 Checks the header for errors. More...
 
bool isHeader () const
 Checks for a valid and complete Block Data header. More...
 
bool isComplete () const
 Checks for complete Block Data header and payload. More...
 
void push_back (std::vector< unsigned char >::const_iterator begin, std::size_t size)
 Copies data to block. More...
 
std::size_t size () const
 Gets payload size, in bytes, from a complete header. More...
 
unsigned char * data ()
 Gets a pointer to the payload data. More...
 

Detailed Description

Object-oriented Block Data storage and manipulation.

Definition at line 23 of file block_data.hpp.

Constructor & Destructor Documentation

◆ BlockData() [1/2]

BlockData::BlockData ( )

Default Constructor.

Definition at line 17 of file block_data.cpp.

◆ BlockData() [2/2]

BlockData::BlockData ( std::vector< unsigned char >  data)

Constructor.

This constructor supports move semantics.

Parameters
[in]dataInitial data to populate Block Data with

Definition at line 27 of file block_data.cpp.

Member Function Documentation

◆ data()

unsigned char * BlockData::data ( )

Gets a pointer to the payload data.

Requires isHeader() to be true.

Returns
pointer to payload data

Definition at line 142 of file block_data.cpp.

◆ isComplete()

bool BlockData::isComplete ( ) const

Checks for complete Block Data header and payload.

Definition at line 99 of file block_data.cpp.

◆ isHeader()

bool BlockData::isHeader ( ) const

Checks for a valid and complete Block Data header.

Definition at line 93 of file block_data.cpp.

◆ isHeaderError()

bool BlockData::isHeaderError ( ) const

Checks the header for errors.

Incomplete headers are judged based on the

Returns
true if block data header is valid or has the potential to be valid; false otherwise

Definition at line 38 of file block_data.cpp.

◆ push_back()

void BlockData::push_back ( std::vector< unsigned char >::const_iterator  begin,
std::size_t  size 
)

Copies data to block.

Definition at line 109 of file block_data.cpp.

◆ size()

std::size_t BlockData::size ( ) const

Gets payload size, in bytes, from a complete header.

Requires isHeader() to be true.

Returns
payload size, in bytes, if header is valid and complete; 0 otherwise

Definition at line 136 of file block_data.cpp.


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