Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7130 in orxonox.OLD


Ignore:
Timestamp:
Feb 13, 2006, 2:59:17 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: removed some std::list

Location:
trunk/src
Files:
17 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/gui/gl_gui/glgui_box.cc

    r6287 r7130  
    1818#include "glgui_box.h"
    1919
    20 #include "list.h"
    21 
    2220using namespace std;
    2321
     
    3836GLGuiBox::~GLGuiBox()
    3937{
    40   delete this->children;
    4138}
    4239
     
    4744{
    4845  this->setClassID(CL_GLGUI_BOX, "GLGuiBox");
    49   this->children = new tList<GLGuiWidget>;
    5046}
    5147
     
    5551    return;
    5652
    57   this->children->add(widget);
     53  this->children.push_back(widget);
    5854}
    5955
     
    6359  if (widget == NULL)
    6460  {
    65     delete this->children;
    66     this->children = new tList<GLGuiWidget>;
     61    this->children.clear();
    6762  }
    6863  else
    6964  {
    70     this->children->remove(widget);
     65    this->children.remove(widget);
    7166  }
    7267}
     
    7469void GLGuiBox::showAll()
    7570{
    76   tIterator<GLGuiWidget>* itC = this->children->getIterator();
    77   GLGuiWidget* enumC = itC->firstElement();
    78   while (enumC != NULL)
     71  std::list<GLGuiWidget*>::iterator itC = this->children.begin();
     72  while (itC != this->children.end())
    7973  {
    80     if (enumC->isA(CL_GLGUI_CONTAINER))
    81       static_cast<GLGuiContainer*>(enumC)->showAll();
     74    if ((*itC)->isA(CL_GLGUI_CONTAINER))
     75      static_cast<GLGuiContainer*>(*itC)->showAll();
    8276    else
    83       enumC->show();
    84     enumC = itC->nextElement();
     77      (*itC)->show();
     78    itC++;
    8579  }
    86   delete itC;
    8780
    8881  this->show();
     
    9285void GLGuiBox::hideAll()
    9386{
    94   tIterator<GLGuiWidget>* itC = this->children->getIterator();
    95   GLGuiWidget* enumC = itC->firstElement();
    96   while (enumC != NULL)
     87  std::list<GLGuiWidget*>::iterator itC = this->children.begin();
     88  while (itC != this->children.end())
    9789  {
    98     if (enumC->isA(CL_GLGUI_CONTAINER))
    99       static_cast<GLGuiContainer*>(enumC)->showAll();
     90    if ((*itC)->isA(CL_GLGUI_CONTAINER))
     91      static_cast<GLGuiContainer*>(*itC)->hideAll();
    10092    else
    101       enumC->hide();
    102     enumC = itC->nextElement();
     93      (*itC)->hide();
     94    itC++;
    10395  }
    104   delete itC;
    10596
    10697  this->hide();
  • trunk/src/lib/gui/gl_gui/glgui_box.h

    r6287 r7130  
    1111
    1212// FORWARD DECLARATION
    13 template<class T> class tList;
    1413
    1514typedef enum
     
    4140 private:
    4241   GLGuiBoxType             type;
    43    tList<GLGuiWidget>*      children;
    44 
     42   std::list<GLGuiWidget*>  children;
    4543};
    4644
  • trunk/src/lib/particles/engine/particle_engine.cc

    r6619 r7130  
    2020#include "class_list.h"
    2121
    22 #include "list.h"
    2322#include "debug.h"
    2423#include "stdlibincl.h"
  • trunk/src/lib/particles/engine/particle_engine.h

    r6619 r7130  
    1111#include "particle_system.h"
    1212#include "particle_emitter.h"
     13#include <list>
    1314
    1415#include "parser/tinyxml/tinyxml.h"
    1516
    1617// FORWARD DECLARATION
    17 template<class T> class tList;
    1818
    1919//! A ParticleConnection enables us to emitt from any emitter into any other particleSystem
     
    6464  static ParticleEngine* singletonRef;        //!< The reference to the engine.
    6565
    66   tList<ParticleSystem>* systemList;          //!< A list of Systems handled by the ParticleEngine.
    67   tList<ParticleEmitter>* emitterList;        //!< A list of Emitters handled by the ParticleEngine.
     66  std::list<ParticleSystem> systemList;          //!< A list of Systems handled by the ParticleEngine.
     67  std::list<ParticleEmitter> emitterList;        //!< A list of Emitters handled by the ParticleEngine.
    6868
    6969  tList<ParticleConnection>* connectionList;  //!< A list of Connections between Systems and Emitters.
  • trunk/src/lib/physics/physics_engine.cc

    r5982 r7130  
    1919
    2020#include "class_list.h"
    21 #include "list.h"
    2221#include "parser/tinyxml/tinyxml.h"
    2322#include "factory.h"
  • trunk/src/lib/physics/physics_interface.cc

    r5257 r7130  
    2626#include "p_node.h"
    2727
    28 #include "list.h"
    2928#include "string.h"
    3029#include "stdincl.h"
  • trunk/src/subprojects/collision_detection/collision_detection.cc

    r5819 r7130  
    3131
    3232#include "graphics_engine.h"
    33 #include "list.h"
    34 
    3533
    3634Model* mod;
  • trunk/src/util/loading/load_param.cc

    r6613 r7130  
    1818#include "load_param.h"
    1919#include "load_param_description.h"
    20 
    21 #include "list.h"
    2220
    2321#include <stdarg.h>
  • trunk/src/util/loading/load_param.h

    r6981 r7130  
    3030
    3131// Forward Declaration //
    32 template<class T> class tList;
    3332class LoadClassDescription;
    3433class LoadParamDescription;
  • trunk/src/util/loading/load_param_description.cc

    r5691 r7130  
    1717
    1818#include "multi_type.h"
    19 #include "list.h"
    2019#include <stdarg.h>
    2120#include "stdlibincl.h"
     
    130129 *  A list, that holds all the classes that are loadable (classes not objects!!)
    131130 */
    132 tList<LoadClassDescription>* LoadClassDescription::classList = NULL;
     131std::list<LoadClassDescription*>* LoadClassDescription::classList = NULL;
    133132
    134133/**
     
    146145
    147146  if (LoadClassDescription::classList == NULL)
    148     LoadClassDescription::classList = new tList<LoadClassDescription>;
    149 
    150   LoadClassDescription::classList->add(this);
    151 
    152   this->paramList = new tList<LoadParamDescription>;
     147    LoadClassDescription::classList = new std::list<LoadClassDescription*>;
     148
     149  LoadClassDescription::classList->push_back(this);
    153150}
    154151
     
    158155LoadClassDescription::~LoadClassDescription()
    159156{
    160   tIterator<LoadParamDescription>* iterator = this->paramList->getIterator();
    161   LoadParamDescription* enumParamDesc = iterator->firstElement();
    162   while (enumParamDesc)
    163   {
    164     delete enumParamDesc;
    165     enumParamDesc = iterator->nextElement();
    166   }
    167   delete iterator;
    168   delete this->paramList;
     157  std::list<LoadParamDescription*>::iterator it = this->paramList.begin();
     158  while (!this->paramList.empty())
     159  {
     160    delete this->paramList.front();
     161    this->paramList.pop_front();
     162  }
    169163
    170164  delete[] this->className;
     
    175169  if (LoadClassDescription::classList != NULL)
    176170  {
    177     tIterator<LoadClassDescription>* iterator = LoadClassDescription::classList->getIterator();
    178     LoadClassDescription* delElem = iterator->firstElement();
    179     while (delElem != NULL)
    180     {
    181       delete delElem;
    182       delElem = iterator->nextElement();
    183     }
    184     delete iterator;
     171    while (!LoadClassDescription::classList->empty())
     172    {
     173      delete LoadClassDescription::classList->front();
     174      LoadClassDescription::classList->pop_front();
     175    }
    185176    delete LoadClassDescription::classList;
    186177  }
     
    200191  if (LoadClassDescription::classList != NULL)
    201192  {
    202     tIterator<LoadClassDescription>* iterator = LoadClassDescription::classList->getIterator();
    203     LoadClassDescription* enumClassDesc = iterator->firstElement();
    204     while (enumClassDesc)
    205     {
    206       if (!strcmp(enumClassDesc->className, className))
     193    std::list<LoadClassDescription*>::iterator it = LoadClassDescription::classList->begin();
     194    while (it != LoadClassDescription::classList->end())
     195    {
     196      if (!strcmp((*it)->className, className))
    207197      {
    208         delete iterator;
    209         return enumClassDesc;
    210       }
    211       enumClassDesc = iterator->nextElement();
    212     }
    213     delete iterator;
     198        return (*it);
     199      }
     200      it++;
     201    }
    214202  }
    215203  return new LoadClassDescription(className);
     
    222210LoadParamDescription* LoadClassDescription::addParam(const char* paramName)
    223211{
    224   tIterator<LoadParamDescription>* iterator = this->paramList->getIterator();
    225   LoadParamDescription* enumParamDesc = iterator->firstElement();
    226   while (enumParamDesc)
    227   {
    228     if (!strcmp(enumParamDesc->paramName, paramName))
    229     {
    230       delete iterator;
    231           //return enumParamDesc;
     212  std::list<LoadParamDescription*>::iterator it = this->paramList.begin();
     213  while (it != this->paramList.end())
     214  {
     215    if (!strcmp((*it)->paramName, paramName))
     216    {
    232217      return NULL;
    233218    }
    234     enumParamDesc = iterator->nextElement();
    235   }
    236   delete iterator;
     219    it++;
     220  }
    237221
    238222  LoadParamDescription* newParam = new LoadParamDescription(paramName);
    239223
    240   this->paramList->add(newParam);
     224  this->paramList.push_back(newParam);
    241225  return newParam;
    242226}
     
    253237  if (LoadClassDescription::classList != NULL)
    254238  {
    255     tIterator<LoadClassDescription>* classIT = LoadClassDescription::classList->getIterator();
    256     LoadClassDescription* enumClassDesc = classIT->firstElement();
    257     while (enumClassDesc)
    258     {
    259       PRINT(3)("<%s>\n", enumClassDesc->className);
    260       tIterator<LoadParamDescription>* paramIT = enumClassDesc->paramList->getIterator();
    261       LoadParamDescription* enumParamDesc = paramIT->firstElement();
    262       while (enumParamDesc)
     239    std::list<LoadClassDescription*>::iterator classDesc = LoadClassDescription::classList->begin();
     240    while (classDesc != LoadClassDescription::classList->end())
     241    {
     242      PRINT(3)("<%s>\n", (*classDesc)->className);
     243      std::list<LoadParamDescription*>::iterator param = (*classDesc)->paramList.begin();
     244      while (param != (*classDesc)->paramList.end())
    263245      {
    264         enumParamDesc->print();
    265         enumParamDesc = paramIT->nextElement();
    266       }
    267       delete paramIT;
    268 
    269       PRINT(3)("</%s>\n\n", enumClassDesc->className);
    270       enumClassDesc = classIT->nextElement();
    271     }
    272     delete classIT;
     246        (*param)->print();
     247        param++;
     248      }
     249      PRINT(3)("</%s>\n\n", (*classDesc)->className);
     250      classDesc++;
     251    }
    273252  }
    274253  else
     
    283262 * !! The strings MUST NOT be deleted !!
    284263 */
    285 tList<const char>* LoadClassDescription::searchClassWithShort(const char* classNameBegin)
    286 {
    287   unsigned int searchLength = strlen(classNameBegin);
    288   tList<const char>* retVal = new tList<const char>;
     264std::list<const char*> LoadClassDescription::searchClassWithShort(const char* classNameBegin)
     265{
     266  /// FIXME
     267  // NOT USED
     268/*  unsigned int searchLength = strlen(classNameBegin);
     269  std::list<const char*> retVal;
    289270
    290271  tIterator<LoadClassDescription>* iterator = LoadClassDescription::classList->getIterator();
     
    301282  delete iterator;
    302283
    303   return retVal;
    304 }
     284  return retVal;*/
     285}
  • trunk/src/util/loading/load_param_description.h

    r5708 r7130  
    2323
    2424#include "base_object.h"
     25#include <list>
    2526
    2627// Forward Declaration //
    27 template<class T> class tList;
    2828class MultiType;
    2929
     
    6868
    6969  static void printAll(const char* fileName = NULL);
    70   static tList<const char>* searchClassWithShort(const char* classNameBegin);
     70  static std::list<const char*> searchClassWithShort(const char* classNameBegin);
    7171//  static const LoadParamDescription* getClass(const char* className);
    7272
    7373 private:
    74   static bool                          parametersDescription;  //!< if parameter-description should be enabled.
    75   static tList<LoadClassDescription>* classList;              //!< a list, that stores all the loadable classes. (after one instance has been loaded)
    76   char*                                className;              //!< name of the class
     74  static bool                              parametersDescription;  //!< if parameter-description should be enabled.
     75  static std::list<LoadClassDescription*>* classList;              //!< a list, that stores all the loadable classes. (after one instance has been loaded)
     76  char*                                    className;              //!< name of the class
    7777
    78   tList<LoadParamDescription>*         paramList;              //!< List of parameters this class knows.
     78  std::list<LoadParamDescription*>         paramList;              //!< List of parameters this class knows.
    7979};
    8080
  • trunk/src/util/track/track_manager.cc

    r6512 r7130  
    2323#include "track_node.h"
    2424#include "stdincl.h"
    25 #include "list.h"
    2625#include "text.h"
    2726#include "t_animation.h"
  • trunk/src/util/track/track_manager.h

    r6981 r7130  
    2424class TiXmlElement;
    2525template<class T> class tAnimation;
    26 template<class T> class tList;
    2726
    2827// Static Definitions
  • trunk/src/world_entities/power_ups/param_power_up.cc

    r7065 r7130  
    1919#include "factory.h"
    2020#include "state.h"
    21 #include "list.h"
    2221
    2322#include "primitive_model.h"
  • trunk/src/world_entities/power_ups/weapon_power_up.cc

    r7077 r7130  
    1919#include "factory.h"
    2020#include "state.h"
    21 #include "list.h"
    2221#include "network_game_manager.h"
    2322
  • trunk/src/world_entities/weapons/cannon.cc

    r6811 r7130  
    3030
    3131#include "vector.h"
    32 #include "list.h"
    3332#include "animation3d.h"
    3433
  • trunk/src/world_entities/weapons/hyperblaster.cc

    r7076 r7130  
    2929#include "factory.h"
    3030
    31 #include "vector.h"
    32 #include "list.h"
    3331#include "animation3d.h"
    3432
Note: See TracChangeset for help on using the changeset viewer.