MIDAS
Loading...
Searching...
No Matches
midas Namespace Reference

Classes

class  odb
 
class  u_odb
 

Enumerations

enum  odb_flags {
  AUTO_REFRESH_READ = 0 , AUTO_REFRESH_WRITE , PRESERVE_STRING_SIZE , AUTO_CREATE ,
  AUTO_ENLARGE_ARRAY , DIRTY , DELETED , WRITE_PROTECT ,
  TRIGGER_HOTLINK
}
 

Functions

void recurse_del_keys_not_in_defaults (std::string path, HNDLE hDB, HNDLE hKey, midas::odb &default_odb)
 
void recurse_get_defaults_order (std::string path, midas::odb &default_odb, std::map< std::string, std::vector< std::string > > &retval)
 
void recurse_fix_order (midas::odb &default_odb, std::map< std::string, std::vector< std::string > > &user_order)
 
template<typename T >
bool operator== (const midas::odb &o, const T &d)
 
template<typename T >
bool operator== (const T &d, const midas::odb &o)
 
template<typename T >
bool operator!= (const midas::odb &o, const T &d)
 
template<typename T >
bool operator!= (const T &d, const midas::odb &o)
 
template<typename T >
bool operator< (const midas::odb &o, const T &d)
 
template<typename T >
bool operator< (const T &d, const midas::odb &o)
 
template<typename T >
bool operator<= (const midas::odb &o, const T &d)
 
template<typename T >
bool operator<= (const T &d, const midas::odb &o)
 
template<typename T >
bool operator> (const midas::odb &o, const T &d)
 
template<typename T >
bool operator> (const T &d, const midas::odb &o)
 
template<typename T >
bool operator>= (const midas::odb &o, const T &d)
 
template<typename T >
bool operator>= (const T &d, const midas::odb &o)
 

Variables

std::vector< midas::odb * > g_watchlist = {}
 

Enumeration Type Documentation

◆ odb_flags

Enumerator
AUTO_REFRESH_READ 
AUTO_REFRESH_WRITE 
PRESERVE_STRING_SIZE 
AUTO_CREATE 
AUTO_ENLARGE_ARRAY 
DIRTY 
DELETED 
WRITE_PROTECT 
TRIGGER_HOTLINK 

Definition at line 391 of file odbxx.h.

391 {
397 DIRTY,
398 DELETED,
401 };
@ AUTO_REFRESH_WRITE
Definition odbxx.h:393
@ DIRTY
Definition odbxx.h:397
@ TRIGGER_HOTLINK
Definition odbxx.h:400
@ AUTO_REFRESH_READ
Definition odbxx.h:392
@ WRITE_PROTECT
Definition odbxx.h:399
@ AUTO_ENLARGE_ARRAY
Definition odbxx.h:396
@ AUTO_CREATE
Definition odbxx.h:395
@ PRESERVE_STRING_SIZE
Definition odbxx.h:394
@ DELETED
Definition odbxx.h:398

Function Documentation

◆ operator!=() [1/2]

template<typename T >
bool midas::operator!= ( const midas::odb o,
const T &  d 
)

Definition at line 1317 of file odbxx.h.

1317 {
1318 T v;
1319 midas::odb oc(o);
1320 oc.get(v);
1321 return v != d;
1322 }
TH1X EXPRT * h1_book(const char *name, const char *title, int bins, double min, double max)
Definition rmidas.h:24
double d
Definition system.cxx:1311

◆ operator!=() [2/2]

template<typename T >
bool midas::operator!= ( const T &  d,
const midas::odb o 
)

Definition at line 1325 of file odbxx.h.

1325 {
1326 T v;
1327 midas::odb oc(o);
1328 oc.get(v);
1329 return d != v;
1330 }

◆ operator<() [1/2]

template<typename T >
bool midas::operator< ( const midas::odb o,
const T &  d 
)

Definition at line 1333 of file odbxx.h.

1333 {
1334 T v;
1335 midas::odb oc(o);
1336 oc.get(v);
1337 return v < d;
1338 }

◆ operator<() [2/2]

template<typename T >
bool midas::operator< ( const T &  d,
const midas::odb o 
)

Definition at line 1341 of file odbxx.h.

1341 {
1342 T v;
1343 midas::odb oc(o);
1344 oc.get(v);
1345 return d < v;
1346 }

◆ operator<=() [1/2]

template<typename T >
bool midas::operator<= ( const midas::odb o,
const T &  d 
)

Definition at line 1349 of file odbxx.h.

1349 {
1350 T v;
1351 midas::odb oc(o);
1352 oc.get(v);
1353 return v <= d;
1354 }

◆ operator<=() [2/2]

template<typename T >
bool midas::operator<= ( const T &  d,
const midas::odb o 
)

Definition at line 1357 of file odbxx.h.

1357 {
1358 T v;
1359 midas::odb oc(o);
1360 oc.get(v);
1361 return d <= v;
1362 }

◆ operator==() [1/2]

template<typename T >
bool midas::operator== ( const midas::odb o,
const T &  d 
)

Definition at line 1299 of file odbxx.h.

1299 {
1300 // the operator needs a "const midas::odb" reference,
1301 // so we have to make a non-const copy
1302 T v;
1303 midas::odb oc(o);
1304 oc.get(v);
1305 return v == d;
1306 }

◆ operator==() [2/2]

template<typename T >
bool midas::operator== ( const T &  d,
const midas::odb o 
)

Definition at line 1309 of file odbxx.h.

