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

#include <Feature.h>

Collaboration diagram for Trig::Feature< T >:

Public Types

typedef T ValueType
 $brief constructor of empty Feature More...
 
typedef T * PointerType
 
typedef link_or_not< T, is_storable_type< T >::value >::type link_type
 

Public Member Functions

 Feature ()
 
 Feature (const TypelessFeature &feat, const T *const feature)
 
 Feature (const TypelessFeature &feat, const std::shared_ptr< const T > &feature)
 
 Feature (Feature &&) noexcept=default
 Add move operator. More...
 
 Feature (const Feature &)=default
 Add copy operator. More...
 
Featureoperator= (const Feature &)=default
 
Featureoperator= (Feature &&)=default
 
 Feature (const T *feature, const HLT::TriggerElement *te, const std::string &label="", const bool own=false, const link_type link=link_type())
 constructor of valid Feature object More...
 
 ~Feature ()
 destructor taking care of removal More...
 
 operator const T * () const
 implicit conversion to object pointer More...
 
const T * cptr () const
 explicit conversion to object More...
 
 operator const HLT::TriggerElement * () const
 implicit conversion to TriggerElement More...
 
const HLT::TriggerElementte () const
 explicit conversion to TriggerElement More...
 
 operator const std::string () const
 implicit conversion to feature label More...
 
const std::string & label () const
 explicit conversion to feature label More...
 
bool empty () const
 test method to check if the object is truly there More...
 
bool owned () const
 
link_type link () const
 

Private Attributes

std::shared_ptr< const T > m_owning_feature
 
const T * m_feature
 
const HLT::TriggerElementm_te
 
std::string m_label
 
bool m_owned
 
link_type m_link
 

Detailed Description

template<class T>
class Trig::Feature< T >

is basic vehicle of object access in TDT

It is wrapped pointer to trigger object of given type (template argument).

It is also the point in the structure of navigation where certain objects is attached. This point is identified by HLT::TriggerElement and label of feature.

In C++ this class is very handy as it is convertible to HLT::TriggerElement or object through to it's conversion operators. This, in turn gives an access to the particular HLT hypothesis decision through the state of

See also
HLT::TriggerElement::getActiveState() .

More explicit access is also possible by cptr(), te() and label() methods. It is necessary in the python. If the access is unsuccessful for any reason i.e. actual lack of object the Feature::empty() returns true.

Definition at line 112 of file Feature.h.

Member Typedef Documentation

◆ link_type

template<class T >
typedef link_or_not<T,is_storable_type<T>::value >::type Trig::Feature< T >::link_type

Definition at line 121 of file Feature.h.

◆ PointerType

template<class T >
typedef T* Trig::Feature< T >::PointerType

Definition at line 118 of file Feature.h.

◆ ValueType

template<class T >
typedef T Trig::Feature< T >::ValueType

$brief constructor of empty Feature

Definition at line 117 of file Feature.h.

Constructor & Destructor Documentation

◆ Feature() [1/6]

template<class T >
Trig::Feature< T >::Feature ( )
inline

Definition at line 124 of file Feature.h.

125  : m_feature((const T*)0), m_te(0), m_label(""), m_owned(false) { }

◆ Feature() [2/6]

template<class T >
Trig::Feature< T >::Feature ( const TypelessFeature< T > &  feat,
const T *const  feature 
)
inline

Definition at line 127 of file Feature.h.

128  : m_feature(feature), m_te(feat.te()),
129  m_label(feat.label()), m_owned(false) { }

◆ Feature() [3/6]

template<class T >
Trig::Feature< T >::Feature ( const TypelessFeature< T > &  feat,
const std::shared_ptr< const T > &  feature 
)
inline

Definition at line 131 of file Feature.h.

132  : m_owning_feature(feature),
134  m_te(feat.te()), m_label(feat.label()), m_owned(true) { }

◆ Feature() [4/6]

template<class T >
Trig::Feature< T >::Feature ( Feature< T > &&  )
defaultnoexcept

Add move operator.

◆ Feature() [5/6]

template<class T >
Trig::Feature< T >::Feature ( const Feature< T > &  )
default

Add copy operator.

◆ Feature() [6/6]

template<class T >
Trig::Feature< T >::Feature ( const T *  feature,
const HLT::TriggerElement te,
const std::string &  label = "",
const bool  own = false,
const link_type  link = link_type() 
)
inline

constructor of valid Feature object

