ATLAS Offline Software
Loading...
Searching...
No Matches
Monitored::ValuesCollection< T > Class Template Reference

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

#include <MonitoredCollection.h>

Inheritance diagram for Monitored::ValuesCollection< T >:
Collaboration diagram for Monitored::ValuesCollection< T >:

Public Types

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

Public Member Functions

 ValuesCollection (ValuesCollection &&)=default
virtual double get (size_t i) const override
virtual std::string getString (size_t i) const override
virtual bool hasStringRepresentation () const override
 indcates that the stored content can be converted to strings
virtual size_t size () const override
 gives size of vector representation
const std::string & name () const

Public Attributes

friend MonitoredGroup

Private Member Functions

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

Private Attributes

const T & m_collection
const std::string m_name

Friends

ValuesCollection< T > Collection (std::string name, const T &collection)
 Declare a monitored (double-convertible) collection.
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 178 of file MonitoredCollection.h.

Member Typedef Documentation

◆ 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.

◆ 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 ( size_t i) const
inlineoverridevirtual

Implements Monitored::IMonitoredVariable.

Definition at line 191 of file MonitoredCollection.h.

191 {
193 return m_collection[i];
194 else
195 return -1;
196 }

◆ getString()

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

Implements Monitored::IMonitoredVariable.

Definition at line 198 of file MonitoredCollection.h.

198 {
200 return m_collection[i];
201 else
202 return {};
203 }

◆ hasStringRepresentation()

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

indcates that the stored content can be converted to strings

Implements Monitored::IMonitoredVariable.

Definition at line 205 of file MonitoredCollection.h.

◆ name()

const std::string & Monitored::IMonitoredVariable::name ( ) const
inlineinherited

Definition at line 19 of file IMonitoredVariable.h.

19{ return m_name; }

◆ 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

gives size of vector representation

Implements Monitored::IMonitoredVariable.

Definition at line 209 of file MonitoredCollection.h.

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

◆ 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 {
40 }
const std::string & name() const
ValuesCollection(ValuesCollection &&)=default

Member Data Documentation

◆ m_collection

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

Definition at line 214 of file MonitoredCollection.h.

◆ m_name

const std::string Monitored::IMonitoredVariable::m_name
privateinherited

Definition at line 31 of file IMonitoredVariable.h.

◆ MonitoredGroup

friend Monitored::IMonitoredVariable::MonitoredGroup
inherited

Definition at line 16 of file IMonitoredVariable.h.


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