PiImageStreamer
Loading...
Searching...
No Matches
StatusDisplay Class Reference

Prints connection and direction status reports from its queue to the console. More...

#include <StatusDisplay.h>

Inheritance diagram for StatusDisplay:
Collaboration diagram for StatusDisplay:

Public Member Functions

 StatusDisplay (std::string threadName)
 
virtual void run ()
 
- Public Member Functions inherited from SWE4211RPi::RunnableClass
 RunnableClass (std::string threadName, int priority=0)
 
virtual ~RunnableClass ()
 
virtual void resetThreadDiagnostics ()
 
virtual void printInformation ()
 
virtual double getCPUUsageInfo ()
 
virtual pid_t getThreadID ()
 
virtual void start () final
 
virtual void setPriority (int priority) final
 
virtual int getPriority () final
 
virtual bool isShutdown () final
 
virtual bool isStarted () final
 
virtual void stopThreadExecution ()
 
virtual void waitForShutdown ()
 

Private Member Functions

void processBroadcastMessage (SWE4211RPi::CommandQueueEntry commandToProcess)
 
void processStatusMessage (const SWE4211RPi::CommandQueueEntry &commandToProcess)
 
void handleHeartbeatMessage (const SWE4211RPi::CommandQueueEntry &commandToProcess)
 

Additional Inherited Members

- Static Public Member Functions inherited from SWE4211RPi::RunnableClass
static void printThreads ()
 
static void resetAllThreadInformation ()
 
- Protected Member Functions inherited from SWE4211RPi::RunnableClass
virtual void startChildRunnables ()
 
virtual void stopChildRunnables ()
 
- Protected Attributes inherited from SWE4211RPi::RunnableClass
std::thread * myThread = NULL
 
pthread_t executingThread = 0
 
pid_t myOSThreadID = 0
 
std::string myName
 
std::atomic< bool > keepGoing {true}
 
std::atomic< bool > runCompleted {false}
 
std::atomic< bool > runStarted {false}
 
int priority = -1
 
- Static Protected Attributes inherited from SWE4211RPi::RunnableClass
static std::list< RunnableClass * > runningThreads
 

Detailed Description

Prints connection and direction status reports from its queue to the console.

Constructor & Destructor Documentation

◆ StatusDisplay()

StatusDisplay::StatusDisplay ( std::string  threadName)

This is the default constructor. The status display reads from the ONBOARD_STATUS_DISPLAY_INTERNAL_QUEUE_ID queue.

Parameters
threadNameThis is the name of the thread that is running.

This is the default constructor.

Parameters
threadNameThis is the name of the thread that is running.

Member Function Documentation

◆ handleHeartbeatMessage()

void StatusDisplay::handleHeartbeatMessage ( const SWE4211RPi::CommandQueueEntry &  commandToProcess)
private

This private method will process and handle all heartbeat messages sent to this component.

Parameters
commandToProcessThis is the command that was received and is to be processed.

This private method will process and handle all heartbeat messages sent to this component. A ping request is answered by enqueuing a response on the heartbeat queue.

Parameters
commandToProcessThis is the command that was received and is to be processed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processBroadcastMessage()

void StatusDisplay::processBroadcastMessage ( SWE4211RPi::CommandQueueEntry  commandToProcess)
private

This private method will process and handle all broadcast messages sent to this component.

Parameters
commandToProcessThis is the command that was received and is to be processed.

This private method will process and handle all broadcast messages sent to this component. A shutdown command stops the thread.

Parameters
commandToProcessThis is the command that was received and is to be processed.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ processStatusMessage()

void StatusDisplay::processStatusMessage ( const SWE4211RPi::CommandQueueEntry &  commandToProcess)
private

This private method will process and handle all status messages sent to this component.

Parameters
commandToProcessThis is the command that was received and is to be processed.

This private method will process and handle all status messages sent to this component. Connection reports are printed as an IP address (or a disconnection notice), and direction reports are printed as the names of the direction bits that are set.

Parameters
commandToProcessThis is the command that was received and is to be processed.

If the parameter is not zero.

Separate out the ip address into its 4-tuple representation, each of which is an 8 bit unsigned value.

Print out that a connection has been obtained from the given IP address, showing each of the 4-tuples in an a.b.c.d format.

Otherwise, if the parameter is zero, indicate the network has been disconnected from.

Here is the caller graph for this function:

◆ run()

void StatusDisplay::run ( )
virtual

This is the run method. It blocks on the status display queue and processes each message until a shutdown broadcast is received.

1.0 Loop so long as the thread is to continue running (i.e. a call to stop on this class has not occurred.)

1.1.0 Dequeue the next command from the queue.

1.2.0 If the command is a broadcast message, process it. A shutdown command will shut down the thread.

1.3.0 Otherwise, if the command is a status report, process it. 1.4.0 Otherwise, if the command is a heartbeat message, process it.

Implements SWE4211RPi::RunnableClass.

Here is the call graph for this function:

The documentation for this class was generated from the following files: