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 25 of file inputInterface.hpp.
◆ ~UnirecInputInterface()
Nemea::UnirecInputInterface::~UnirecInputInterface |
( |
| ) |
|
◆ UnirecInputInterface()
Nemea::UnirecInputInterface::UnirecInputInterface |
( |
uint8_t |
interfaceID | ) |
|
|
private |
◆ changeInternalTemplate()
void Nemea::UnirecInputInterface::changeInternalTemplate |
( |
const std::string & |
templateSpecification | ) |
|
|
private |
◆ changeTemplate()
void Nemea::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 90 of file inputInterface.cpp.
◆ getInputInterfaceStats()
Gets the statistics for the input interface.
This method returns the actual statistics for the input interface.
- Returns
- The statistics for the input interface.
Definition at line 125 of file inputInterface.cpp.
◆ getTemplate()
ur_template_t * Nemea::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 90 of file inputInterface.hpp.
◆ handleReceiveErrorCodes()
void Nemea::UnirecInputInterface::handleReceiveErrorCodes |
( |
int |
errorCode | ) |
const |
|
private |
◆ 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 Nemea::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 78 of file inputInterface.cpp.
◆ setTimeout()
void Nemea::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 120 of file inputInterface.cpp.
◆ Unirec
◆ m_interfaceID
uint8_t Nemea::UnirecInputInterface::m_interfaceID |
|
private |
◆ m_prioritizedDataPointer
const void* Nemea::UnirecInputInterface::m_prioritizedDataPointer |
|
private |
◆ m_sequenceNumber
uint64_t Nemea::UnirecInputInterface::m_sequenceNumber |
|
private |
◆ m_template
The documentation for this class was generated from the following files: