|
DUNE-DAQ
DUNE Trigger and Data Acquisition software
|
#include <IterableQueueModel.hpp>
Classes | |
| struct | Iterator |
Public Types | |
| typedef T | value_type |
Public Types inherited from dunedaq::opmonlib::MonitorableObject | |
| using | NodePtr = std::weak_ptr<MonitorableObject> |
| using | NewNodePtr = std::shared_ptr<MonitorableObject> |
| using | ElementId = std::string |
Public Member Functions | |
| IterableQueueModel (const IterableQueueModel &)=delete | |
| IterableQueueModel & | operator= (const IterableQueueModel &)=delete |
| IterableQueueModel () | |
| IterableQueueModel (std::size_t size) | |
| IterableQueueModel (std::size_t size, bool numa_aware=false, uint8_t numa_node=0, bool intrinsic_allocator=false, std::size_t alignment_size=0) | |
| ~IterableQueueModel () | |
| void | free_memory () |
| void | allocate_memory (std::size_t size, bool numa_aware, uint8_t numa_node=0, bool intrinsic_allocator=false, std::size_t alignment_size=0) |
| void | allocate_memory (std::size_t size) override |
| void | prefill_task () |
| void | force_pagefault () |
| bool | write (T &&record) override |
| Move referenced object into LB. | |
| bool | read (T &record) override |
| Move object from LB to referenced. | |
| void | popFront () |
| void | pop (std::size_t x) |
| Pop specified amount of elements from LB. | |
| bool | isEmpty () const |
| bool | isFull () const |
| std::size_t | occupancy () const override |
| Occupancy of LB. | |
| std::size_t | size () const |
| std::size_t | capacity () const |
| const T * | front () override |
| Write referenced object into LB without moving it. | |
| const T * | back () override |
| Get pointer to the back of the LB. | |
| T * | start_of_buffer () |
| T * | end_of_buffer () |
| void | conf (const appmodel::LatencyBuffer *cfg) override |
| Configure the LB. | |
| void | scrap (const appfwk::DAQModule::CommandData_t &) override |
| Unconfigure the LB. | |
| void | flush () override |
| Flush all elements from the latency buffer. | |
| std::size_t | get_alignment_size () |
| Iterator | begin () |
| Iterator | end () |
Public Member Functions inherited from dunedaq::datahandlinglibs::LatencyBufferConcept< T > | |
| LatencyBufferConcept () | |
| virtual | ~LatencyBufferConcept () |
| LatencyBufferConcept (const LatencyBufferConcept &)=delete | |
| LatencyBufferConcept is not copy-constructible. | |
| LatencyBufferConcept & | operator= (const LatencyBufferConcept &)=delete |
| LatencyBufferConcept is not copy-assginable. | |
| LatencyBufferConcept (LatencyBufferConcept &&)=delete | |
| LatencyBufferConcept is not move-constructible. | |
| LatencyBufferConcept & | operator= (LatencyBufferConcept &&)=delete |
| LatencyBufferConcept is not move-assignable. | |
| virtual void | allocate_memory (size_t)=0 |
| Whether or not the buffer is allocatable. false by default. | |
Public Member Functions inherited from dunedaq::opmonlib::MonitorableObject | |
| MonitorableObject (const MonitorableObject &)=delete | |
| MonitorableObject & | operator= (const MonitorableObject &)=delete |
| MonitorableObject (MonitorableObject &&)=delete | |
| MonitorableObject & | operator= (MonitorableObject &&)=delete |
| virtual | ~MonitorableObject ()=default |
| auto | get_opmon_id () const noexcept |
| auto | get_opmon_level () const noexcept |
Protected Member Functions | |
| virtual void | generate_opmon_data () override |
| template<class... Args> | |
| bool | write_ (Args &&... recordArgs) |
Protected Member Functions inherited from dunedaq::opmonlib::MonitorableObject | |
| MonitorableObject ()=default | |
| void | register_node (ElementId name, NewNodePtr) |
| void | publish (google::protobuf::Message &&, CustomOrigin &&co={}, OpMonLevel l=to_level(EntryOpMonLevel::kDefault)) const noexcept |
Protected Attributes | |
| std::atomic< int > | overflow_ctr { 0 } |
| bool | numa_aware_ |
| uint8_t | numa_node_ |
| bool | intrinsic_allocator_ |
| std::size_t | alignment_size_ |
| bool | invalid_configuration_requested_ |
| std::string | prefiller_name_ {"lbpfn"} |
| std::mutex | prefill_mutex_ |
| std::condition_variable | prefill_cv_ |
| bool | prefill_ready_ |
| bool | prefill_done_ |
| std::thread | ptrlogger |
| char | pad0_ [folly::hardware_destructive_interference_size] |
| uint32_t | size_ |
| T * | records_ |
| std::atomic< unsigned int > | readIndex_ |
| std::atomic< unsigned int > | writeIndex_ |
| char | pad1_ [folly::hardware_destructive_interference_size - sizeof(writeIndex_)] |
Additional Inherited Members | |
Static Public Member Functions inherited from dunedaq::opmonlib::MonitorableObject | |
| static bool | publishable_metric (OpMonLevel entry, OpMonLevel system) noexcept |
IterableQueueModel is a one producer and one consumer queue without locks. Modified version of the folly::ProducerConsumerQueue via adding a readPtr function. Requires well defined and followed constraints on the consumer side.
Also, note that the number of usable slots in the queue at any given time is actually (size-1), so if you start with an empty queue, isFull() will return true after size-1 insertions.
Definition at line 71 of file IterableQueueModel.hpp.
| T dunedaq::datahandlinglibs::IterableQueueModel< T >::value_type |
Definition at line 73 of file IterableQueueModel.hpp.
|
delete |
|
inline |
Definition at line 79 of file IterableQueueModel.hpp.
|
inlineexplicit |
Definition at line 95 of file IterableQueueModel.hpp.
|
inline |
Definition at line 128 of file IterableQueueModel.hpp.
|
inline |
Definition at line 166 of file IterableQueueModel.hpp.
|
inlineoverride |
Definition at line 178 of file IterableQueueModel.hpp.
| void dunedaq::datahandlinglibs::IterableQueueModel< T >::allocate_memory | ( | std::size_t | size, |
| bool | numa_aware, | ||
| uint8_t | numa_node = 0, | ||
| bool | intrinsic_allocator = false, | ||
| std::size_t | alignment_size = 0 ) |
Definition at line 39 of file IterableQueueModel.hxx.
|
overridevirtual |
Get pointer to the back of the LB.
Implements dunedaq::datahandlinglibs::LatencyBufferConcept< T >.
Definition at line 279 of file IterableQueueModel.hxx.
|
inline |
Definition at line 299 of file IterableQueueModel.hpp.
|
inline |
Definition at line 216 of file IterableQueueModel.hpp.
|
overridevirtual |
Configure the LB.
Implements dunedaq::datahandlinglibs::LatencyBufferConcept< T >.
Definition at line 297 of file IterableQueueModel.hxx.
|
inline |
Definition at line 309 of file IterableQueueModel.hpp.
|
inline |
Definition at line 228 of file IterableQueueModel.hpp.
|
inlineoverridevirtual |
Flush all elements from the latency buffer.
Implements dunedaq::datahandlinglibs::LatencyBufferConcept< T >.
Definition at line 237 of file IterableQueueModel.hpp.
| void dunedaq::datahandlinglibs::IterableQueueModel< T >::force_pagefault | ( | ) |
Definition at line 107 of file IterableQueueModel.hxx.
| void dunedaq::datahandlinglibs::IterableQueueModel< T >::free_memory | ( | ) |
Definition at line 9 of file IterableQueueModel.hxx.
|
overridevirtual |
Write referenced object into LB without moving it.
Get pointer to the front of the LB
Implements dunedaq::datahandlinglibs::LatencyBufferConcept< T >.
Definition at line 267 of file IterableQueueModel.hxx.
|
overrideprotectedvirtual |
Hook for customisable pubblication. The function can throw, exception will be caught by the monitoring thread
Reimplemented from dunedaq::opmonlib::MonitorableObject.
Definition at line 372 of file IterableQueueModel.hxx.
|
inline |
Definition at line 240 of file IterableQueueModel.hpp.
| bool dunedaq::datahandlinglibs::IterableQueueModel< T >::isEmpty | ( | ) | const |
Definition at line 225 of file IterableQueueModel.hxx.
| bool dunedaq::datahandlinglibs::IterableQueueModel< T >::isFull | ( | ) | const |
Definition at line 233 of file IterableQueueModel.hxx.
|
overridevirtual |
Occupancy of LB.
Implements dunedaq::datahandlinglibs::LatencyBufferConcept< T >.
Definition at line 254 of file IterableQueueModel.hxx.
|
delete |
|
virtual |
Pop specified amount of elements from LB.
Implements dunedaq::datahandlinglibs::LatencyBufferConcept< T >.
Definition at line 215 of file IterableQueueModel.hxx.
| void dunedaq::datahandlinglibs::IterableQueueModel< T >::popFront | ( | ) |
Definition at line 198 of file IterableQueueModel.hxx.
| void dunedaq::datahandlinglibs::IterableQueueModel< T >::prefill_task | ( | ) |
Definition at line 84 of file IterableQueueModel.hxx.
|
overridevirtual |
Move object from LB to referenced.
Implements dunedaq::datahandlinglibs::LatencyBufferConcept< T >.
Definition at line 177 of file IterableQueueModel.hxx.
|
overridevirtual |
Unconfigure the LB.
Implements dunedaq::datahandlinglibs::LatencyBufferConcept< T >.
Definition at line 322 of file IterableQueueModel.hxx.
|
inline |
Definition at line 213 of file IterableQueueModel.hpp.
|
inline |
Definition at line 225 of file IterableQueueModel.hpp.
|
overridevirtual |
Move referenced object into LB.
Implements dunedaq::datahandlinglibs::LatencyBufferConcept< T >.
Definition at line 155 of file IterableQueueModel.hxx.
|
protected |
Definition at line 342 of file IterableQueueModel.hxx.
|
protected |
Definition at line 328 of file IterableQueueModel.hpp.
|
protected |
Definition at line 327 of file IterableQueueModel.hpp.
|
protected |
Definition at line 329 of file IterableQueueModel.hpp.
|
protected |
Definition at line 325 of file IterableQueueModel.hpp.
|
protected |
Definition at line 326 of file IterableQueueModel.hpp.
|
protected |
Definition at line 322 of file IterableQueueModel.hpp.
|
protected |
Definition at line 344 of file IterableQueueModel.hpp.
|
protected |
Definition at line 351 of file IterableQueueModel.hpp.
|
protected |
Definition at line 334 of file IterableQueueModel.hpp.
|
protected |
Definition at line 336 of file IterableQueueModel.hpp.
|
protected |
Definition at line 333 of file IterableQueueModel.hpp.
|
protected |
Definition at line 335 of file IterableQueueModel.hpp.
|
protected |
Definition at line 332 of file IterableQueueModel.hpp.
|
protected |
Definition at line 339 of file IterableQueueModel.hpp.
|
protected |
Definition at line 348 of file IterableQueueModel.hpp.
|
protected |
Definition at line 346 of file IterableQueueModel.hpp.
|
protected |
Definition at line 345 of file IterableQueueModel.hpp.
|
protected |
Definition at line 350 of file IterableQueueModel.hpp.