ATLAS Offline Software
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
CP::SysHandleArray< HANDLE > Class Template Reference

Vector-like class for systematic handles which interact with decorations. More...

#include <SysHandleArray.h>

Inheritance diagram for CP::SysHandleArray< HANDLE >:
Collaboration diagram for CP::SysHandleArray< HANDLE >:

Public Types

using iterator = typename std::vector< HANDLE >::iterator
 
using const_iterator = typename std::vector< HANDLE >::const_iterator
 
using reverse_iterator = typename std::vector< HANDLE >::reverse_iterator
 
using const_reverse_iterator = typename std::vector< HANDLE >::const_reverse_iterator
 

Public Member Functions

template<typename OWNER >
 SysHandleArray (OWNER *owner, const std::vector< std::string > &values)
 Construct the handle directly without declaring a property. More...
 
template<typename OWNER >
 SysHandleArray (OWNER *owner, const std::string &propertyName, const std::vector< std::string > &propertyValue, const std::string &propertyDescription)
 Declare the handle as a property on its parent. More...
 
template<typename... Args>
StatusCode initialize (Args &&...args)
 Create and initialize all the sub-handles. More...
 
std::size_t size () const noexcept
 The number of defined handles. More...
 
bool empty () const noexcept
 Whether any sub-handles are defined. More...
 
HANDLE & at (std::size_t idx)
 Retrieve the handle at the specified index. More...
 
const HANDLE & at (std::size_t idx) const
 (Const) retrieve the handle at the specified index More...
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level of the object. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
iterator begin ()
 Standard vector iterator interface. More...
 
iterator end ()
 
const_iterator begin () const
 
const_iterator end () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
reverse_iterator rbegin ()
 
reverse_iterator rend ()
 
const_reverse_iterator rbegin () const
 
const_reverse_iterator rend () const
 
const_reverse_iterator crbegin () const
 
const_reverse_iterator crend () const
 

Private Member Functions

void requireInitialized () const
 Throw a std::logic_error if the handle has not been initialized. More...
 

Private Attributes

std::vector< std::string > m_decorNames
 
std::vector< HANDLE > m_handles
 
std::function< MsgStream &()> m_msg
 the message stream we use More...
 

Detailed Description

template<typename HANDLE>
class CP::SysHandleArray< HANDLE >

Vector-like class for systematic handles which interact with decorations.

Template Parameters
HANDLEThe type of handle in the vector

Definition at line 24 of file SysHandleArray.h.

Member Typedef Documentation

◆ const_iterator

template<typename HANDLE >
using CP::SysHandleArray< HANDLE >::const_iterator = typename std::vector<HANDLE>::const_iterator

Definition at line 29 of file SysHandleArray.h.

◆ const_reverse_iterator

template<typename HANDLE >
using CP::SysHandleArray< HANDLE >::const_reverse_iterator = typename std::vector<HANDLE>::const_reverse_iterator

Definition at line 31 of file SysHandleArray.h.

◆ iterator

template<typename HANDLE >
using CP::SysHandleArray< HANDLE >::iterator = typename std::vector<HANDLE>::iterator

Definition at line 28 of file SysHandleArray.h.

◆ reverse_iterator

template<typename HANDLE >
using CP::SysHandleArray< HANDLE >::reverse_iterator = typename std::vector<HANDLE>::reverse_iterator

Definition at line 30 of file SysHandleArray.h.

Constructor & Destructor Documentation

◆ SysHandleArray() [1/2]

template<typename HANDLE >
template<typename OWNER >
CP::SysHandleArray< HANDLE >::SysHandleArray ( OWNER *  owner,
const std::vector< std::string > &  values 
)

Construct the handle directly without declaring a property.

Template Parameters
OWNERThe type providing the message stream
Parameters
ownerThe owner of the handle, only used for its messaging service
valuesThe decoration names of each individual handle

◆ SysHandleArray() [2/2]

template<typename HANDLE >
template<typename OWNER >
CP::SysHandleArray< HANDLE >::SysHandleArray ( OWNER *  owner,
const std::string &  propertyName,
const std::vector< std::string > &  propertyValue,
const std::string &  propertyDescription 
)

Declare the handle as a property on its parent.

Template Parameters
OWNERThe type owning the handle
Parameters
ownerThe owner of the handle, used for its properties and messaging
propertyNameThe name of the property to declare
propertyValueThe default value of the property
propertyDescriptionThe description of the property

Member Function Documentation

◆ at() [1/2]

template<typename HANDLE >
HANDLE& CP::SysHandleArray< HANDLE >::at ( std::size_t  idx)

Retrieve the handle at the specified index.

Parameters
idxThe index of the handle to retrieve
Precondition
idx < size() [throws std::out_of_range]
initialize has been called [throws std::logic_error]

◆ at() [2/2]

template<typename HANDLE >
const HANDLE& CP::SysHandleArray< HANDLE >::at ( std::size_t  idx) const

(Const) retrieve the handle at the specified index

