Decision time again, as per usual . . .
[aesalon.git] / include / monitor / SHMReader.h
blob740533372ce2dcc92e84a4adfdcd47a5876fd595
1 /** Aesalon, a tool to visualize program behaviour in real time.
2 Copyright (C) 2009-2011, Aesalon development team.
4 Aesalon is distributed under the terms of the GNU GPLv3. See
5 the included file LICENSE for more information.
7 @file include/monitor/SHMReader.h
8 */
10 #ifndef AesalonMonitor_SHMReader_H
11 #define AesalonMonitor_SHMReader_H
13 #include <stdint.h>
15 #include <string>
16 #include <vector>
18 #include "shm/Header.h"
20 namespace Monitor {
22 class SHMReader {
23 private:
24 int m_fd;
25 std::string m_shmName;
27 SHM::Header *m_header;
29 uint8_t *m_zoneUseData;
31 typedef std::vector<uint8_t *> ZoneList;
32 ZoneList m_zoneList;
33 public:
34 SHMReader();
35 ~SHMReader();
37 uint32_t zoneCount();
38 int32_t zoneWithData();
40 void waitForPacket();
42 void readData(uint32_t zoneID, void *buffer, uint32_t size);
43 private:
44 uint8_t *getZone(uint32_t id);
45 void *mapRegion(uint32_t start, uint32_t size);
46 void unmapRegion(void *data, uint32_t size);
47 void setupHeader();
48 void setupConfiguration();
49 void setupZones();
52 } // namespace Monitor
54 #endif