1#ifndef AAOBJECTINCLUDED 
    2#define AAOBJECTINCLUDED 
   29  int idx( 
const std::string& key )
 const 
 
   42  bool haveusr( 
const std::string& key )
 const 
   44    return idx( key ) >= 0;
 
 
   59      THROW(
Exception, 
"No user data for key " << key << 
" in aanet object of type " << 
this -> ClassName());
 
 
   72  double getusr(
const std::string& key)
 const 
   74    const int i = 
idx( key );
 
   78      THROW(
Exception, 
"No user data for key " << key << 
" in aanet object of type " << 
this -> ClassName());
 
   81    if ( 
unsigned(i) >= 
usr.size() )
 
   83      THROW(
Exception, 
"Warning: inconsistent user data " << i << 
" >= " << 
usr.size());
 
 
   95  void setusr(
const std::string & key, 
double value )
 
  112      usr.push_back( value );
 
 
  129    if ( i < 0 ) 
return false;
 
  131    usr.erase ( 
usr.begin() + i );
 
 
  154    for (
unsigned i = 0; i < n ; i++)
 
  156      std::string name = 
"(unnamed)";
 
  158      out << i << 
" \t " << name << 
" : \t ";
 
  159      if ( i < 
usr.size() ) out << 
usr[i] << std::endl;
 
  160      else                  out << 
"(none)" << std::endl;
 
 
 
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
 
#define ClassDef(name, version)
 
AAObject is a base class for I/O-classes that adds the possibility to add 'user' information which wi...
 
bool haveusr(const std::string &key) const
Check availability of user data of the item with given key.
 
void clearusr()
Clear user data.
 
TObject * any
Pointer to "any" user data.
 
bool delusr(const std::string &key)
Remove (first) user data item with given key.
 
int idx(const std::string &key) const
Get index in user data of the item with given key.
 
AAObject()
Default constructor.
 
void printusr(std::ostream &out=std::cout)
Print user data (i.e.
 
void setusr(const std::string &key, double value)
Set user data item with given key.
 
double getusr(const std::string &key) const
Get user data item with given key.
 
std::vector< std::string > usr_names
user keys
 
int idxusr_checked(const std::string &key) const
Get index in user data of the item with given key.
 
std::vector< double > usr
user data