1309 {
1310 T v;
1311 midas::odb oc(o);
1312 oc.get(v);
1313 return d == v;
1314 }

◆ operator>() [1/2]

template<typename T >
bool midas::operator> ( const midas::odb o,
const T &  d 
)

Definition at line 1365 of file odbxx.h.

1365 {
1366 T v;
1367 midas::odb oc(o);
1368 oc.get(v);
1369 return v > d;
1370 }

◆ operator>() [2/2]

template<typename T >
bool midas::operator> ( const T &  d,
const midas::odb o 
)

Definition at line 1373 of file odbxx.h.

1373 {
1374 T v;
1375 midas::odb oc(o);
1376 oc.get(v);
1377 return d > v;
1378 }

◆ operator>=() [1/2]

template<typename T >
bool midas::operator>= ( const midas::odb o,
const T &  d 
)

Definition at line 1381 of file odbxx.h.

1381 {
1382 T v;
1383 midas::odb oc(o);
1384 oc.get(v);
1385 return v >= d;
1386 }

◆ operator>=() [2/2]

template<typename T >
bool midas::operator>= ( const T &  d,
const midas::odb o 
)

Definition at line 1389 of file odbxx.h.

1389 {
1390 T v;
1391 midas::odb oc(o);
1392 oc.get(v);
1393 return d >= v;
1394 }

◆ recurse_del_keys_not_in_defaults()

void midas::recurse_del_keys_not_in_defaults ( std::string  path,
HNDLE  hDB,
HNDLE  hKey,
midas::odb default_odb 
)

Definition at line 1167 of file odbxx.cxx.

1167 {
1168 // Delete any subkeys that are not in the list of defaults.
1169 KEY key;
1170 db_get_key(hDB, hKey, &key);
1171
1172 if (key.type == TID_KEY) {
1173 std::vector<std::string> to_delete;
1174
1175 for (int i = 0;; i++) {
1176 HNDLE hSubKey;
1177 int status = db_enum_key(hDB, hKey, i, &hSubKey);
1178 if (status != DB_SUCCESS)
1179 break;
1180
1181 KEY subKey;
1183 std::string full_path = path + "/" + subKey.name;
1184
1185 if (!default_odb.is_subkey(subKey.name)) {
1186 to_delete.push_back(subKey.name);
1187
1188 if (default_odb.get_debug()) {
1189 std::cout << "Deleting " << full_path << " as not in list of defaults" << std::endl;
1190 }
1191 } else if (key.type == TID_KEY) {
1193 }
1194 }
1195
1196 for (auto name : to_delete) {
1197 HNDLE hSubKey;
1198 db_find_key(hDB, hKey, name.c_str(), &hSubKey);
1200 }
1201 }
1202 }
#define FALSE
Definition cfortran.h:309
#define DB_SUCCESS
Definition midas.h:631
#define TID_KEY
Definition midas.h:349
INT db_delete_key(HNDLE hDB, HNDLE hKey, BOOL follow_links)
Definition odb.cxx:3856
INT db_get_key(HNDLE hDB, HNDLE hKey, KEY *key)
Definition odb.cxx:6019
INT db_find_key(HNDLE hDB, HNDLE hKey, const char *key_name, HNDLE *subhKey)
Definition odb.cxx:4079
INT db_enum_key(HNDLE hDB, HNDLE hKey, INT idx, HNDLE *subkey_handle)
Definition odb.cxx:5586
HNDLE hKey
HNDLE hDB
main ODB handle
Definition mana.cxx:207
KEY key
Definition mdump.cxx:34
INT i
Definition mdump.cxx:32
INT HNDLE
Definition midas.h:132
#define name(x)
Definition midas_macro.h:24
void recurse_del_keys_not_in_defaults(std::string path, HNDLE hDB, HNDLE hKey, midas::odb &default_odb)
Definition odbxx.cxx:1167
DWORD status
Definition odbhist.cxx:39
Definition midas.h:1026
DWORD type
Definition midas.h:1027
Here is the call graph for this function:
Here is the caller graph for this function:

◆ recurse_fix_order()

void midas::recurse_fix_order ( midas::odb default_odb,
std::map< std::string, std::vector< std::string > > &  user_order 
)

Definition at line 1214 of file odbxx.cxx.

1214 {
1215 std::string path = default_odb.get_full_path();
1216
1217 if (user_order.find(path) != user_order.end()) {
1218 default_odb.fix_order(user_order[path]);
1219 }
1220
1221 for (midas::odb& it : default_odb) {
1222 if (it.get_tid() == TID_KEY) {
1223 recurse_fix_order(it, user_order);
1224 }
1225 }
1226 }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ recurse_get_defaults_order()

void midas::recurse_get_defaults_order ( std::string  path,
midas::odb default_odb,
std::map< std::string, std::vector< std::string > > &  retval 
)

Definition at line 1204 of file odbxx.cxx.

1204 {
1205 for (midas::odb& sub : default_odb) {
1206 if (sub.get_tid() == TID_KEY) {
1207 recurse_get_defaults_order(path + "/" + sub.get_name(), sub, retval);
1208 }
1209
1210 retval[path].push_back(sub.get_name());
1211 }
1212 }
void recurse_get_defaults_order(std::string path, midas::odb &default_odb, std::map< std::string, std::vector< std::string > > &retval)
Definition odbxx.cxx:1204
static double sub(double a, double b)
Definition tinyexpr.c:244
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ g_watchlist

std::vector<midas::odb *> midas::g_watchlist = {}

Definition at line 38 of file odbxx.cxx.

38{};