Definition at line 150 of file Feature.h.

151  : m_feature(feature), m_te(te), m_label(label), m_owned(own), m_link(link) {
152  //in Athena if we own this feature, it will be deleted by AnyTypeDeleter in CGM
153  //so we're fine by just setting the non-owning ptr.
154  }

◆ ~Feature()

template<class T >
Trig::Feature< T >::~Feature ( )
inline

destructor taking care of removal

Definition at line 160 of file Feature.h.

160  {
161  }

Member Function Documentation

◆ cptr()

template<class T >
const T* Trig::Feature< T >::cptr ( ) const
inline

explicit conversion to object

Definition at line 171 of file Feature.h.

171 { return m_feature; }

◆ empty()

template<class T >
bool Trig::Feature< T >::empty ( ) const
inline

test method to check if the object is truly there

Definition at line 196 of file Feature.h.

196 { return (!m_te || !m_feature); }

◆ label()

template<class T >
const std::string& Trig::Feature< T >::label ( ) const
inline

explicit conversion to feature label

Definition at line 191 of file Feature.h.

191 { return m_label; }

◆ link()

template<class T >
link_type Trig::Feature< T >::link ( ) const
inline

Definition at line 201 of file Feature.h.

201 {return m_link;}

◆ operator const HLT::TriggerElement *()

template<class T >
Trig::Feature< T >::operator const HLT::TriggerElement * ( ) const
inline

implicit conversion to TriggerElement

Definition at line 176 of file Feature.h.

176 { return m_te; }

◆ operator const std::string()

template<class T >
Trig::Feature< T >::operator const std::string ( ) const
inline

implicit conversion to feature label

Definition at line 186 of file Feature.h.

186 { return m_label; }

◆ operator const T *()

template<class T >
Trig::Feature< T >::operator const T * ( ) const
inline

implicit conversion to object pointer

Definition at line 166 of file Feature.h.

166 { return cptr(); }

◆ operator=() [1/2]

template<class T >
Feature& Trig::Feature< T >::operator= ( const Feature< T > &  )
default

◆ operator=() [2/2]

template<class T >
Feature& Trig::Feature< T >::operator= ( Feature< T > &&  )
default

◆ owned()

template<class T >
bool Trig::Feature< T >::owned ( ) const
inline

Definition at line 198 of file Feature.h.

198 { return m_owned; }

◆ te()

template<class T >
const HLT::TriggerElement* Trig::Feature< T >::te ( ) const
inline

explicit conversion to TriggerElement

Definition at line 181 of file Feature.h.

181 { return m_te; }

Member Data Documentation

◆ m_feature

template<class T >
const T* Trig::Feature< T >::m_feature
private

Definition at line 206 of file Feature.h.

◆ m_label

template<class T >
std::string Trig::Feature< T >::m_label
private

Definition at line 208 of file Feature.h.

◆ m_link

template<class T >
link_type Trig::Feature< T >::m_link
private

Definition at line 211 of file Feature.h.

◆ m_owned

template<class T >
bool Trig::Feature< T >::m_owned
private

Definition at line 209 of file Feature.h.

◆ m_owning_feature

template<class T >
std::shared_ptr<const T> Trig::Feature< T >::m_owning_feature
private

Definition at line 205 of file Feature.h.

◆ m_te

template<class T >
const HLT::TriggerElement* Trig::Feature< T >::m_te
private

Definition at line 207 of file Feature.h.


The documentation for this class was generated from the following file:
Trig::Feature::m_link
link_type m_link
Definition: Feature.h:211
Trig::Feature::link
link_type link() const
Definition: Feature.h:201
Trig::Feature::label
const std::string & label() const
explicit conversion to feature label
Definition: Feature.h:191
Trig::Feature::te
const HLT::TriggerElement * te() const
explicit conversion to TriggerElement
Definition: Feature.h:181
Trig::Feature::m_owned
bool m_owned
Definition: Feature.h:209
Trig::Feature::m_feature
const T * m_feature
Definition: Feature.h:206
Trig::Feature::m_owning_feature
std::shared_ptr< const T > m_owning_feature
Definition: Feature.h:205
Trig::Feature::m_te
const HLT::TriggerElement * m_te
Definition: Feature.h:207
Trig::Feature::m_label
std::string m_label
Definition: Feature.h:208
Trig::Feature::cptr
const T * cptr() const
explicit conversion to object
Definition: Feature.h:171