The Gaudi Framework  master (41389df7)
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 65 of file _db.py.

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

◆ 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 72 of file _db.py.

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

Variable Documentation

◆ _DB

GaudiConfig2._db._DB = ConfDB2()
protected

Definition at line 59 of file _db.py.

◆ _TRANS_TABLE

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

Definition at line 62 of file _db.py.