![]() |
SLProject
4.3.020
A platform independent 3D computer graphics framework for desktop OS, Android, iOS and online in web browsers
|
#include <SENSRecorderDataHandler.h>
Public Member Functions | |
| SENSRecorderDataHandler (const std::string &name) | |
| virtual | ~SENSRecorderDataHandler () |
| void | start (const std::string &outputDir) |
| start the store thread More... | |
| void | stop () |
| stop the store thread and clear values in queue More... | |
| void | add (T &&item) |
| add new value to store queue More... | |
| bool | getErrorMsg (std::string &msg) |
| get error msg (valid if function returns true) More... | |
Protected Member Functions | |
| virtual void | writeOnThreadStart () |
| called in thread store routine when thread starts More... | |
| virtual void | writeHeaderToFile (ofstream &file) |
| called in thread store routine when file could be opened More... | |
| virtual void | writeLineToFile (ofstream &file, const T &data)=0 |
| called in thread store routine for every new line More... | |
| virtual void | writeOnThreadFinish () |
| called in thread store routine when thread finished More... | |
Protected Attributes | |
| std::string | _outputDir |
| output directory More... | |
Private Member Functions | |
| void | store () |
Private Attributes | |
| std::deque< T > | _queue |
| std::mutex | _mutex |
| std::condition_variable | _condVar |
| std::thread | _thread |
| bool | _stop = false |
| std::string | _name |
| std::mutex | _msgMutex |
| std::string | _errorMsg |
SENSRecorderDataHandler This class is meant to be used exclusively by the SENSRecorder class. The SENSRecorder listens to sensors and informs SENSRecorderDataHandler backends about new data. The SENSRecorderDataHandler stores values to file.
Definition at line 32 of file SENSRecorderDataHandler.h.
| SENSRecorderDataHandler< T >::SENSRecorderDataHandler | ( | const std::string & | name | ) |
Definition at line 5 of file SENSRecorderDataHandler.cpp.
|
virtual |
Definition at line 11 of file SENSRecorderDataHandler.cpp.
| void SENSRecorderDataHandler< T >::add | ( | T && | item | ) |
add new value to store queue
Definition at line 101 of file SENSRecorderDataHandler.cpp.
| bool SENSRecorderDataHandler< T >::getErrorMsg | ( | std::string & | msg | ) |
get error msg (valid if function returns true)
Definition at line 110 of file SENSRecorderDataHandler.cpp.
| void SENSRecorderDataHandler< T >::start | ( | const std::string & | outputDir | ) |
start the store thread
Definition at line 17 of file SENSRecorderDataHandler.cpp.
| void SENSRecorderDataHandler< T >::stop |
stop the store thread and clear values in queue
Definition at line 27 of file SENSRecorderDataHandler.cpp.
|
private |
Definition at line 43 of file SENSRecorderDataHandler.cpp.
|
inlineprotectedvirtual |
called in thread store routine when file could be opened
Definition at line 51 of file SENSRecorderDataHandler.h.
|
protectedpure virtual |
called in thread store routine for every new line
Implemented in SENSOrientationRecorderDataHandler, SENSGpsRecorderDataHandler, and SENSCameraRecorderDataHandler.
|
inlineprotectedvirtual |
called in thread store routine when thread finished
Reimplemented in SENSCameraRecorderDataHandler.
Definition at line 55 of file SENSRecorderDataHandler.h.
|
inlineprotectedvirtual |
called in thread store routine when thread starts
Reimplemented in SENSCameraRecorderDataHandler.
Definition at line 49 of file SENSRecorderDataHandler.h.
|
private |
Definition at line 68 of file SENSRecorderDataHandler.h.
|
private |
Definition at line 77 of file SENSRecorderDataHandler.h.
|
private |
Definition at line 76 of file SENSRecorderDataHandler.h.
|
private |
Definition at line 67 of file SENSRecorderDataHandler.h.
|
private |
Definition at line 74 of file SENSRecorderDataHandler.h.
|
protected |
output directory
Definition at line 58 of file SENSRecorderDataHandler.h.
|
private |
Definition at line 65 of file SENSRecorderDataHandler.h.
|
private |
Definition at line 72 of file SENSRecorderDataHandler.h.
|
private |
Definition at line 70 of file SENSRecorderDataHandler.h.