9#include <framework/core/MergeDataStoreModule.h>
10#include <framework/datastore/DataStore.h>
12#include <framework/core/Environment.h>
13#include <framework/core/InputController.h>
24 setDescription(
"Internal module used by Path.add_independent_merge_path(). This shouldn't appear in 'basf2 -m' output. If it does, check REG_MODULE() handling.");
26 addParam(
"toID",
m_to,
"active DataStore id after this module", std::string(
""));
28 "do you want to create a new (empty) DataStore 'toID'? This should be true only when toID refers to a _new_ DataStore ID",
false);
29 addParam(
"mergeBack",
m_mergeBack,
"copy the given objects/arrays over even if createNew is false.",
30 std::vector<std::string> {
"EventMetaData"});
33MergeDataStoreModule::~MergeDataStoreModule() =
default;
46 B2FATAL(
"identical from/to parameter value " <<
m_from);
48 B2FATAL(
"createNew is set for default DataStore ID! This would likely cause corruption.");
50 B2FATAL(
"createNew is not set ?");
void createEmptyDataStoreID(const std::string &id)
creates empty datastore with given id.
void copyEntriesTo(const std::string &id, const std::vector< std::string > &entrylist_event={}, bool mergeEntries=false)
copy entries (not contents) of current DataStore to the DataStore with given ID.
void switchID(const std::string &id)
switch to DataStore with given ID.
void mergeContentsTo(const std::string &id, const std::vector< std::string > &entrylist_event={})
merge contents (actual array / object contents) of current DataStore to the DataStore with given ID.
std::string currentID() const
returns ID of current DataStore.
static DataStore & Instance()
Instance of singleton Store.
MergeDataStoreModule()
Constructor.
std::string m_from
active DataStore ID before this module.
virtual void initialize() override
Initialize the Module.
virtual void event() override
This method is the core of the module.
virtual void terminate() override
This method is called at the end of the event processing.
std::vector< std::string > m_mergeBack
list of obj/arrays (of event durability) that should be merged with m_to.
std::string m_to
active DataStore ID after this module.
void init(const std::string &to, bool doCopy, const std::vector< std::string > &mergeBack)
setter for Path.
bool m_createNew
create new DataStore
void setDescription(const std::string &description)
Sets the description of the module.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
Abstract base class for different kinds of events.