|
PiImageStreamer
|


Public Member Functions | |
| NetworkTransmissionManager (NetworkManager &associatedReceptionManager, std::string threadName) | |
| virtual | ~NetworkTransmissionManager () |
| void | enqueueMessage (networkMessageStruct &itemToEnqueue) |
| void | stopThreadExecution () |
| 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 | waitForShutdown () |
Private Attributes | |
| NetworkManager & | associatedReceptionManager |
| std::queue< networkMessageStruct > | transmissionQueue |
| sem_t | queueCountSemaphore |
| std::mutex | queueMutex |
| std::atomic_int_fast32_t | mcount = {0} |
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 |
| NetworkTransmissionManager::NetworkTransmissionManager | ( | NetworkManager & | associatedReceptionManager, |
| std::string | threadName | ||
| ) |
Initialize the semaphore to be a counting sem with nothing on it.
|
virtual |
Nothing is needed here for now, as there is nothing dynamically created that we need to clean up afterwards.
| void NetworkTransmissionManager::enqueueMessage | ( | networkMessageStruct & | itemToEnqueue | ) |
Lock the queue.
Place the given item on the end of the queue.
Indicate that something has been enqueued through the semaphore.

|
virtual |
This is the virtual run method. It will execute the given code that is to be executed by this class.
While the thread is to keep running.
115
Block if there is nothing on the queue until something is enqueued.
Lock the queue and dequeue an item from it.
Obtain the first item from the queue and then dispose of it.
Set the security mode to 0 and the id to the message count. Then increment message count.
Set the timestamp for the message.
Implements SWE4211RPi::RunnableClass.

|
virtual |
This method will override the default stop method. In doing so, it must call the base class's stop method prior to invoking it's own logic.
Call the parent's stop method.
Reimplemented from SWE4211RPi::RunnableClass.

|
private |
This keeps track of how many messages have been sent. It is the message count.
|
private |
This is a counting semaphore which keeps track of how many items are on the queue.
|
private |
This is a mutex for the class which is used to lock critical sections in different methods.