QualityControl  1.5.1
O2 Data Quality Control Framework
ObjectsManager.h
Go to the documentation of this file.
1 // Copyright CERN and copyright holders of ALICE O2. This software is
2 // distributed under the terms of the GNU General Public License v3 (GPL
3 // Version 3), copied verbatim in the file "COPYING".
4 //
5 // See http://alice-o2.web.cern.ch/license for full licensing information.
6 //
7 // In applying this license CERN does not waive the privileges and immunities
8 // granted to it by virtue of its status as an Intergovernmental Organization
9 // or submit itself to any jurisdiction.
10 
15 
16 #ifndef QC_CORE_OBJECTMANAGER_H
17 #define QC_CORE_OBJECTMANAGER_H
18 
19 // QC
23 // stl
24 #include <string>
25 #include <memory>
26 
27 class TObject;
28 class TObjArray;
29 
31 {
32 
33 class ServiceDiscovery;
34 
42 {
43  public:
52  ObjectsManager(std::string taskName, std::string detectorName, std::string consulUrl, int parallelTaskID = 0, bool noDiscovery = false);
53  virtual ~ObjectsManager();
54 
55  static const std::string gDrawOptionsKey;
56  static const std::string gDisplayHintsKey;
57 
64  void startPublishing(TObject* obj);
65 
71  void stopPublishing(TObject* obj);
72 
78  void stopPublishing(const std::string& objectName);
79 
85  bool isBeingPublished(const std::string& name);
86 
93  MonitorObject* getMonitorObject(std::string objectName);
94 
95  MonitorObjectCollection* getNonOwningArray() const;
96 
105  void addMetadata(const std::string& objectName, const std::string& key, const std::string& value);
106 
116  void setDefaultDrawOptions(const std::string& objectName, const std::string& options);
117 
121  void setDefaultDrawOptions(TObject* obj, const std::string& options);
122 
132  void setDisplayHint(const std::string& objectName, const std::string& hints);
133 
137  void setDisplayHint(TObject* obj, const std::string& hints);
138 
143  size_t getNumberPublishedObjects();
144 
151  MonitorObject* getMonitorObject(size_t index);
152 
157  void updateServiceDiscovery();
158 
165 
166  private:
167  std::unique_ptr<MonitorObjectCollection> mMonitorObjects;
168  std::string mTaskName;
169  std::string mDetectorName;
170  std::unique_ptr<ServiceDiscovery> mServiceDiscovery;
171  bool mUpdateServiceDiscovery;
172 };
173 
174 } // namespace o2::quality_control::core
175 
176 #endif // QC_CORE_OBJECTMANAGER_H
void setDisplayHint(const std::string &objectName, const std::string &hints)
Indicate how to display this object. A number of options can be set on a canvas to influence the way ...
Definition: ObjectsManager.cxx:155
Definition: MonitorObjectCollection.h:25
Keeps the list of encapsulated objects to publish and does the actual publication.
Definition: ObjectsManager.h:41
void removeAllFromServiceDiscovery()
Remove all objects from the ServiceDiscovery. Remove all objects from the ServiceDiscovery even thoug...
Definition: ObjectsManager.cxx:80
void startPublishing(TObject *obj)
Definition: ObjectsManager.cxx:52
void stopPublishing(TObject *obj)
Definition: ObjectsManager.cxx:89
size_t getNumberPublishedObjects()
Definition: ObjectsManager.cxx:138
void setDefaultDrawOptions(const std::string &objectName, const std::string &options)
Set default draw options for this object. If possible, the object will be drawn with these options (i...
Definition: ObjectsManager.cxx:143
void addMetadata(const std::string &objectName, const std::string &key, const std::string &value)
Add metadata to a MonitorObject. Add a metadata pair to a MonitorObject. This is propagated to the da...
Definition: ObjectsManager.cxx:131
These methods can be used to build a complex processing topology. It spawns 3 separate dummy processi...
Definition: Activity.h:19
MonitorObject * getMonitorObject(std::string objectName)
Definition: ObjectsManager.cxx:105
bool isBeingPublished(const std::string &name)
Definition: ObjectsManager.cxx:100
ObjectsManager(std::string taskName, std::string detectorName, std::string consulUrl, int parallelTaskID=0, bool noDiscovery=false)
Definition: ObjectsManager.cxx:34
This class keeps the meta data about one published object.
Definition: MonitorObject.h:41
void updateServiceDiscovery()
Update the list of objects stored in the Service Discovery. Update the list of objects stored in the ...
Definition: ObjectsManager.cxx:64