8#ifndef _Belle2_DBObject_hh
9#define _Belle2_DBObject_hh
11#include <daq/slc/base/AbstractDBObject.h>
12#include <daq/slc/base/StringUtil.h>
13#include <daq/slc/base/Date.h>
24 typedef std::vector<DBObject> DBObjectList;
25 typedef std::map<std::string, void*> FieldValueList;
26 typedef std::map<std::string, std::string> FieldTextList;
27 typedef std::map<std::string, DBObjectList> FieldObjectList;
36 typedef std::vector<NameValue> NameValueList;
46 int getNObjects(
const std::string& name)
const;
47 DBObjectList& getObjects(
const std::string& name);
48 const DBObjectList& getObjects(
const std::string& name)
const;
49 DBObject& getObject(
const std::string& name,
int i = 0);
50 const DBObject& getObject(
const std::string& name,
int i = 0)
const;
51 void addObjects(
const std::string& name,
const DBObjectList& obj);
52 void addObject(
const std::string& name,
const DBObject& obj);
55 DBObject& operator()(
const std::string& name,
int index = 0)
57 return getObject(name, index);
59 const DBObject& operator()(
const std::string& name,
int index = 0)
const
61 return getObject(name, index);
65 StringList getNameList(
bool isfull)
const;
66 void print(
bool isfull =
true)
const;
67 const std::string sprint(
bool isfull)
const;
68 void printHTML(
bool isfull =
true)
const;
69 const std::string printSQL(
const std::string& table,
int id)
const;
70 void search(NameValueList& map,
const std::string& name =
"",
bool isfull =
true)
const;
71 int getDate()
const {
return m_date; }
72 void setDate(
const Date& date) { m_date = date.get(); }
73 void setDate(
int date) { m_date = date; }
76 const void* getValue(
const std::string& name)
const override;
77 const std::string& getText(
const std::string& name)
const override;
78 void addText(
const std::string& name,
const std::string& value)
override;
79 void addValue(
const std::string& name,
const void* value,
80 DBField::Type type,
int length)
override;
81 void setValue(
const std::string& name,
const void* value,
int length)
override;
84 void readObject(Reader& reader)
override;
85 void writeObject(Writer& writer)
const override;
88 FieldValueList m_value_m;
89 FieldTextList m_text_m;
90 FieldObjectList m_obj_v_m;
95 void reset()
override;
98 void copy(
const DBObject& obj);
102 typedef std::vector<DBObject> DBObjectList;
Abstract base class for different kinds of events.