The Sparta Modeling Framework
Loading...
Searching...
No Matches
ArchiveController.hpp
1// <ArchiveController> -*- C++ -*-
2
3#pragma once
4
5#include <string>
6
7namespace sparta {
8namespace statistics {
9
10class ReportStatisticsArchive;
11
18{
19public:
20 virtual ~ArchiveController() {}
21
29 virtual bool synchronize() = 0;
30
37 virtual void saveTo(const std::string & dir) = 0;
38};
39
45{
46public:
48 live_archive_(live_archive)
49 {}
50
54 bool synchronize() override;
55
58 void saveTo(const std::string & dir) override;
59
60private:
61 ReportStatisticsArchive * live_archive_ = nullptr;
62};
63
69{
70public:
71 explicit OfflineArchiveController(const std::string & source_archive_dir) :
72 source_archive_dir_(source_archive_dir)
73 {}
74
77 bool synchronize() override;
78
81 void saveTo(const std::string & dir) override;
82
83private:
84 std::string source_archive_dir_;
85};
86
87} // namespace statistics
88} // namespace sparta
89
Base class used by the RootArchiveNode to have some control over its data source, whether it is a liv...
virtual void saveTo(const std::string &dir)=0
Controller used when SPARTA simulations are directly feeding data into a tempdir archive.
void saveTo(const std::string &dir) override
Controller used when attaching to an archive outside of any live simulation.
void saveTo(const std::string &dir) override
This class coordinates live SPARTA simulations (source) with binary output archives (sink).
Macros for handling exponential backoff.