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

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

#include <MonitoredCollection.h>

Collaboration diagram for Monitored::ValuesCollection< T >:

Public Types

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

Public Member Functions

 ValuesCollection (ValuesCollection &&)=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

 ValuesCollection (std::string vname, const T &collection)
 
 ValuesCollection (ValuesCollection const &)=delete
 
ValuesCollectionoperator= (ValuesCollection const &)=delete
 

Private Attributes

const T & m_collection
 

Friends

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

Detailed Description

template<class T>
class Monitored::ValuesCollection< T >

Internal class not to be used by end user.

Definition at line 17 of file MonitoredCollection.h.

Member Typedef Documentation

◆ value_type

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

Type of the collection elements.

Definition at line 181 of file MonitoredCollection.h.

Constructor & Destructor Documentation

◆ ValuesCollection() [1/3]

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

◆ ValuesCollection() [2/3]

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

Definition at line 217 of file MonitoredCollection.h.

218  : IMonitoredVariable(std::move(vname)), m_collection{collection} {
219  }

◆ ValuesCollection() [3/3]

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

Member Function Documentation

◆ get()

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

Definition at line 191 of file MonitoredCollection.h.

191  {
192  if constexpr (std::is_convertible_v<value_type, double>)
193  return m_collection[i];
194  else
195  return -1;
196  }

◆ getString()

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

Definition at line 198 of file MonitoredCollection.h.

198  {
199  if constexpr (std::is_constructible_v<std::string, value_type>)
200  return m_collection[i];
201  else
202  return {};
203  }

◆ hasStringRepresentation()

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

Definition at line 205 of file MonitoredCollection.h.

◆ operator=()

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

◆ size()

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

Definition at line 209 of file MonitoredCollection.h.

209  {
210  return std::size(m_collection);
211  }

Friends And Related Function Documentation

◆ Collection [1/2]

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

◆ Collection [2/2]

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

Declare a monitored (double-convertible) collection.

Template Parameters
TType of collection
Parameters
nameName of monitored quantity
collectionCollection 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 38 of file MonitoredCollection.h.

38  {
39  return ValuesCollection<T>(std::move(name), collection);
40  }

Member Data Documentation

◆ m_collection

template<class T >
const T& Monitored::ValuesCollection< T >::m_collection
private

Definition at line 214 of file MonitoredCollection.h.


The documentation for this class was generated from the following file:
test_pyathena.eta
eta
Definition: test_pyathena.py:10
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:221
Monitored::ValuesCollection::m_collection
const T & m_collection
Definition: MonitoredCollection.h:214
CaloLCW_tf.group
group
Definition: CaloLCW_tf.py:28