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

Monitoring of object collection references (internal) More...

#include <MonitoredCollection.h>

Collaboration diagram for Monitored::ObjectsRefCollection< 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

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

 ObjectsRefCollection (std::string name, const std::reference_wrapper< T > &collection, std::function< R(const const_value_type &)> converterToR)
 
 ObjectsRefCollection (ObjectsRefCollection const &)=delete
 
ObjectsRefCollectionoperator= (ObjectsRefCollection const &)=delete
 

Private Attributes

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

Friends

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

Detailed Description

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

Monitoring of object collection references (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 20 of file MonitoredCollection.h.

Member Typedef Documentation

◆ const_value_type

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

Definition at line 352 of file MonitoredCollection.h.

◆ value_type

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

Type of the collection elements.

Definition at line 351 of file MonitoredCollection.h.

Constructor & Destructor Documentation

◆ ObjectsRefCollection() [1/3]

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

◆ ObjectsRefCollection() [2/3]

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

Definition at line 394 of file MonitoredCollection.h.

396  : IMonitoredVariable(std::move(name)),
397  m_collection(std::move(collection)),
398  m_converterToR(std::move(converterToR)) {}

◆ ObjectsRefCollection() [3/3]

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

Member Function Documentation

◆ get()

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

Definition at line 369 of file MonitoredCollection.h.

369  {
370  if constexpr (std::is_convertible_v<R, double>)
371  return m_converterToR(m_collection.get()[i]);
372  else
373  return -1;
374  }

◆ getString()

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

Definition at line 376 of file MonitoredCollection.h.

376  {
377  if constexpr (std::is_constructible_v<std::string, R>)
378  return m_converterToR(m_collection.get()[i]);
379  else
380  return {};
381  }

◆ hasStringRepresentation()

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

Definition at line 383 of file MonitoredCollection.h.

383  {
385  };

◆ operator=()

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

◆ size()

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

Definition at line 386 of file MonitoredCollection.h.

386  {
387  return std::size(m_collection.get());
388  }

Friends And Related Function Documentation

◆ Collection [1/2]

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

◆ Collection [2/2]

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

Member Data Documentation

◆ m_collection

template<class T , class R >
const std::reference_wrapper<T>& Monitored::ObjectsRefCollection< T, R >::m_collection
private

Definition at line 391 of file MonitoredCollection.h.

◆ m_converterToR

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

Definition at line 392 of file MonitoredCollection.h.


The documentation for this class was generated from the following file:
Monitored::ObjectsRefCollection::m_converterToR
std::function< R(const const_value_type &)> m_converterToR
Definition: MonitoredCollection.h:392
athena.value
value
Definition: athena.py:122
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
lumiFormat.i
int i
Definition: lumiFormat.py:92
Monitored::ObjectsRefCollection::m_collection
const std::reference_wrapper< T > & m_collection
Definition: MonitoredCollection.h:391
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192