DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
ConfigurationPointer.hpp
Go to the documentation of this file.
1
8#ifndef PYTHONCONFIGURATION_H
9#define PYTHONCONFIGURATION_H
10
12#include <boost/shared_ptr.hpp>
13
14namespace dunedaq {
15namespace conffwk {
16
17namespace python {
18
25
26 public:
29
31 ConfigurationPointer(const std::string& s)
32 : m_shared(new Configuration(s)), m_pointer(0) {}
33
36 : m_shared(),
37 m_pointer(&const_cast<Configuration&>(p)) {}
38
43
46 {
47 m_shared = other.m_shared;
48 m_pointer = const_cast<ConfigurationPointer&>(other).m_pointer;
49 return *this;
50 }
51
54
57
60
63
64 private:
65 boost::shared_ptr<Configuration> m_shared; //self-initialized Configuration
66 Configuration* m_pointer; //user initialized Configuration
67
68 };
69
70}
71} // namespace conffwk
72} // namespace dunedaq
73
74#endif /* PYTHONCONFIGURATION_H */
75
Defines base class for cache of template objects.
void get(const std::string &class_name, const std::string &id, ConfigObject &object, unsigned long rlevel=0, const std::vector< std::string > *rclasses=0)
Get object by class name and object id (multi-thread safe).
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.