![]() |
libcyberradio
22.01.24
|
UDP status receiver. More...
#include <StatusReceiver.h>
Public Member Functions | |
| StatusReceiver (std::string ifname, unsigned int port, bool debug, bool updatePE) | |
| Constructs a StatusReceiver object. More... | |
| virtual | ~StatusReceiver () |
| Destroys a StatusReceiver object. | |
| virtual void | run () |
| Executes the main processing loop for the thread. | |
| bool | setStatusInterface (std::string ifname) |
| Sets the interface name. More... | |
| bool | setStatusInterface (std::string ifname, bool makeSocketFlag) |
| Sets the interface name. More... | |
| bool | setStatusPort (unsigned int port) |
| Sets the UDP port. More... | |
| bool | setStatusPort (unsigned int port, bool makeSocketFlag) |
| Sets the UDP port. More... | |
| bool | okToSend (long int pendingSamples, bool lockIfOk) |
| Determines if it is OK to send data. More... | |
| long int | getFreeSpace (void) |
| Gets the amount of free space available. More... | |
| bool | sentNSamples (long int samplesSent) |
| Updates status based on the number of samples sent. More... | |
| virtual void | start () |
| Starts thread processing. | |
| virtual void | interrupt () |
| Interrupts (stops) the thread. | |
| virtual void | sleep (double secs) |
| Pauses thread execution for a given time, checking for user interrupts during that time. More... | |
| virtual bool | isRunning () const |
| Determines if the thread is running or not. More... | |
| virtual void | setName (const std::string &name) |
| Sets the name of the thread. More... | |
| virtual void | setClass (const std::string &cls) |
| Sets the class identifer string for the thread. More... | |
| virtual boost::thread::id | getId () const |
| Gets the identifier of the underlying Boost thread. More... | |
| virtual std::string | getIdString () const |
| Gets the identifier string for this thread. More... | |
| virtual void | onInterrupt () |
| Executes code that must run when the thread is interrupted. More... | |
| virtual void | onException (const std::exception &ex) |
| Executes code that must run when an unhandled exception occurs within the thread. More... | |
| virtual void | setDebugName (const std::string &debug_name) |
| Sets the debug name for this object. More... | |
| virtual void | setDebugFile (FILE *debug_fp) |
| Sets the debug file pointer for this object. More... | |
| virtual void | setDebugTimeFormat (const std::string &debug_timefmt) |
| Sets the debug time format for this object. More... | |
| virtual int | debug (const char *format,...) |
| Outputs debug information. More... | |
| virtual const char * | debugBool (bool x) |
| Gets a debug output string for a Boolean value. More... | |
| virtual bool | isDebug () const |
| Gets whether this object produces debug output. More... | |
| virtual std::string | getDebugName () const |
| Gets the debug name for this object. More... | |
| virtual std::string | rawString (const std::string &data) |
| Gets a "raw" string representation of a given data string. More... | |
UDP status receiver.
Definition at line 38 of file StatusReceiver.h.
| StatusReceiver | ( | std::string | ifname, |
| unsigned int | port, | ||
| bool | debug, | ||
| bool | updatePE | ||
| ) |
Constructs a StatusReceiver object.
| ifname | Ethernet interface name |
| port | UDP port |
| debug | Whether or not to produce debug output |
| updatePE |
Definition at line 29 of file StatusReceiver.cpp.
|
virtualinherited |
Outputs debug information.
This method follows the same semantics as printf(). Output is preceded by a timestamp and the name of the object, if provided.
| format | The printf()-style format string. |
| ... | Comma-separated list of arguments to print. Note that these need to be arguments that can be supported natively through printf(). |
Definition at line 95 of file Debuggable.cpp.
|
virtualinherited |
Gets a debug output string for a Boolean value.
| x | Boolean value |
Definition at line 126 of file Debuggable.cpp.
|
virtualinherited |
Gets the debug name for this object.
Definition at line 138 of file Debuggable.cpp.
| long int getFreeSpace | ( | void | ) |
Gets the amount of free space available.
Definition at line 256 of file StatusReceiver.cpp.
|
virtualinherited |
Gets the identifier of the underlying Boost thread.
Definition at line 91 of file Thread.cpp.
|
virtualinherited |
Gets the identifier string for this thread.
Definition at line 96 of file Thread.cpp.
|
virtualinherited |
Gets whether this object produces debug output.
Definition at line 133 of file Debuggable.cpp.
|
virtualinherited |
Determines if the thread is running or not.
Definition at line 72 of file Thread.cpp.
| bool okToSend | ( | long int | pendingSamples, |
| bool | lockIfOk | ||
| ) |
Determines if it is OK to send data.
| pendingSamples | Number of samples pending |
| lockIfOk | Whether or not to lock sending if sending is OK |
Definition at line 251 of file StatusReceiver.cpp.
|
virtualinherited |
Executes code that must run when an unhandled exception occurs within the thread.
The base-class method does nothing. Override this method in derived classes to perform custom exception processing.
| ex | The exception that occurred. |
Definition at line 110 of file Thread.cpp.
|
virtualinherited |
Executes code that must run when the thread is interrupted.
The base-class method does nothing. Override this method in derived classes to perform custom interrupt processing.
Definition at line 87 of file Thread.cpp.
|
virtualinherited |
Gets a "raw" string representation of a given data string.
"Raw" string representations mimic Python string representations. Whitespace characters are denoted by backslash representations ("\\r", "\\n", "\\t", "\\v", "\\f"), while other non-printable characters are represented with hex representation ("\\x00", etc.)
| data | Data string |
Definition at line 143 of file Debuggable.cpp.
| bool sentNSamples | ( | long int | samplesSent | ) |
Updates status based on the number of samples sent.
| samplesSent | Number of samples sent |
Definition at line 261 of file StatusReceiver.cpp.
|
virtualinherited |
Sets the class identifer string for the thread.
| cls | The new class identifer for the thread. |
Definition at line 82 of file Thread.cpp.
|
virtualinherited |
Sets the debug file pointer for this object.
| debug_fp | File to send debug output to. |
Definition at line 81 of file Debuggable.cpp.
|
virtualinherited |
Sets the debug name for this object.
Use this method to set unique debug names for objects of the same class for easy differentiation.
| debug_name | Name for identifying this object in debug output. |
Definition at line 74 of file Debuggable.cpp.
|
virtualinherited |
Sets the debug time format for this object.
| debug_timefmt | Format string for displaying timestamp, as compatible with strftime(). If this is an empty string, don't display a timestamp. |
Definition at line 88 of file Debuggable.cpp.
|
virtualinherited |
Sets the name of the thread.
| name | The new name of the thread. |
Definition at line 77 of file Thread.cpp.
| bool setStatusInterface | ( | std::string | ifname | ) |
Sets the interface name.
| ifname | Ethernet interface name |
Definition at line 113 of file StatusReceiver.cpp.
| bool setStatusInterface | ( | std::string | ifname, |
| bool | makeSocketFlag | ||
| ) |
Sets the interface name.
| ifname | Ethernet interface name |
| makeSocketFlag | Whether or not to create a UDP socket |
Definition at line 117 of file StatusReceiver.cpp.
| bool setStatusPort | ( | unsigned int | port | ) |
Sets the UDP port.
| port | UDP port |
Definition at line 126 of file StatusReceiver.cpp.
| bool setStatusPort | ( | unsigned int | port, |
| bool | makeSocketFlag | ||
| ) |
Sets the UDP port.
| port | UDP port |
| makeSocketFlag | Whether or not to create a UDP socket |
Definition at line 131 of file StatusReceiver.cpp.
|
virtualinherited |
Pauses thread execution for a given time, checking for user interrupts during that time.
The sleep timer has microsecond resolution.
| secs | Number of seconds to "sleep". |
Definition at line 65 of file Thread.cpp.