The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
GaudiConfig2._db Namespace Reference

Classes

class  ConfDB2
 
class  ConfigurablesDB
 

Functions

 _normalize_cpp_type_name (name)
 
 split_namespace (typename)
 

Variables

 _DB = ConfDB2()
 
 _TRANS_TABLE = str.maketrans("<>&*,: ().", "__rp__s___")
 

Function Documentation

◆ _normalize_cpp_type_name()

GaudiConfig2._db._normalize_cpp_type_name ( name)
protected
Translate a C++ type name (with templates etc.) to Python identifier.

Definition at line 64 of file _db.py.

64def _normalize_cpp_type_name(name):
65 """
66 Translate a C++ type name (with templates etc.) to Python identifier.
67 """
68 return name.replace(", ", ",").translate(_TRANS_TABLE)
69
70

◆ split_namespace()

GaudiConfig2._db.split_namespace ( typename)
Split a C++ qualified namespace in the tuple (top_namespace, rest) starting
searching the separator from pos.

>>> split_namespace('std::chrono::time_point')
('std', 'chrono::time_point')

Definition at line 71 of file _db.py.

71def split_namespace(typename):
72 """
73 Split a C++ qualified namespace in the tuple (top_namespace, rest) starting
74 searching the separator from pos.
75
76 >>> split_namespace('std::chrono::time_point')
77 ('std', 'chrono::time_point')
78 """
79 # find next namespace separator skipping template arguments
80 tpos = typename.find("<")
81 pos = typename.find("::")
82 # '<' can appear only in a class name, if we find a '::'
83 # earlier than a '<', then we got a namespace, else a class
84 if pos > 0 and (tpos < 0 or pos < tpos):
85 head = typename[:pos]
86 tail = typename[pos + 2 :]
87 else:
88 head = None
89 tail = typename
90 return (head, tail)
91
92

Variable Documentation

◆ _DB

GaudiConfig2._db._DB = ConfDB2()
protected

Definition at line 58 of file _db.py.

◆ _TRANS_TABLE

GaudiConfig2._db._TRANS_TABLE = str.maketrans("<>&*,: ().", "__rp__s___")
protected

Definition at line 61 of file _db.py.