Changeset View
Changeset View
Standalone View
Standalone View
plugins/process/network/helper/Accumulator.h
Show All 18 Lines | |||||
19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | #ifndef ACCUMULATOR_H | 22 | #ifndef ACCUMULATOR_H | ||
23 | #define ACCUMULATOR_H | 23 | #define ACCUMULATOR_H | ||
24 | 24 | | |||
25 | #include <memory> | 25 | #include <memory> | ||
26 | #include <thread> | 26 | #include <thread> | ||
27 | #include <mutex> | ||||
27 | #include <atomic> | 28 | #include <atomic> | ||
28 | #include <unordered_map> | 29 | #include <unordered_map> | ||
29 | 30 | | |||
30 | #include "TimeStamps.h" | 31 | #include "TimeStamps.h" | ||
31 | #include "Packet.h" | 32 | #include "Packet.h" | ||
32 | 33 | | |||
33 | class Capture; | 34 | class Capture; | ||
34 | class ConnectionMapping; | 35 | class ConnectionMapping; | ||
Show All 16 Lines | 51 | private: | |||
51 | void addData(Packet::Direction direction, const Packet &packet, int pid); | 52 | void addData(Packet::Direction direction, const Packet &packet, int pid); | ||
52 | void loop(); | 53 | void loop(); | ||
53 | 54 | | |||
54 | std::shared_ptr<Capture> m_capture; | 55 | std::shared_ptr<Capture> m_capture; | ||
55 | std::shared_ptr<ConnectionMapping> m_mapping; | 56 | std::shared_ptr<ConnectionMapping> m_mapping; | ||
56 | 57 | | |||
57 | std::thread m_thread; | 58 | std::thread m_thread; | ||
58 | std::atomic_bool m_running; | 59 | std::atomic_bool m_running; | ||
60 | std::mutex m_mutex; | ||||
59 | 61 | | |||
60 | PidDataCounterHash m_data; | 62 | PidDataCounterHash m_data; | ||
61 | }; | 63 | }; | ||
62 | 64 | | |||
63 | #endif // ACCUMULATOR_H | 65 | #endif // ACCUMULATOR_H |