Parameters
idxThe index of the handle to retrieve
Precondition
idx < size() [throws std::out_of_range]
initialize has been called [throws std::logic_error]

◆ begin() [1/2]

template<typename HANDLE >
iterator CP::SysHandleArray< HANDLE >::begin ( )

Standard vector iterator interface.

Precondition
initialize has been called [throws std::logic_error]

◆ begin() [2/2]

template<typename HANDLE >
const_iterator CP::SysHandleArray< HANDLE >::begin ( ) const

◆ cbegin()

template<typename HANDLE >
const_iterator CP::SysHandleArray< HANDLE >::cbegin ( ) const

◆ cend()

template<typename HANDLE >
const_iterator CP::SysHandleArray< HANDLE >::cend ( ) const

◆ crbegin()

template<typename HANDLE >
const_reverse_iterator CP::SysHandleArray< HANDLE >::crbegin ( ) const

◆ crend()

template<typename HANDLE >
const_reverse_iterator CP::SysHandleArray< HANDLE >::crend ( ) const

◆ empty()

template<typename HANDLE >
bool CP::SysHandleArray< HANDLE >::empty ( ) const
noexcept

Whether any sub-handles are defined.

Note that this will return False if any sub-handles are defined, even if all of these are actually themselves empty

◆ end() [1/2]

template<typename HANDLE >
iterator CP::SysHandleArray< HANDLE >::end ( )

◆ end() [2/2]

template<typename HANDLE >
const_iterator CP::SysHandleArray< HANDLE >::end ( ) const

◆ initialize()

template<typename HANDLE >
template<typename... Args>
StatusCode CP::SysHandleArray< HANDLE >::initialize ( Args &&...  args)

Create and initialize all the sub-handles.

The arguments to this function should be the arguments to the initialize function on the wrapped handle type

◆ msg() [1/2]

MsgStream & asg::AsgMessagingForward::msg ( ) const
inherited

The standard message stream.

Returns
A reference to the default message stream of this object.

Definition at line 24 of file AsgMessagingForward.cxx.

25  {
26  return m_msg();
27  }

◆ msg() [2/2]

MsgStream & asg::AsgMessagingForward::msg ( const MSG::Level  lvl) const
inherited

The standard message stream.

Parameters
lvlThe message level to set the stream to
Returns
A reference to the default message stream, set to level "lvl"

Definition at line 29 of file AsgMessagingForward.cxx.

30  {
31  MsgStream& msg = m_msg ();
32  msg << lvl;
33  return msg;
34  }

◆ msgLvl()

bool asg::AsgMessagingForward::msgLvl ( const MSG::Level  lvl) const
inherited

Test the output level of the object.

Parameters
lvlThe message level to test against
Returns
boolean Indicting if messages at given level will be printed
true If messages at level "lvl" will be printed

Definition at line 11 of file AsgMessagingForward.cxx.

12  {
13  MsgStream& msg = m_msg();
14  if (msg.level() <= lvl)
15  {
16  msg << lvl;
17  return true;
18  } else
19  {
20  return false;
21  }
22  }

◆ rbegin() [1/2]

template<typename HANDLE >
reverse_iterator CP::SysHandleArray< HANDLE >::rbegin ( )

◆ rbegin() [2/2]

template<typename HANDLE >
const_reverse_iterator CP::SysHandleArray< HANDLE >::rbegin ( ) const

◆ rend() [1/2]

template<typename HANDLE >
reverse_iterator CP::SysHandleArray< HANDLE >::rend ( )

◆ rend() [2/2]

template<typename HANDLE >
const_reverse_iterator CP::SysHandleArray< HANDLE >::rend ( ) const

◆ requireInitialized()

template<typename HANDLE >
void CP::SysHandleArray< HANDLE >::requireInitialized ( ) const
private

Throw a std::logic_error if the handle has not been initialized.

◆ size()

template<typename HANDLE >
std::size_t CP::SysHandleArray< HANDLE >::size ( ) const
noexcept

The number of defined handles.

Member Data Documentation

◆ m_decorNames

template<typename HANDLE >
std::vector<std::string> CP::SysHandleArray< HANDLE >::m_decorNames
private

Definition at line 113 of file SysHandleArray.h.

◆ m_handles

template<typename HANDLE >
std::vector<HANDLE> CP::SysHandleArray< HANDLE >::m_handles
private

Definition at line 114 of file SysHandleArray.h.

◆ m_msg

std::function<MsgStream& ()> asg::AsgMessagingForward::m_msg
privateinherited

the message stream we use

This used to be a simple pointer to the MsgStream itself, but in AthenaMT the actual object used is local to the thread. So instead of pointing to it directly we are now using a function to look it up, which will get the thread-local object.

Definition at line 77 of file AsgMessagingForward.h.


The documentation for this class was generated from the following file:
asg::AsgMessagingForward::m_msg
std::function< MsgStream &()> m_msg
the message stream we use
Definition: AsgMessagingForward.h:77
asg::AsgMessagingForward::msg
MsgStream & msg() const
The standard message stream.
Definition: AsgMessagingForward.cxx:24