The Sparta Modeling Framework
Loading...
Searching...
No Matches
StreamController.hpp
1// <StreamController> -*- C++ -*-
2
3#pragma once
4
5namespace sparta {
6namespace statistics {
7
15{
16public:
17 virtual ~StreamController() {}
18
22 if (!is_streaming_) {
23 startStreaming_();
24 is_streaming_ = true;
25 }
26 }
27
34 if (!is_streaming_) {
35 startStreaming_();
36 }
37 processStreams_();
38 }
39
44 if (is_streaming_) {
45 processStreams_();
46 stopStreaming_();
47 is_streaming_ = false;
48 }
49 }
50
51private:
55 bool is_streaming_ = false;
56
58 virtual void startStreaming_() = 0;
59 virtual void processStreams_() = 0;
60 virtual void stopStreaming_() = 0;
61};
62
63} // namespace statistics
64} // namespace sparta
65
Stream controller interface. One of these objects will be shared between the simulation's run control...
Macros for handling exponential backoff.