ATLAS Offline Software
Loading...
Searching...
No Matches
HLT::MET::MonGroupBuilder Class Reference

#include <MonGroupBuilder.h>

Collaboration diagram for HLT::MET::MonGroupBuilder:

Public Member Functions

void add (Monitored::IMonitoredVariable &variable)
 Add a new monitored variable.
template<typename T, typename = std::enable_if_t< !std::is_lvalue_reference_v<T> && std::is_base_of_v<Monitored::IMonitoredVariable, T>>>
void add (T &&variable)
 Add a new monitored variable.
Monitored::Group build (const ToolHandle< GenericMonitoringTool > &tool) const
 Build the monitored group.
void increaseCapacity (std::size_t value, bool owned=false)
 Increase the internal capacity.

Private Attributes

std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > m_references
 References to monitored variables.
std::vector< std::unique_ptr< Monitored::IMonitoredVariable > > m_ptrs
 Any monitored variables that we own directly.

Detailed Description

Definition at line 33 of file MonGroupBuilder.h.

Member Function Documentation

◆ add() [1/2]

void HLT::MET::MonGroupBuilder::add ( Monitored::IMonitoredVariable & variable)

Add a new monitored variable.

Parameters
variableThe variable to monitor

This overload will not take ownership of the variable

Definition at line 16 of file MonGroupBuilder.cxx.

17 {
18 m_references.push_back(variable);
19 }
std::vector< std::reference_wrapper< Monitored::IMonitoredVariable > > m_references
References to monitored variables.

◆ add() [2/2]

template<typename T, typename = std::enable_if_t< !std::is_lvalue_reference_v<T> && std::is_base_of_v<Monitored::IMonitoredVariable, T>>>
void HLT::MET::MonGroupBuilder::add ( T && variable)
inline

Add a new monitored variable.

Template Parameters
TThe type of monitored variable
Parameters
variableThe variable to monitor

This overload will take ownership of the variable

Definition at line 54 of file MonGroupBuilder.h.

55 {
56 m_ptrs.push_back(std::make_unique<T>(std::move(variable) ) );
57 add(*m_ptrs.back() );
58 }
void add(Monitored::IMonitoredVariable &variable)
Add a new monitored variable.
std::vector< std::unique_ptr< Monitored::IMonitoredVariable > > m_ptrs
Any monitored variables that we own directly.

◆ build()

Monitored::Group HLT::MET::MonGroupBuilder::build ( const ToolHandle< GenericMonitoringTool > & tool) const

Build the monitored group.

Parameters
toolThe monitoring tool to add the group to

Builds the monitored group. Note that if this builder owns any variables then fill must be called on the group before this object goes out of scope (remembering that groups call fill on destruction if it hasn't been called before this).

Definition at line 21 of file MonGroupBuilder.cxx.

23 {
24 return Monitored::Group(tool, m_references);
25 }

◆ increaseCapacity()

void HLT::MET::MonGroupBuilder::increaseCapacity ( std::size_t value,
bool owned = false )

Increase the internal capacity.

Parameters
valueThe amount to increase capacity by
ownedWhether to increase the 'owned' capacity by the same amount

Increase the capacity of the internal vectors. This function is used for performance only.

Definition at line 27 of file MonGroupBuilder.cxx.

28 {
29 m_references.reserve(value+m_references.capacity() );
30 if (owned)
31 m_ptrs.reserve(value+m_ptrs.capacity() );
32 }

Member Data Documentation

◆ m_ptrs

std::vector<std::unique_ptr<Monitored::IMonitoredVariable> > HLT::MET::MonGroupBuilder::m_ptrs
private

Any monitored variables that we own directly.

Definition at line 86 of file MonGroupBuilder.h.

◆ m_references

std::vector<std::reference_wrapper<Monitored::IMonitoredVariable> > HLT::MET::MonGroupBuilder::m_references
private

References to monitored variables.

Definition at line 84 of file MonGroupBuilder.h.


The documentation for this class was generated from the following files: