#include <iostream>#include <cmath>#include <LEDA/list.h>#include <LEDA/string.h>#include "SUtil.h"Include dependency graph for STypeInfo.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.
Compounds | |
| class | STypeInfo | 
Defines | |
| #define | TYPEINFOSTART | 
| #define | dbgOn false | 
| #define | TYPEINFOEND(theName, theClassifier) | 
| #define | TYPEINFO0(theName, theClassifier) | 
| #define | TYPEINFO1(theName, theClassifier, theSuper1) | 
| #define | TYPEINFO2(theName, theClassifier, theSuper1, theSuper2) | 
| #define | TYPEINFO3(theName, theClassifier, theSuper1, theSuper2, theSuper3) | 
| #define | TYPEINFOVAR(theName) | 
      
  | 
  
| 
 
  | 
  
      
  | 
  
| 
 Value: TYPEINFOSTART \ TYPEINFOEND(theName, theClassifier) 
 
  | 
  
      
  | 
  
| 
 Value: TYPEINFOSTART \ l = theSuper1::getTypeInfo(); \ _ancesAndSelf.conc(l); \ TYPEINFOEND(theName, theClassifier) 
 
  | 
  
      
  | 
  
| 
 Value: TYPEINFOSTART \ l = theSuper1::getTypeInfo(); \ _ancesAndSelf.conc(l); \ l = theSuper2::getTypeInfo(); \ _ancesAndSelf.conc(l); \ TYPEINFOEND(theName, theClassifier) 
 
  | 
  
      
  | 
  
| 
 Value: TYPEINFOSTART \ l = theSuper1::getTypeInfo(); \ _ancesAndSelf.conc(l); \ l = theSuper2::getTypeInfo(); \ _ancesAndSelf.conc(l); \ l = theSuper3::getTypeInfo(); \ _ancesAndSelf.conc(l); \ TYPEINFOEND(theName, theClassifier) 
 
  | 
  
      
  | 
  
| 
 Value: _ancesAndSelf.sort();             \
    _ancesAndSelf.unique();             \
    _ancesAndSelf.append(theClassifier);          \
    dbgVar("ancesAndSelf", _ancesAndSelf);                                      \
    _validAncesAndSelf = true;                                                  \
    return _ancesAndSelf;             \
  };                    \
  virtual leda_string getClassifier() const { return theClassifier; };          \
  virtual bool isInstanceOf(const leda_string &classifier) const {              \
    return ( NULL != theName::getTypeInfo().search(classifier) );   \
  };                    \
  virtual void assureInstanceOf(const leda_string &classifier) const {    \
    if( !isInstanceOf(classifier) ) {                                           \
      std::cerr << "You tried to use an object of the class \""           \
           << theClassifier << "\" as an instance of the \"" << classifier  \
     << "\" class" << std::endl;                                          \
      std::cerr << "A cast isn't possible here!" << std::endl                   \
     << "This object is an instance of:" << std::endl                     \
     << theName::getTypeInfo() << std::endl;              \
      exit(1);                  \
    }                   \
  } | 
  
      
  | 
  
| 
 Value: private: \ static bool _validAncesAndSelf; \ static leda_list<leda_string> _ancesAndSelf; \ public: \ static const leda_list<leda_string> &getTypeInfo() { \ if( _validAncesAndSelf ) \ return _ancesAndSelf; \ \ leda_list<leda_string> l;  | 
  
      
  | 
  
| 
 Value: bool theName::_validAncesAndSelf = false; \ leda_list<leda_string> theName::_ancesAndSelf; 
 
  | 
  
1.2.18