DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ConfigurationPointer.hpp
Go to the documentation of this file.
1//
2// DUNE DAQ modification notice:
3// This file has been modified from the original ATLAS config source for the DUNE DAQ project.
4// Fork baseline commit: 67a24e731 (2022-10-27).
5// Renamed since fork: yes (from config/ConfigurationPointer.h to include/conffwk/ConfigurationPointer.hpp).
6//
7
14
15#ifndef PYTHONCONFIGURATION_H
16#define PYTHONCONFIGURATION_H
17
19#include <boost/shared_ptr.hpp>
20
21namespace dunedaq {
22namespace conffwk {
23
24namespace python {
25
32
33 public:
36
38 ConfigurationPointer(const std::string& s)
39 : m_shared(new Configuration(s)), m_pointer(0) {}
40
43 : m_shared(),
44 m_pointer(&const_cast<Configuration&>(p)) {}
45
50
53 {
54 m_shared = other.m_shared;
55 m_pointer = const_cast<ConfigurationPointer&>(other).m_pointer;
56 return *this;
57 }
58
61
64
67
70
71 private:
72 boost::shared_ptr<Configuration> m_shared; //self-initialized Configuration
73 Configuration* m_pointer; //user initialized Configuration
74
75 };
76
77}
78} // namespace conffwk
79} // namespace dunedaq
80
81#endif /* PYTHONCONFIGURATION_H */
82
Defines base class for cache of template objects.
Configuration * operator->()
Let python bindings access the configuration pointer.
ConfigurationPointer(const ConfigurationPointer &other)
Copying, is shallow. Don't do this at home...
ConfigurationPointer & operator=(const ConfigurationPointer &other)
Assignment is shallow.
ConfigurationPointer(const Configuration &p)
Constructor when the user initializes from C++. In this case, the pointed configuration should never ...
Configuration & operator*()
Another way to access the configuration pointer.
ConfigurationPointer(const std::string &s)
Constructor when the user initializes from within python.
virtual ~ConfigurationPointer()
Destructor. If started from string, destroy if the last instance, otherwise, doesn't do anything at a...
Configuration * get()
Get the configuration pointer.
conffwk entry point
Including Qt Headers.
Definition module.cpp:16