Began refactoring the entire source tree.
[aesalon.git] / include / monitor / program / SharedMemory.h
blob91ce1e52db296c24c3486e96bb7a802d81aeadd3
1 /**
2 Aesalon, a tool to visualize a program's behaviour at run-time.
3 Copyright (C) 2010, Aesalon Development Team.
5 Aesalon is distributed under the terms of the GNU GPLv3. For more
6 licensing information, see the file LICENSE included with the distribution.
8 @file include/monitor/program/SharedMemory.h
12 #ifndef AesalonMonitor_Program_SharedMemory_H
13 #define AesalonMonitor_Program_SharedMemory_H
15 #include <string>
16 #include <map>
18 #include "common/SharedMemoryHeader.h"
19 #include "common/ZoneHeader.h"
21 namespace Monitor {
22 namespace Program {
24 class SharedMemory {
25 private:
26 int m_fd;
27 std::string m_shmName;
29 SharedMemoryHeader_t *m_header;
31 uint8_t *m_zoneUseData;
33 typedef std::map<uint32_t, uint8_t *> ZoneMap;
34 ZoneMap m_zoneMap;
35 public:
36 SharedMemory();
37 ~SharedMemory();
39 uint32_t zoneCount() const;
40 uint8_t *zoneWithPacket();
42 void waitForPacket();
43 private:
44 uint8_t *zone(uint32_t id);
45 void setupHeader();
46 void setupConfiguration();
47 void setupZones();
50 } // namespace Program
51 } // namespace Monitor
53 #endif