The Sparta Modeling Framework
Loading...
Searching...
No Matches
ArchiveSink.hpp
1// <ArchiveSink> -*- C++ -*-
2
3#pragma once
4
5#include "sparta/statistics/dispatch/archives/ArchiveStream.hpp"
6
7#include <memory>
8#include <vector>
9
10namespace sparta {
11namespace statistics {
12
13class RootArchiveNode;
14
19{
20public:
21 void setRoot(const std::shared_ptr<RootArchiveNode> & root) {
22 root_ = root;
23 }
24
25 virtual void copyMetadataFrom(const ArchiveStream * stream) = 0;
26
27 virtual void sendToSink(const std::vector<double> & values) = 0;
28
29 virtual void flush() = 0;
30
31protected:
32 RootArchiveNode * getRoot_() {
33 return root_.get();
34 }
35
36 const RootArchiveNode * getRoot_() const {
37 return root_.get();
38 }
39
40private:
41 std::shared_ptr<RootArchiveNode> root_;
42};
43
44} // namespace statistics
45} // namespace sparta
46
Generic statistic sink base class for report archives.
Generic statistic stream base class for sources and sinks in the report archive system.
There is one of these root node objects at the top of each report's archive. The hierarchy looks like...
Macros for handling exponential backoff.