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 393 of file odbxx.h.

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

Function Documentation

◆ operator!=() [1/2]

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

Definition at line 1461 of file odbxx.h.

1461 {
1462 T v;
1463 midas::odb oc(o);
1464 oc.get(v);
1465 return v != d;
1466 }
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 1469 of file odbxx.h.

1469 {
1470 T v;
1471 midas::odb oc(o);
1472 oc.get(v);
1473 return d != v;
1474 }

◆ operator<() [1/2]

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

Definition at line 1477 of file odbxx.h.

1477 {
1478 T v;
1479 midas::odb oc(o);
1480 oc.get(v);
1481 return v < d;
1482 }

◆ operator<() [2/2]

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

Definition at line 1485 of file odbxx.h.

1485 {
1486 T v;
1487 midas::odb oc(o);
1488 oc.get(v);
1489 return d < v;
1490 }

◆ operator<=() [1/2]

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

Definition at line 1493 of file odbxx.h.

1493 {
1494 T v;
1495 midas::odb oc(o);
1496 oc.get(v);
1497 return v <= d;
1498 }

◆ operator<=() [2/2]

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

Definition at line 1501 of file odbxx.h.

1501 {
1502 T v;
1503 midas::odb oc(o);
1504 oc.get(v);
1505 return d <= v;
1506 }

◆ operator==() [1/2]

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

Definition at line 1443 of file odbxx.h.

1443 {
1444 // the operator needs a "const midas::odb" reference,
1445 // so we have to make a non-const copy
1446 T v;
1447 midas::odb oc(o);
1448 oc.get(v);
1449 return v == d;
1450 }

◆ operator==() [2/2]

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

Definition at line 1453 of file odbxx.h.

1453 {
1454 T v;
1455 midas::odb oc(o);
1456 oc.get(v);
1457 return d == v;
1458 }

◆ operator>() [1/2]

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

Definition at line 1509 of file odbxx.h.

1509 {
1510 T v;
1511 midas::odb oc(o);
1512 oc.get(v);
1513 return v > d;
1514 }

◆ operator>() [2/2]

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

Definition at line 1517 of file odbxx.h.

1517 {
1518 T v;
1519 midas::odb oc(o);
1520 oc.get(v);
1521 return d > v;
1522 }

◆ operator>=() [1/2]

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

Definition at line 1525 of file odbxx.h.

1525 {
1526 T v;
1527 midas::odb oc(o);
1528 oc.get(v);
1529 return v >= d;
1530 }

◆ operator>=() [2/2]

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

Definition at line 1533 of file odbxx.h.

1533 {
1534 T v;
1535 midas::odb oc(o);
1536 oc.get(v);
1537 return d >= v;
1538 }

◆ 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 1234 of file odbxx.cxx.

1234 {
1235 // Delete any subkeys that are not in the list of defaults.
1236 KEY key;
1237 db_get_key(hDB, hKey, &key);
1238
1239 if (key.type == TID_KEY) {
1240 std::vector<std::string> to_delete;
1241
1242 for (int i = 0;; i++) {
1243 HNDLE hSubKey;
1244 int status = db_enum_key(hDB, hKey, i, &hSubKey);
1245 if (status != DB_SUCCESS)
1246 break;
1247
1248 KEY subKey;
1250 std::string full_path = path + "/" + subKey.name;
1251
1252 if (!default_odb.is_subkey(subKey.name)) {
1253 to_delete.push_back(subKey.name);
1254
1255 if (default_odb.get_debug()) {
1256 std::cout << "Deleting " << full_path << " as not in list of defaults" << std::endl;
1257 }
1258 } else if (key.type == TID_KEY) {
1260 }
1261 }
1262
1263 for (auto name : to_delete) {
1264 HNDLE hSubKey;
1265 db_find_key(hDB, hKey, name.c_str(), &hSubKey);
1267 }
1268 }
1269 }
#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:1234
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 1281 of file odbxx.cxx.

1281 {
1282 std::string path = default_odb.get_full_path();
1283
1284 if (user_order.find(path) != user_order.end()) {
1285 default_odb.fix_order(user_order[path]);
1286 }
1287
1288 for (midas::odb& it : default_odb) {
1289 if (it.get_tid() == TID_KEY) {
1290 recurse_fix_order(it, user_order);
1291 }
1292 }
1293 }
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 1271 of file odbxx.cxx.

1271 {
1272 for (midas::odb& sub : default_odb) {
1273 if (sub.get_tid() == TID_KEY) {
1274 recurse_get_defaults_order(path + "/" + sub.get_name(), sub, retval);
1275 }
1276
1277 retval[path].push_back(sub.get_name());
1278 }
1279 }
void recurse_get_defaults_order(std::string path, midas::odb &default_odb, std::map< std::string, std::vector< std::string > > &retval)
Definition odbxx.cxx:1271
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 40 of file odbxx.cxx.

40{};