DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
QueueBase.hpp
Go to the documentation of this file.
1
15#ifndef IOMANAGER_INCLUDE_IOMANAGER_QUEUEBASE_HPP_
16#define IOMANAGER_INCLUDE_IOMANAGER_QUEUEBASE_HPP_
17
19
22
23#include "ers/Issue.hpp"
24
25#include <atomic>
26#include <chrono>
27#include <cstddef>
28#include <memory>
29#include <string>
30#include <vector>
31
32namespace dunedaq::iomanager {
33
39{
40public:
45 explicit QueueBase(const std::string& name)
46 : utilities::NamedObject(name)
47 {}
48
49
54 virtual size_t get_capacity() const = 0;
55
56 virtual size_t get_num_elements() const = 0;
57
58
59protected:
64 void generate_opmon_data() override
65 {
67 info.set_capacity(this->get_capacity());
69 publish(std::move(info));
70 }
71
72private:
73 QueueBase(const QueueBase&) = delete;
74 QueueBase& operator=(const QueueBase&) = delete;
75 QueueBase(QueueBase&&) = default;
77};
78
79} // namespace dunedaq::iomanager
80
81#endif // IOMANAGER_INCLUDE_IOMANAGER_QUEUEBASE_HPP_
The QueueBase class allows to address generic behavior of any Queue implementation.
Definition QueueBase.hpp:39
QueueBase(const QueueBase &)=delete
QueueBase(QueueBase &&)=default
QueueBase(const std::string &name)
QueueBase Constructor.
Definition QueueBase.hpp:45
QueueBase & operator=(QueueBase &&)=default
QueueBase & operator=(const QueueBase &)=delete
void generate_opmon_data() override
Method to retrieve information (occupancy) from queues.
Definition QueueBase.hpp:64
virtual size_t get_num_elements() const =0
virtual size_t get_capacity() const =0
Get the capacity (max size) of the queue.
void set_number_of_elements(::uint64_t value)
Definition queue.pb.h:295
void publish(google::protobuf::Message &&, CustomOrigin &&co={}, OpMonLevel l=to_level(EntryOpMonLevel::kDefault)) const noexcept
Implements the Named interface.
NamedObject(const std::string &name)
NamedObject Constructor.