DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
NamedObject.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 #ifndef DD4HEP_NAMEDOBJECT_H
14 #define DD4HEP_NAMEDOBJECT_H
15 
16 // C/C++ include files
17 #include <string>
18 
20 namespace dd4hep {
21 
23 
30  class NamedObject {
31  public:
33  std::string name;
35  std::string type;
36 
38  NamedObject(const char* nam, const char* typ="");
40  NamedObject(const std::string& nam);
42  NamedObject(const std::string& nam, const std::string& typ);
43 
45  NamedObject() = default;
47  NamedObject(const NamedObject& c) = default;
49  NamedObject(NamedObject&& c) = default;
50 
52  virtual ~NamedObject() = default;
54  NamedObject& operator=(const NamedObject& c) = default;
58  const char* GetName() const {
59  return name.c_str();
60  }
62  void SetName(const char* nam) {
63  name = nam;
64  }
66  void SetTitle(const char* tit) {
67  type = tit;
68  }
70  const char* GetTitle() const {
71  return type.c_str();
72  }
73  };
74 
75 } /* End namespace dd4hep */
76 #endif // DD4HEP_NAMEDOBJECT_H
dd4hep::NamedObject::operator=
NamedObject & operator=(const NamedObject &c)=default
Assignment operator.
dd4hep::NamedObject::GetName
const char * GetName() const
Access name.
Definition: NamedObject.h:58
dd4hep::NamedObject::SetName
void SetName(const char *nam)
Set name (used by Handle)
Definition: NamedObject.h:62
dd4hep::NamedObject::NamedObject
NamedObject(NamedObject &&c)=default
Move constructor.
dd4hep::NamedObject::~NamedObject
virtual ~NamedObject()=default
Default destructor.
dd4hep::NamedObject::NamedObject
NamedObject()=default
Standard constructor.
dd4hep::NamedObject::SetTitle
void SetTitle(const char *tit)
Set Title (used by Handle)
Definition: NamedObject.h:66
dd4hep::NamedObject::GetTitle
const char * GetTitle() const
Get name (used by Handle)
Definition: NamedObject.h:70
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::NamedObject
Implementation of a named object.
Definition: NamedObject.h:30
dd4hep::NamedObject::name
std::string name
The object name.
Definition: NamedObject.h:33
dd4hep::NamedObject::type
std::string type
The object type.
Definition: NamedObject.h:35
dd4hep::NamedObject::operator=
NamedObject & operator=(NamedObject &&c)=default
Move assignment operator.
dd4hep::NamedObject::NamedObject
NamedObject(const NamedObject &c)=default
Copy constructor.