ATLAS Offline Software
ServiceHandle.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
8 
9 
10 
11 // Local include(s):
14 
15 ServiceHandleBase ::
16 ServiceHandleBase( const std::string& typeAndName,
17  const std::string& parentName )
18  : m_typeAndName( typeAndName ), m_type(), m_name(), m_parentName(parentName)
19 {
20  setTypeAndName(typeAndName);
21 }
22 
23 
24 
25 void ServiceHandleBase::setTypeAndName(const std::string& typeAndName)
26 {
27  m_typeAndName = typeAndName;
28  // Decode the received string:
29  size_t pos = 0;
30  if( ( pos = m_typeAndName.find( '/' ) ) == std::string::npos )
31  {
32  // The user specified a single string, which is used as both the type
33  // and instance name.
34  m_type = m_typeAndName;
35  m_name = m_typeAndName;
36  } else
37  {
38  // The user specified both a type and an instance name.
39  m_type = m_typeAndName.substr( 0, pos );
40  m_name = m_typeAndName.substr( pos + 1 );
41  }
42 }
43 
44 
45 
46 void ServiceHandleBase::setName(const std::string& name)
47 {
48  m_name = name;
49 }
50 
51 
52 
53 const std::string& ServiceHandleBase::typeAndName() const
54 {
55  return m_typeAndName;
56 }
57 
58 
59 
60 const std::string& ServiceHandleBase::type() const
61 {
62  return m_type;
63 }
64 
65 
66 
67 const std::string& ServiceHandleBase::name() const
68 {
69  return m_name;
70 }
71 
72 
73 
74 const std::string& ServiceHandleBase::parentName() const
75 {
76  return m_parentName;
77 }
m_type
TokenType m_type
the type
Definition: TProperty.cxx:44
IAsgService.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ServiceHandle.h
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.TrigTLAMonitorAlgorithm.parentName
parentName
Definition: TrigTLAMonitorAlgorithm.py:192