LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
file_mfPlugin.cc
Go to the documentation of this file.
1 // vim: set sw=2 expandtab :
2 
3 #include "private/FileConfig.h"
4 
6 
7 #include "cetlib/ostream_handle.h"
12 
13 #include <fstream>
14 #include <memory>
15 
16 using namespace std;
17 using cet::ostream_handle;
18 using namespace mf::service;
19 
20 namespace mf {
21 
23  struct Config {
26  };
27 
29  };
30 
31 } // namespace mf
32 
33 namespace {
34 
35  auto
36  makePlugin_(mf::file_mfPluginConfig::Parameters const& ps)
37  {
38  ostream_handle osh{ps().file_config().filename(),
39  ps().file_config().append() ? ios::app : ios::trunc};
40  return make_unique<ELostreamOutput>(ps().ostream_dest(), std::move(osh));
41  }
42 
43 } // unnamed namespace
44 
46 {
47  return makePlugin_(pset);
48 }
49 MAKE_PLUGIN_END
50 
STL namespace.
fhicl::TableFragment< priv::FileConfig > file_config
MAKE_MFPLUGIN_START(, pset)
fhicl::TableFragment< ELostreamOutput::Config > ostream_dest
#define FHICL_PROVIDE_ALLOWED_CONFIGURATION(klass)