DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
NamedObject.hpp
Go to the documentation of this file.
1
9#ifndef UTILITIES_INCLUDE_UTILITIES_NAMEDOBJECT_HPP_
10#define UTILITIES_INCLUDE_UTILITIES_NAMEDOBJECT_HPP_
11
12#include <string>
13
14namespace dunedaq::utilities {
19class Named
20{
21public:
26 Named() = default;
27 Named(Named const&) = delete;
28 Named(Named&&) = default;
29 Named& operator=(Named const&) = delete;
30 Named& operator=(Named&&) = default;
31 virtual ~Named() = default;
32
37 virtual const std::string& get_name() const = 0;
38};
39
43class NamedObject : public Named
44{
45public:
50 explicit NamedObject(const std::string& name)
51 : m_name(name)
52 {}
53
54 NamedObject(NamedObject const&) = delete;
55 NamedObject(NamedObject&&) = default;
56 NamedObject& operator=(NamedObject const&) = delete;
58 virtual ~NamedObject() = default;
59
64 const std::string& get_name() const final { return m_name; }
65
66private:
67 std::string m_name;
68};
69
70} // namespace dunedaq::utilities
71#endif // UTILITIES_INCLUDE_UTILITIES_NAMEDOBJECT_HPP_
Implements the Named interface.
NamedObject(const std::string &name)
NamedObject Constructor.
NamedObject & operator=(NamedObject const &)=delete
NamedObject is not copy-assignable.
NamedObject(NamedObject &&)=default
NamedObject is move-constructible.
virtual ~NamedObject()=default
Default virtual destructor.
NamedObject(NamedObject const &)=delete
NamedObject is not copy-constructible.
NamedObject & operator=(NamedObject &&)=default
NamedObject is move-assignable.
const std::string & get_name() const final
Get the name of this NamedObejct.
A Named is a DAQ object (Queue or DAQModule) which has an instance name.
virtual ~Named()=default
Default virtual destructor.
Named()=default
Named Constructor.
Named(Named const &)=delete
Named is not copy-constructible.
Named & operator=(Named &&)=default
Named is move-assignable.
virtual const std::string & get_name() const =0
Get the name of this Named.
Named & operator=(Named const &)=delete
Named is not copy-assignable.
Named(Named &&)=default
Named is move-constructible.