15#ifndef TIDA_FEATURESTORE_H
16#define TIDA_FEATURESTORE_H
26class FeatureStore :
public std::map<std::string, TIDA::FeatureBase*> {
30 typedef std::map<std::string, FeatureBase*>
map_type;
37 const_iterator itr = begin();
38 const_iterator iend = end();
39 while( itr!=iend )
delete (itr++)->second;
44 void insert( T* t,
const std::string& key ) {
51 int find( T*& t,
const std::string& key ) {
71 iterator itr=map_type::find(key);
72 if ( itr!=end() )
return itr->second;
84 TIDA::FeatureStore::const_iterator itr = f.begin();
85 TIDA::FeatureStore::const_iterator iend = f.end();
87 if ( itr->first.size()>5 ) s <<
"\t[ " << itr->first <<
":\t" << itr->second <<
" ]\n";
88 else s <<
"\t[ " << itr->first <<
":\t\t" << itr->second <<
" ]\n";
std::ostream & operator<<(std::ostream &s, const TIDA::FeatureStore &f)
wrapper class to wrap objects such that they can be added to a generic store
very basic Feature base class just so that we can store derived classes onto the store
TIDA::FeatureBase * _find(const std::string &key)
void insert(T *t, const std::string &key)
std::map< std::string, FeatureBase * > map_type
int find(T *&t, const std::string &key)
void _insert(TIDA::FeatureBase *f, const std::string &key)
actual template of the Feature wrapper - stores a pointer to an object and inherits from FeatureBase