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_QUEUE_QUEUEBASE_HPP_
16#define IOMANAGER_INCLUDE_IOMANAGER_QUEUE_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 <utility>
31#include <vector>
32
33namespace dunedaq::iomanager {
34
45{
46public:
51 explicit QueueBase(const std::string& name)
52 : utilities::NamedObject(name)
54 {
55 }
56
61 virtual size_t get_capacity() const = 0;
62
63 virtual size_t get_num_elements() const = 0;
64
65protected:
70 void generate_opmon_data() override
71 {
73 info.set_capacity(this->get_capacity());
75 publish(std::move(info));
76 }
77
78private:
79 QueueBase(const QueueBase&) = delete;
80 QueueBase& operator=(const QueueBase&) = delete;
81 QueueBase(QueueBase&&) = delete;
83};
84
85} // namespace dunedaq::iomanager
86
87#endif // IOMANAGER_INCLUDE_IOMANAGER_QUEUE_QUEUEBASE_HPP_
The QueueBase class allows to address generic behavior of any Queue implementation.
Definition QueueBase.hpp:45
QueueBase(const QueueBase &)=delete
QueueBase(const std::string &name)
QueueBase Constructor.
Definition QueueBase.hpp:51
QueueBase & operator=(const QueueBase &)=delete
void generate_opmon_data() override
Method to retrieve information (occupancy) from queues.
Definition QueueBase.hpp:70
virtual size_t get_num_elements() const =0
QueueBase(QueueBase &&)=delete
QueueBase & operator=(QueueBase &&)=delete
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.