#include <udpthread.h>
Public Member Functions | |
UDPThread () | |
UDPThread (UDPService &service) | |
virtual | ~UDPThread () |
virtual bool | start (utility::ErrorState &errorState) override final |
virtual void | stop () override final |
asio::io_context & | getIOContext () |
void | manualProcess () |
![]() | |
Resource () | |
![]() | |
Object () | |
virtual | ~Object () |
virtual bool | init (utility::ErrorState &errorState) |
virtual void | onDestroy () |
Object (Object &)=delete | |
Object & | operator= (const Object &)=delete |
Object (Object &&)=delete | |
Object & | operator= (Object &&)=delete |
Public Attributes | |
EUDPThreadUpdateMethod | mUpdateMethod = EUDPThreadUpdateMethod::UDP_MAIN_THREAD |
Property: 'Update Method' the way the UDPThread should process adapters. More... | |
![]() | |
std::string | mID |
Property: 'mID' unique name of the object. Used as an identifier by the system. More... | |
Additional Inherited Members | |
![]() | |
static bool | isIDProperty (rtti::Instance &object, const rtti::Property &property) |
UDPThread is a device that calls the process() function on UDPAdapters. UDPAdapters are typically UDPServers or UDPClients. The UDPThread can can run on the main thread, in which case it registers itself to the UDPService, in that case the UDPThread will call process() of the registered adapters inside the update() call of the UDPService. The UDPThread can spawn its own thread, in which case process() will be called within the while loop of a newly spawned thread. When the user chooses to use MANUAL, process() will be called only when the user explicitly calls the manualProcess() function of the UDPThread
UDPThread | ( | ) |
UDPThread | ( | UDPService & | service | ) |
Constructor
service | reference to UDP service |
|
virtual |
Destructor
asio::io_context& getIOContext | ( | ) |
void manualProcess | ( | ) |
Call this when update method is set to manual. If the update method is MAIN_THREAD or SPAWN_OWN_THREAD, this function will not do anything.
|
finaloverridevirtual |
Starts the UDPThread, spawns new thread if necessary or registers to UDPService
errorState | contains any errors |
Reimplemented from Device.
|
finaloverridevirtual |
EUDPThreadUpdateMethod mUpdateMethod = EUDPThreadUpdateMethod::UDP_MAIN_THREAD |
Property: 'Update Method' the way the UDPThread should process adapters.