-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update output modules, first surface output draft
- Loading branch information
1 parent
4234d62
commit ae0e8f5
Showing
8 changed files
with
142 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#pragma once | ||
|
||
#include "Data.hpp" | ||
#include "Instruction.hpp" | ||
#include <memory> | ||
#include <string> | ||
#include <yaml-cpp/yaml.h> | ||
|
||
namespace seissol::io::writer::instructions { | ||
|
||
struct BinaryWrite : public WriteInstruction { | ||
std::string filename; | ||
std::shared_ptr<writer::DataSource> dataSource; | ||
|
||
YAML::Node serialize() override { | ||
YAML::Node node; | ||
node["file"] = filename; | ||
node["source"] = dataSource->serialize(); | ||
node["writer"] = "binary"; | ||
return node; | ||
} | ||
|
||
BinaryWrite(const std::string& filename, std::shared_ptr<writer::DataSource> dataSource) | ||
: filename(filename), dataSource(dataSource) {} | ||
|
||
explicit BinaryWrite(YAML::Node node) | ||
: filename(node["filename"].as<std::string>()), | ||
dataSource(writer::DataSource::deserialize(node["source"])) {} | ||
|
||
std::vector<std::shared_ptr<DataSource>> dataSources() override { return {dataSource}; } | ||
}; | ||
|
||
} // namespace seissol::io::writer::instructions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters