Line data Source code
1 : #include "DatabaseConfigurationInterface.h"
2 :
3 : #include <algorithm>
4 : #include <iterator>
5 :
6 : // #include "otsdaq-core/ConfigurationInterface/ConfigurationInterface.h"
7 :
8 : #include "ConfigurationInterface.h"
9 : #include "artdaq-database/ConfigurationDB/configurationdbifc.h"
10 :
11 : #include "artdaq-database/BasicTypes/basictypes.h"
12 : using artdaq::database::basictypes::JsonData;
13 :
14 : namespace artdaq {
15 : namespace database {
16 : namespace configuration {
17 :
18 : using ots::ConfigurationBase;
19 :
20 : template <>
21 : template <>
22 2738 : bool MakeSerializable<ConfigurationBase const*>::writeDocumentImpl<JsonData>(JsonData& data) const {
23 2738 : std::stringstream ss;
24 :
25 2738 : _conf->getView().printJSON(ss);
26 :
27 2738 : data.json_buffer = ss.str();
28 :
29 2738 : return true;
30 2738 : }
31 :
32 : template <>
33 4882 : std::string MakeSerializable<ConfigurationBase const*>::configurationNameImpl() const {
34 4882 : return _conf->getConfigurationName();
35 : }
36 :
37 : template <>
38 : template <>
39 2329 : bool MakeSerializable<ConfigurationBase*>::readDocumentImpl<JsonData>(JsonData const& data) {
40 2329 : int retVal = _conf->getViewP()->fillFromJSON(data);
41 :
42 2330 : return (retVal >= 0);
43 : }
44 :
45 : template <>
46 2336 : std::string MakeSerializable<ConfigurationBase*>::configurationNameImpl() const {
47 2336 : return _conf->getConfigurationName();
48 : }
49 :
50 : } // namespace configuration
51 : } // namespace database
52 : } // namespace artdaq
|