7 : m_availableInputInterfaces(0)
8 , m_availableOutputInterfaces(0)
9 , m_trapModuleInfo(trapModuleInfo)
15 trap_ifc_spec_t trapIfcSpec;
20 trap_free_ifc_spec(trapIfcSpec);
21 throw std::runtime_error(
"Unirec::init() has failed. " + std::string(trap_last_error_msg));
24 trap_free_ifc_spec(trapIfcSpec);
32 int ret = trap_parse_params(&argc, argv, &trapIfcSpec);
33 if (ret == TRAP_E_OK) {
37 if (ret == TRAP_E_HELP) {
42 throw std::runtime_error(
43 "Libtrap::parseCommandLine() has failed. " + std::string(trap_last_error_msg));
49 throw std::runtime_error(
"TODO");
58 throw std::runtime_error(
"TODO");
67 throw std::runtime_error(
"TODO");
79 throw std::runtime_error(
80 "Unirec::defineUnirecField() has failed. Error code=[" + std::to_string(ret) +
"]");
Defines custom exception classes.
A class for sending UniRec records through a Trap interface.
void parseCommandLine(int &argc, char **argv, trap_ifc_spec_t &trapIfcSpec)
int ur_define_field(const char *name, ur_field_type_t type)
Define new UniRec field Define new UniRec field at run-time. It adds new field into existing structur...
Unirec(const TrapModuleInfo &trapModuleInfo)
TrapModuleInfo m_trapModuleInfo
UnirecInputInterface buildInputInterface()
Builds and returns a UnirecInputInterface object if an input interface is available.
void ur_finalize()
Deallocate UniRec structures Deallocate UniRec structures at the end of a program. This function SHOULD be called after all UniRec functions and macros invocations, typically during a cleanup phase before the program's end. This function has to be called if some fields are defined during run-time, otherwise this function is needless.
This exception is thrown when the libtrap command-line argument contains help flag.
UnirecBidirectionalInterface buildBidirectionalInterface()
uint8_t m_availableInputInterfaces
void init(int &argc, char **argv)
A class that provides a bidirectional interface for sending and receiving unirec records.
int16_t ur_field_id_t
Type of UniRec field identifiers.
uint8_t m_availableOutputInterfaces
bool isBidirectionalInterfaceAvailable() const noexcept
trap_module_info_t m_moduleInfo
bool isOutputInterfaceAvailable() const noexcept
ur_field_id_t defineUnirecField(const std::string &fieldName, ur_field_type_t fieldType)
bool isInputInterfaceAvailable() const noexcept
Class representing information about a trap module.
UnirecOutputInterface buildOutputInterface()