The Gaudi Framework  v41r0 (bdbe7744)
Loading...
Searching...
No Matches
GaudiKernel.GaudiHandles.GaudiHandle Class Reference
Inheritance diagram for GaudiKernel.GaudiHandles.GaudiHandle:

Public Member Functions

 __init__ (self, typeAndName)
 __repr__ (self)
 __str__ (self)
 __opt_value__ (self)
 toStringProperty (self)
 getType (self)
 getName (self)
 getGaudiHandle (self)
 getFullName (self)
 __eq__ (self, other)

Public Attributes

 typeAndName = typeAndName

Static Public Attributes

str componentType = "Unspecified"
bool isPublic = True

Static Private Attributes

tuple __slots__ = ("typeAndName",)

Detailed Description

Definition at line 31 of file GaudiHandles.py.

Constructor & Destructor Documentation

◆ __init__()

GaudiKernel.GaudiHandles.GaudiHandle.__init__ ( self,
typeAndName )

Definition at line 37 of file GaudiHandles.py.

37 def __init__(self, typeAndName):
38 object.__init__(self)
39 if hasattr(typeAndName, "toStringProperty"):
40 # this is a GaudiHandle or equivalent
41 typeAndName = typeAndName.toStringProperty()
42 if not isinstance(typeAndName, str):
43 raise TypeError(
44 f"Argument to {self.__class__.__name__} must be a string. Got a {type(typeAndName).__name__} instead"
45 )
46 self.typeAndName = typeAndName
47

Member Function Documentation

◆ __eq__()

GaudiKernel.GaudiHandles.GaudiHandle.__eq__ ( self,
other )

Definition at line 93 of file GaudiHandles.py.

93 def __eq__(self, other):
94 return type(self) is type(other) and self.typeAndName == other.typeAndName
95
96

◆ __opt_value__()

GaudiKernel.GaudiHandles.GaudiHandle.__opt_value__ ( self)

Definition at line 56 of file GaudiHandles.py.

56 def __opt_value__(self):
57 return self.toStringProperty()
58

◆ __repr__()

GaudiKernel.GaudiHandles.GaudiHandle.__repr__ ( self)

Definition at line 48 of file GaudiHandles.py.

48 def __repr__(self):
49 return f"{self.__class__.__name__}({self.toStringProperty()!r})"
50

◆ __str__()

GaudiKernel.GaudiHandles.GaudiHandle.__str__ ( self)

Definition at line 51 of file GaudiHandles.py.

51 def __str__(self):
52 # FIXME: (Patch #1668) this creates problem with 2.5
53 # return "%s:%s" % (self.__class__.__name__, self.toStringProperty())
54 return self.toStringProperty()
55

◆ getFullName()

GaudiKernel.GaudiHandles.GaudiHandle.getFullName ( self)

Definition at line 90 of file GaudiHandles.py.

90 def getFullName(self):
91 return self.toStringProperty()
92

◆ getGaudiHandle()

GaudiKernel.GaudiHandles.GaudiHandle.getGaudiHandle ( self)

Definition at line 87 of file GaudiHandles.py.

87 def getGaudiHandle(self):
88 return self
89

◆ getName()

GaudiKernel.GaudiHandles.GaudiHandle.getName ( self)
Get the 'name' part of the \"type/name\" string.
If only a type is given, this will be returned as the name.
If the \"type/name\" string is empty, it will return an emtpy string.

Definition at line 75 of file GaudiHandles.py.

75 def getName(self):
76 """Get the 'name' part of the \"type/name\" string.
77 If only a type is given, this will be returned as the name.
78 If the \"type/name\" string is empty, it will return an emtpy string."""
79 slash = self.typeAndName.find("/")
80 if slash != -1:
81 # explicit name. Return part after the /
82 return self.typeAndName[slash + 1 :]
83 else:
84 # only type is given. return type as default name
85 return self.typeAndName
86

◆ getType()

GaudiKernel.GaudiHandles.GaudiHandle.getType ( self)
Get the 'type' part of the \"type/name\" string.

Definition at line 65 of file GaudiHandles.py.

65 def getType(self):
66 """Get the 'type' part of the \"type/name\" string."""
67 slash = self.typeAndName.find("/")
68 if slash != -1:
69 # includes name. Return part before /
70 return self.typeAndName[0:slash]
71 else:
72 # only type is given, return full string
73 return self.typeAndName
74

◆ toStringProperty()

GaudiKernel.GaudiHandles.GaudiHandle.toStringProperty ( self)

Definition at line 62 of file GaudiHandles.py.

62 def toStringProperty(self):
63 return self.typeAndName
64

Member Data Documentation

◆ __slots__

tuple GaudiKernel.GaudiHandles.GaudiHandle.__slots__ = ("typeAndName",)
staticprivate

Definition at line 35 of file GaudiHandles.py.

◆ componentType

str GaudiKernel.GaudiHandles.GaudiHandle.componentType = "Unspecified"
static

Definition at line 32 of file GaudiHandles.py.

◆ isPublic

bool GaudiKernel.GaudiHandles.GaudiHandle.isPublic = True
static

Definition at line 33 of file GaudiHandles.py.

◆ typeAndName

GaudiKernel.GaudiHandles.GaudiHandle.typeAndName = typeAndName

Definition at line 46 of file GaudiHandles.py.


The documentation for this class was generated from the following file: