ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Monitored::ValuesRefCollection< T > Class Template Reference

Internal class not to be used by end user. More...

#include <MonitoredCollection.h>

Collaboration diagram for Monitored::ValuesRefCollection< T >:

Public Types

using value_type = typename detail::get_value_type< T >::value_type
 Type of the collection elements. More...
 

Public Member Functions

 ValuesRefCollection (ValuesRefCollection &&)=default
 
virtual double get ([[maybe_unused]] size_t i) const override
 
virtual std::string getString ([[maybe_unused]] size_t i) const override
 
virtual bool hasStringRepresentation () const override
 
virtual size_t size () const override
 

Private Member Functions

 ValuesRefCollection (std::string vname, const std::reference_wrapper< T > &collection)
 
 ValuesRefCollection (ValuesRefCollection const &)=delete
 
ValuesRefCollectionoperator= (ValuesRefCollection const &)=delete
 

Private Attributes

const std::reference_wrapper< T > & m_collection
 

Friends

ValuesRefCollection< T > Collection (std::string name, const std::reference_wrapper< T > &collection)
 Declare a monitored (double-convertible) collection reference. More...
 
ValuesRefCollection< T > Collection (std::string name, const std::reference_wrapper< T > &&collection)
 

Detailed Description

template<class T>
class Monitored::ValuesRefCollection< T >

Internal class not to be used by end user.

Definition at line 18 of file MonitoredCollection.h.

Member Typedef Documentation

◆ value_type

template<class T >
using Monitored::ValuesRefCollection< T >::value_type = typename detail::get_value_type<T>::value_type

Type of the collection elements.

Definition at line 232 of file MonitoredCollection.h.

Constructor & Destructor Documentation

◆ ValuesRefCollection() [1/3]

template<class T >
Monitored::ValuesRefCollection< T >::ValuesRefCollection ( ValuesRefCollection< T > &&  )
default

◆ ValuesRefCollection() [2/3]

template<class T >
Monitored::ValuesRefCollection< T >::ValuesRefCollection ( std::string  vname,
const std::reference_wrapper< T > &  collection 
)
inlineprivate

Definition at line 268 of file MonitoredCollection.h.

269  : IMonitoredVariable(std::move(vname)), m_collection{collection} {
270  }

◆ ValuesRefCollection() [3/3]

template<class T >
Monitored::ValuesRefCollection< T >::ValuesRefCollection ( ValuesRefCollection< T > const )
privatedelete

Member Function Documentation

◆ get()

template<class T >
virtual double Monitored::ValuesRefCollection< T >::get ( [[maybe_unused] ] size_t  i) const
inlineoverridevirtual

Definition at line 242 of file MonitoredCollection.h.

242  {
243  if constexpr (std::is_convertible_v<value_type, double>)
244  return m_collection.get()[i];
245  else
246  return -1;
247  }

◆ getString()

template<class T >
virtual std::string Monitored::ValuesRefCollection< T >::getString ( [[maybe_unused] ] size_t  i) const
inlineoverridevirtual

Definition at line 249 of file MonitoredCollection.h.

249  {
250  if constexpr (std::is_constructible_v<std::string, value_type>)
251  return m_collection.get()[i];
252  else
253  return {};
254  }

◆ hasStringRepresentation()

template<class T >
virtual bool Monitored::ValuesRefCollection< T >::hasStringRepresentation ( ) const
inlineoverridevirtual

Definition at line 256 of file MonitoredCollection.h.

◆ operator=()

template<class T >
ValuesRefCollection& Monitored::ValuesRefCollection< T >::operator= ( ValuesRefCollection< T > const )
privatedelete

◆ size()

template<class T >
virtual size_t Monitored::ValuesRefCollection< T >::size ( ) const
inlineoverridevirtual

Definition at line 260 of file MonitoredCollection.h.

260  {
261  return std::size(m_collection.get());
262  }

Friends And Related Function Documentation

◆ Collection [1/2]

template<class T >
ValuesRefCollection<T> Collection ( std::string  name,
const std::reference_wrapper< T > &&  collection 
)
friend

◆ Collection [2/2]

template<class T >
ValuesRefCollection<T> Collection ( std::string  name,
const std::reference_wrapper< T > &  collection 
)
friend

Declare a monitored (double-convertible) collection reference.

Template Parameters
TType of collection
Parameters
nameName of monitored quantity
collectionstd::reference_wrapper to collection to be monitored (e.g. STL container or array)

Examples:

Various types of collections can be monitored. STL containers:

std::vector<float> eta( {0.2, 0.1} );
std::vector<double> phi( {-1, 1} ) ;
auto vectorT = Monitored::Collection( "Eta", eta );
auto setT = Monitored::Collection( "Phi", phi );
auto group = Monitored::Group( monTool, vectorT, setT );

or more generally, any iterable container:

See also
Monitored::Scalar
Monitored::Group

Definition at line 61 of file MonitoredCollection.h.

61  {
62  return ValuesRefCollection<T>(std::move(name), collection);
63  }

Member Data Documentation

◆ m_collection

template<class T >
const std::reference_wrapper<T>& Monitored::ValuesRefCollection< T >::m_collection
private

Definition at line 265 of file MonitoredCollection.h.


The documentation for this class was generated from the following file:
test_pyathena.eta
eta
Definition: test_pyathena.py:10
Monitored::ValuesRefCollection::m_collection
const std::reference_wrapper< T > & m_collection
Definition: MonitoredCollection.h:265
TrigDefs::Group
Group
Properties of a chain group.
Definition: GroupProperties.h:13
athena.value
value
Definition: athena.py:124
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
xAOD::phi
setEt phi
Definition: TrigEMCluster_v1.cxx:29
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
lumiFormat.i
int i
Definition: lumiFormat.py:85
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:225
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28