Belle II Software development
DBObjectLoader.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8#ifndef _Belle2_DBObjectLoader_h
9#define _Belle2_DBObjectLoader_h
10
11#include <daq/slc/database/DBObject.h>
12#include <daq/slc/database/DBInterface.h>
13
14#include <daq/slc/system/Mutex.h>
15
16#include <daq/slc/base/StringUtil.h>
17#include <daq/slc/base/ConfigFile.h>
18
19namespace Belle2 {
26
27 public:
28 static DBObject load(const std::string& filename);
29 static DBObject load(ConfigFile& config);
30 static DBObject load(DBInterface& db,
31 const std::string& tablename,
32 const std::string& configname,
33 bool isfull = true);
34 static bool createDB(DBInterface& db,
35 const std::string& tablename,
36 const DBObject& obj);
37 static StringList getDBlist(DBInterface& db,
38 const std::string& tablename,
39 const std::string& prefix,
40 int max = -1);
41
42 private:
43 static bool setObject(DBObject& obj, StringList& str,
44 DBField::Type type, const std::string& value,
45 const std::string& table_in = "",
46 const std::string& config_in = "",
47 DBInterface* db = NULL);
48 static bool add(DBObject& obj, StringList& str,
49 const std::string& name_in, const DBObject& cobj);
50
51
52 static Mutex m_mutex;
53
54 };
55
57}
58
59#endif
Abstract base class for different kinds of events.