manager.hpp
Go to the documentation of this file.
1 //
2 // manager.hpp
3 //
4 
5 #ifndef MANAGER_HPP
6 #define MANAGER_HPP
7 
8 #include "BasicDatatypes.hpp"
9 #include "tools/SickThread.hpp"
11 #include "devices/BasicDevice.hpp"
13 #include <vector> // for std::vector
14 
15 //
16 // The Manager.
17 //
18 class Manager
19 {
20 public:
22  Manager();
23 
25  ~Manager();
26 
27  bool addApplication(Sourcetype appType, std::string appName, UINT16 wantedId = 0xFFFF);
28  bool addApplication(application::BasicApplication* app, UINT16 wantedId = 0xFFFF);
29  bool addAndRunDevice(Sourcetype deviceType, std::string deviceName, UINT16 wantedId = 0xFFFF);
30  bool addAndRunDevice(devices::BasicDevice* device, std::string deviceName, UINT16 wantedId = 0xFFFF);
31  bool importApplications();
32  bool runAllDevices();
33  void stopAllDevices();
34  void setDeviceData(BasicData* data); // Datenquelle: Hier laden die Devices ihre Daten ab
37 
38 private:
41  UINT16 m_nextSourceId; // Die als naechstes verwendete ID
42 
43  // Die Devices
44  typedef std::vector<devices::BasicDevice*> DeviceList;
45  DeviceList m_deviceList;
46 
47  // The applications
48  typedef std::vector<application::BasicApplication*> ApplicationList;
49  ApplicationList m_appList;
50 
51  // The buffer of the source
53  void sourceThreadFunction(bool& endThread, UINT16& waitTimeMs); // Die Verteiler-Funktion
55  Mutex m_sourceBufferMutex; // Zugriffsschutz des Source-Buffers
56 };
57 
58 
59 #endif // #ifndef MANAGER_HPP
void sourceThreadFunction(bool &endThread, UINT16 &waitTimeMs)
Definition: manager.cpp:333
bool m_beVerbose
Definition: manager.hpp:39
uint16_t UINT16
~Manager()
Destructor.
Definition: manager.cpp:41
Mutex m_sourceBufferMutex
Definition: manager.hpp:55
devices::BasicDevice * getFirstDeviceByType(Sourcetype type)
Definition: manager.cpp:412
bool addAndRunDevice(Sourcetype deviceType, std::string deviceName, UINT16 wantedId=0xFFFF)
Definition: manager.cpp:91
void stopAllDevices()
Definition: manager.cpp:268
uint32_t UINT32
Definition: Mutex.hpp:16
std::vector< application::BasicApplication * > ApplicationList
Definition: manager.hpp:48
bool addApplication(Sourcetype appType, std::string appName, UINT16 wantedId=0xFFFF)
Definition: manager.cpp:178
SickThread< Manager,&Manager::sourceThreadFunction > m_sourceThread
Definition: manager.hpp:54
Sourcetype
DeviceList m_deviceList
Definition: manager.hpp:45
BasicDataBuffer m_sourceBuffer
Definition: manager.hpp:52
Manager()
Default constructor.
Definition: manager.cpp:25
std::vector< devices::BasicDevice * > DeviceList
Definition: manager.hpp:44
devices::BasicDevice * getDeviceById(UINT32 id)
Definition: manager.cpp:392
UINT16 m_nextSourceId
Definition: manager.hpp:41
UINT16 getNextSourceId()
Definition: manager.cpp:73
bool importApplications()
bool runAllDevices()
Definition: manager.cpp:240
ApplicationList m_appList
Definition: manager.hpp:49
void setDeviceData(BasicData *data)
Definition: manager.cpp:291


libsick_ldmrs
Author(s): SICK AG , Martin Günther , Jochen Sprickerhof
autogenerated on Sat Jun 8 2019 17:57:33