Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 22, 2006, 1:16:23 PM (18 years ago)
Author:
bensch
Message:

adapted many classes to the new ClassID System, now comes the hard part… Scripting… then Network… wow this will be so bad :/

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/lang/new_class_id.cc

    r9681 r9685  
    1717
    1818#include "new_class_id.h"
    19 #include <cassert>
    20 #include "debug.h"
    21 
    22 ///////////////////////////////////////////////////////////
    23 //// CLASS ID definiton. //////////////////////////////////
    24 ///////////////////////////////////////////////////////////
    25 /**
    26  * @brief standard constructor
    27  */
    28 NewClassID::NewClassID ()
    29 {}
    30 
    31 
    32 /**
    33  * @brief standard deconstructor
    34  */
    35 NewClassID::~NewClassID ()
    36 {
    37   ClassList::iterator it;
    38   for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
    39   {
    40     (*it)._objectList->unregisterObject((*it)._iterator);
    41     delete (*it)._iterator;
    42   }
    43 }
    44 
    45 
    46 /**
    47  * @brief Seeks in the Inheritance if it matches objectList.
    48  * @param objectList The ObjectList this should be a member of (by Pointer-comparison).
    49  * @return True if found, false if not.
    50  */
    51 bool NewClassID::isA(const NewObjectListBase& objectList) const
    52 {
    53   ClassList::const_iterator it;
    54   for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
    55     if ((*it)._objectList == &objectList)
    56       return true;
    57   return false;
    58 }
    59 
    60 /**
    61  * @brief Seeks in the Inheritance if it matches objectList.
    62  * @param classID The ClassID of the class this should be a member of.
    63  * @return True if found, false if not.
    64  */
    65 bool NewClassID::isA(int classID) const
    66 {
    67   ClassList::const_iterator it;
    68   for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
    69     if (*(*it)._objectList == classID)
    70       return true;
    71   return false;
    72 }
    73 
    74 /**
    75  * @brief Seeks in the Inheritance if it matches objectList.
    76  * @param className The ClassName of the class this should be a member of.
    77  * @return True if found, false if not.
    78  */
    79 bool NewClassID::isA(const std::string& className) const
    80 {
    81   ClassList::const_iterator it;
    82   for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
    83     if (*(*it)._objectList == className)
    84       return true;
    85   return false;
    86 }
    87 
    88 
    89 void NewClassID::listInheritance() const
    90 {
    91   PRINT(0)("Listing inheritance diagram for ....: ");
    92   ClassList::const_iterator it;
    93   for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
    94     PRINT(0)(" -> %s(id:%d)", (*it)._objectList->name().c_str(), (*it)._objectList->id());
    95   PRINT(0)("\n");
    96 
    97 }
Note: See TracChangeset for help on using the changeset viewer.