A class that provides an interface for receiving data in the Unirec format using the TRAP library.
More...
#include <inputInterface.hpp>
A class that provides an interface for receiving data in the Unirec format using the TRAP library.
Definition at line 24 of file inputInterface.hpp.
◆ ~UnirecInputInterface()
NemeaPlusPlus::UnirecInputInterface::~UnirecInputInterface |
( |
| ) |
|
◆ UnirecInputInterface()
NemeaPlusPlus::UnirecInputInterface::UnirecInputInterface |
( |
uint8_t |
interfaceID | ) |
|
|
private |
◆ changeTemplate()
void NemeaPlusPlus::UnirecInputInterface::changeTemplate |
( |
| ) |
|
Changes the Unirec template used by the input interface.
This method should be called every time when the FormatChangeException is thrown.
This method changes the UniRec record template used for decoding records received on the interface.
- Exceptions
-
std::runtime_error | if the data format was not loaded or the template could not be edited. |
Definition at line 102 of file inputInterface.cpp.
◆ getTemplate()
ur_template_t* NemeaPlusPlus::UnirecInputInterface::getTemplate |
( |
| ) |
const |
|
inlinenoexcept |
Gets the Unirec template used by the input interface.
This method returns a pointer to the Unirec template used by the input interface.
- Returns
- A pointer to the Unirec template used by the input interface.
Definition at line 89 of file inputInterface.hpp.
◆ handleReceiveErrorCodes()
void NemeaPlusPlus::UnirecInputInterface::handleReceiveErrorCodes |
( |
int |
errorCode | ) |
const |
|
private |
◆ isEoFReceived()
bool NemeaPlusPlus::UnirecInputInterface::isEoFReceived |
( |
| ) |
const |
|
privatenoexcept |
◆ receive()
std::optional< UnirecRecordView > NemeaPlusPlus::UnirecInputInterface::receive |
( |
| ) |
|
Receives data from the interface and returns an optional UnirecRecordView object.
If data is received successfully, an UnirecRecordView object is returned that provides a view into the received data. If no data is available or a timeout occurs, std::nullopt is returned.
- Returns
- An optional UnirecRecordView object.
- Exceptions
-
Definition at line 28 of file inputInterface.cpp.
◆ setRequieredFormat()
void NemeaPlusPlus::UnirecInputInterface::setRequieredFormat |
( |
const std::string & |
templateSpecification | ) |
|
Sets the required Unirec format specification.
This method sets the required Unirec format specification for the input interface. Format: "uint64 BYTES, string SNI" (unirecDataType NAME)
- Parameters
-
templateSpecification | The required Unirec format specification. |
- Exceptions
-
std::runtime_error | if the required format could not be set. |
Definition at line 87 of file inputInterface.cpp.
◆ setTimeout()
void NemeaPlusPlus::UnirecInputInterface::setTimeout |
( |
int |
timeout | ) |
|
Sets the receive timeout for the interface. This method sets the timeout for receiving UniRec records on the interface. If no record is received within the specified timeout, the receive method returns an empty optional.
- Parameters
-
timeout | The timeout value in microseconds.
TRAP_WAIT : Blocking mode, wait for client's connection, for message transport to/from internal system buffer.
TRAP_NO_WAIT : Non-Blocking mode, do not wait ever.
timeout : Wait max for specific time.
|
Definition at line 97 of file inputInterface.cpp.
◆ Unirec
◆ m_EoFOnNextReceive
bool NemeaPlusPlus::UnirecInputInterface::m_EoFOnNextReceive |
|
private |
◆ m_interfaceID
uint8_t NemeaPlusPlus::UnirecInputInterface::m_interfaceID |
|
private |
◆ m_prioritizedDataPointer
const void* NemeaPlusPlus::UnirecInputInterface::m_prioritizedDataPointer |
|
private |
◆ m_template
ur_template_t* NemeaPlusPlus::UnirecInputInterface::m_template = nullptr |
|
private |
The documentation for this class was generated from the following files: