ATLAS Offline Software
Loading...
Searching...
No Matches
TIDA::FeatureStore Class Reference

#include <TIDAFeatureStore.h>

Inheritance diagram for TIDA::FeatureStore:
Collaboration diagram for TIDA::FeatureStore:

Public Types

typedef std::map< std::string, FeatureBase * > map_type

Public Member Functions

 FeatureStore ()
 ~FeatureStore ()
template<typename T>
void insert (T *t, const std::string &key)
template<typename T>
int find (T *&t, const std::string &key)

Public Attributes

keys
 STL member.
elements
 STL member.

Private Member Functions

void _insert (TIDA::FeatureBase *f, const std::string &key)
TIDA::FeatureBase_find (const std::string &key)

Detailed Description

Definition at line 26 of file TIDAFeatureStore.h.

Member Typedef Documentation

◆ map_type

typedef std::map<std::string, FeatureBase*> TIDA::FeatureStore::map_type

Definition at line 30 of file TIDAFeatureStore.h.

Constructor & Destructor Documentation

◆ FeatureStore()

TIDA::FeatureStore::FeatureStore ( )
inline

Definition at line 34 of file TIDAFeatureStore.h.

34{ }

◆ ~FeatureStore()

TIDA::FeatureStore::~FeatureStore ( )
inline

Definition at line 36 of file TIDAFeatureStore.h.

36 {
37 const_iterator itr = begin();
38 const_iterator iend = end();
39 while( itr!=iend ) delete (itr++)->second;
40 }

Member Function Documentation

◆ _find()

TIDA::FeatureBase * TIDA::FeatureStore::_find ( const std::string & key)
inlineprivate

Definition at line 70 of file TIDAFeatureStore.h.

70 {
71 iterator itr=map_type::find(key);
72 if ( itr!=end() ) return itr->second;
73 else return 0;
74 }

◆ _insert()

void TIDA::FeatureStore::_insert ( TIDA::FeatureBase * f,
const std::string & key )
inlineprivate

Definition at line 66 of file TIDAFeatureStore.h.

66 {
67 map_type::insert( value_type( key, f ) );
68 }

◆ find()

template<typename T>
int TIDA::FeatureStore::find ( T *& t,
const std::string & key )
inline

Definition at line 51 of file TIDAFeatureStore.h.

51 {
52 TIDA::FeatureBase* f = _find(key);
53 if ( f ) {
54 TIDA::Feature<T>* fdptr = dynamic_cast<TIDA::Feature<T>*>(f);
55 if ( fdptr ) {
56 t = fdptr->cptr();
57 return 0;
58 }
59 else return -2;
60 }
61 return -1;
62 }
TIDA::FeatureBase * _find(const std::string &key)

◆ insert()

template<typename T>
void TIDA::FeatureStore::insert ( T * t,
const std::string & key )
inline

Definition at line 44 of file TIDAFeatureStore.h.

44 {
45 TIDA::Feature<T>* tt = new TIDA::Feature<T>(t);
46 _insert( tt, key );
47 }
void _insert(TIDA::FeatureBase *f, const std::string &key)

Member Data Documentation

◆ elements

T std::map< K, T >::elements
inherited

STL member.

◆ keys

K std::map< K, T >::keys
inherited

STL member.


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