Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9661 in orxonox.OLD for trunk/src/lib/lang/new_class_list.cc


Ignore:
Timestamp:
Aug 20, 2006, 12:21:18 PM (18 years ago)
Author:
bensch
Message:

renamings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/lang/new_class_list.cc

    r9660 r9661  
    2020
    2121
    22 NewClassListBase::NewClassListBase(const std::string& className)
    23   : _id(-1), _name(className)
     22NewObjectListBase::NewObjectListBase(const std::string& className)
     23    : _id(-1), _name(className)
     24{
     25  if (NewObjectListBase::_classes == NULL)
     26    NewObjectListBase::_classes = new cList;
     27  assert(!NewObjectListBase::exists(className) && "Classes should not be included once, and no two classes should have the same name (key value)");
     28
     29
     30
     31}
     32
     33NewObjectListBase::~NewObjectListBase()
    2434{
    2535
    2636}
     37
     38int NewObjectListBase::_idCounter = 0;
     39NewObjectListBase::cList* NewObjectListBase::_classes = NULL;
     40
     41
     42
     43/**
     44 * @brief Checks if a Class with name already exists.
     45 * @param name The Name of the Class to check.
     46 * @return true if such a class already exists.
     47 */
     48bool NewObjectListBase::exists(const std::string& name)
     49{
     50  cList::iterator it;
     51  for (it = NewObjectListBase::_classes->begin(); it != NewObjectListBase::_classes->end(); it++)
     52    if(*it != NULL && (*it)->name() != name)
     53      return true;
     54  return false;
     55}
Note: See TracChangeset for help on using the changeset viewer.