ATLAS Offline Software
Loading...
Searching...
No Matches
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
15ServiceHandleBase ::
16ServiceHandleBase( 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
25void 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
46void ServiceHandleBase::setName(const std::string& name)
47{
48 m_name = name;
49}
50
51
52
53const std::string& ServiceHandleBase::typeAndName() const
54{
55 return m_typeAndName;
56}
57
58
59
60const std::string& ServiceHandleBase::type() const
61{
62 return m_type;
63}
64
65
66
67const std::string& ServiceHandleBase::name() const
68{
69 return m_name;
70}
71
72
73
74const std::string& ServiceHandleBase::parentName() const
75{
76 return m_parentName;
77}