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

Monitoring of object collections (internal) More...

#include <MonitoredCollection.h>

Collaboration diagram for Monitored::ObjectsCollection< T, R >:

Public Types

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

Public Member Functions

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

 ObjectsCollection (std::string name, const T &collection, std::function< R(const const_value_type &)> converterToR)
 
 ObjectsCollection (ObjectsCollection const &)=delete
 
ObjectsCollectionoperator= (ObjectsCollection const &)=delete
 

Private Attributes

const T & m_collection
 
std::function< R(const const_value_type &)> m_converterToR
 

Friends

template<class U >
ObjectsCollection< U, double > Collection (std::string name, const U &collection, std::function< double(const typename ObjectsCollection< U, double >::const_value_type &)> accessor)
 
template<class U >
ObjectsCollection< U, std::string > Collection (std::string name, const U &collection, std::function< std::string(const typename ObjectsCollection< U, std::string >::const_value_type &)> converterToString)
 

Detailed Description

template<class T, class R>
class Monitored::ObjectsCollection< T, R >

Monitoring of object collections (internal)

Template types are: T - collection, R - result type of the converter function (convertible to double or string) This class is not supposed to be used by the end user.

Definition at line 19 of file MonitoredCollection.h.

Member Typedef Documentation

◆ const_value_type

template<class T , class R >
using Monitored::ObjectsCollection< T, R >::const_value_type = typename detail::make_pointer_const<value_type>::type

Definition at line 287 of file MonitoredCollection.h.

◆ value_type

template<class T , class R >
using Monitored::ObjectsCollection< T, R >::value_type = typename detail::get_value_type<T>::value_type

Type of the collection elements.

Definition at line 286 of file MonitoredCollection.h.

Constructor & Destructor Documentation

◆ ObjectsCollection() [1/3]

template<class T , class R >
Monitored::ObjectsCollection< T, R >::ObjectsCollection ( ObjectsCollection< T, R > &&  )
default

◆ ObjectsCollection() [2/3]

template<class T , class R >
Monitored::ObjectsCollection< T, R >::ObjectsCollection ( std::string  name,
const T &  collection,
std::function< R(const const_value_type &)>  converterToR 
)
inlineprivate

Definition at line 329 of file MonitoredCollection.h.

331  : IMonitoredVariable(std::move(name)),
332  m_collection(std::move(collection)),
333  m_converterToR(std::move(converterToR)) {}

◆ ObjectsCollection() [3/3]

template<class T , class R >
Monitored::ObjectsCollection< T, R >::ObjectsCollection ( ObjectsCollection< T, R > const )
privatedelete

Member Function Documentation

◆ get()

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

Definition at line 304 of file MonitoredCollection.h.

304  {
305  if constexpr (std::is_convertible_v<R, double>)
306  return m_converterToR(m_collection[i]);
307  else
308  return -1;
309  }

◆ getString()

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

Definition at line 311 of file MonitoredCollection.h.

311  {
312  if constexpr (std::is_constructible_v<std::string, R>)
313  return m_converterToR(m_collection[i]);
314  else
315  return {};
316  }

◆ hasStringRepresentation()

template<class T , class R >
virtual bool Monitored::ObjectsCollection< T, R >::hasStringRepresentation ( ) const
inlineoverridevirtual

Definition at line 318 of file MonitoredCollection.h.

318  {
320  };

◆ operator=()

template<class T , class R >
ObjectsCollection& Monitored::ObjectsCollection< T, R >::operator= ( ObjectsCollection< T, R > const )
privatedelete

◆ size()

template<class T , class R >
virtual size_t Monitored::ObjectsCollection< T, R >::size ( ) const
inlineoverridevirtual

Definition at line 321 of file MonitoredCollection.h.

321  {
322  return std::size(m_collection);
323  }

Friends And Related Function Documentation

◆ Collection [1/2]

template<class T , class R >
template<class U >
ObjectsCollection<U, double> Collection ( std::string  name,
const U &  collection,
std::function< double(const typename ObjectsCollection< U, double >::const_value_type &)>  accessor 
)
friend

◆ Collection [2/2]

template<class T , class R >
template<class U >
ObjectsCollection<U, std::string> Collection ( std::string  name,
const U &  collection,
std::function< std::string(const typename ObjectsCollection< U, std::string >::const_value_type &)>  converterToString 
)
friend

Member Data Documentation

◆ m_collection

template<class T , class R >
const T& Monitored::ObjectsCollection< T, R >::m_collection
private

Definition at line 326 of file MonitoredCollection.h.

◆ m_converterToR

template<class T , class R >
std::function<R(const const_value_type&)> Monitored::ObjectsCollection< T, R >::m_converterToR
private

Definition at line 327 of file MonitoredCollection.h.


The documentation for this class was generated from the following file:
athena.value
value
Definition: athena.py:124
Monitored::ObjectsCollection::m_collection
const T & m_collection
Definition: MonitoredCollection.h:326
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
Monitored::ObjectsCollection::m_converterToR
std::function< R(const const_value_type &)> m_converterToR
Definition: MonitoredCollection.h:327
lumiFormat.i
int i
Definition: lumiFormat.py:85
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228