Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3544 in orxonox.OLD for orxonox


Ignore:
Timestamp:
Mar 14, 2005, 10:54:00 AM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: now the delete-process is as inteded by c++
virtual ~ClassName extends deletion and deletes also the MasterClass

Location:
orxonox/trunk/src
Files:
36 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/src/ability.h

    r3224 r3544  
    1010 public:
    1111  Ability ();
    12   ~Ability ();
     12  virtual ~Ability ();
    1313
    1414};
  • orxonox/trunk/src/ai/ai.h

    r3481 r3544  
    99 public:
    1010  AI ();
    11   ~AI ();
     11  virtual ~AI ();
    1212
    1313};
  • orxonox/trunk/src/camera.cc

    r3543 r3544  
    5151Camera::~Camera ()
    5252{
    53   this->destroy();
    54 }
    55 
    56 /**
    57    \brief deletes all allocated memory
    58 */
    59 void Camera::destroy(void)
    60 {
    6153  this->bound = NULL;
    6254  this->world = NULL;
    6355
    64   static_cast<WorldEntity*>(this)->destroy();
    6556}
    6657
  • orxonox/trunk/src/camera.h

    r3543 r3544  
    5555  Camera (World* world);
    5656  virtual ~Camera ();
    57   void destroy(void);
    5857 
    5958  void timeSlice (Uint32 deltaT);
  • orxonox/trunk/src/glmenu/glmenu_imagescreen.cc

    r3543 r3544  
    4646/**
    4747   \brief standard deconstructor
     48   \todo this deconstructor is not jet implemented - do it
    4849*/
    4950GLMenuImageScreen::~GLMenuImageScreen()
    50 {
    51   this->destroy();
    52 }
    53 
    54 /**
    55    \brief deletes all alocated Memory and also deletes everything from the Class this one is erived from
    56 
    57    \todo this deconstructor is not jet implemented - do it
    58 */
    59 void GLMenuImageScreen::destroy(void)
    6051{
    6152  if (backMat)
    6253    delete backMat;
    63 
    64   static_cast<BaseObject*>(this)->destroy();
    6554}
    6655
  • orxonox/trunk/src/glmenu/glmenu_imagescreen.h

    r3543 r3544  
    1818
    1919 public:
    20   ~GLMenuImageScreen ();
    21   void destroy(void);
    22 
     20  virtual ~GLMenuImageScreen ();
     21 
    2322  static GLMenuImageScreen* getInstance();
    2423
  • orxonox/trunk/src/lib/coord/helper_parent.cc

    r3533 r3544  
    4141HelperParent::~HelperParent ()
    4242{
    43   this->destroy();
     43
    4444}
    45 
    46 
    47 /**
    48    \brief destroys all allocated memory
    49 */
    50 void HelperParent::destroy(void)
    51 {
    52 
    53 
    54   static_cast<PNode*>(this)->destroy();
    55 }
  • orxonox/trunk/src/lib/coord/helper_parent.h

    r3533 r3544  
    1818  HelperParent ();
    1919  virtual ~HelperParent ();
    20   void destroy(void);
    2120
    2221};
  • orxonox/trunk/src/lib/coord/null_parent.cc

    r3543 r3544  
    6161NullParent::~NullParent ()
    6262{
    63   this->destroy();
    64 }
    65 
    66 /**
    67    \brief destroys all allocated memory
    68 */
    69 void NullParent::destroy(void)
    70 {
    7163  //delete singletonRef;
    7264  singletonRef = NULL;
    73 
    74   static_cast<PNode*>(this)->destroy();
    7565}
    76 
    77 
    7866
    7967/**
  • orxonox/trunk/src/lib/coord/null_parent.h

    r3533 r3544  
    1717  static NullParent* getInstance ();
    1818  virtual ~NullParent ();
    19   void destroy(void);
    20  
    2119
    2220  static NullParent* singletonRef;
  • orxonox/trunk/src/lib/coord/p_node.cc

    r3543 r3544  
    113113  /* there is currently a problem with cleaning up - fix*/
    114114
    115   this->destroy();
     115  PNode* pn = this->children->enumerate();
     116  while( pn != NULL)
     117    {
     118      pn = this->children->nextElement();
     119      delete pn;
     120    }
     121  /* this deletes all children in the list */
     122  delete this->children;
     123
    116124}
    117125
     
    122130   cleans up all pnodes
    123131*/
     132/*
    124133void PNode::destroy ()
    125134{
     
    130139      pn = this->children->nextElement();
    131140    }
    132   /* this deletes all children in the list */
     141  // this deletes all children in the list
    133142  this->children->destroy ();
    134143
    135144  static_cast<BaseObject*>(this)->destroy();
    136145}
    137 
     146*/
    138147
    139148/**
  • orxonox/trunk/src/lib/coord/p_node.h

    r3543 r3544  
    4141  PNode (Vector* absCoordinate, PNode* pNode);
    4242  virtual ~PNode ();
    43 
    44   void destroy ();
    4543
    4644  PNode* parent;            //!< a pointer to the parent node
  • orxonox/trunk/src/lib/lang/base_object.cc

    r3531 r3544  
    3737BaseObject::~BaseObject ()
    3838{
    39   this->destroy();
    40 }
    4139
    42 /**
    43     \brief destorys everything BaseObject allocated
    44 */
    45 void BaseObject::destroy(void)
    46 {
    47   //  delete []this->className;
    4840}
    4941
  • orxonox/trunk/src/lib/lang/base_object.h

    r3531 r3544  
    1717  virtual ~BaseObject ();
    1818
    19   void destroy(void);
    20 
    2119  void setClassName (char* className);
    2220  char* getClassName(void) const;
  • orxonox/trunk/src/light.cc

    r3543 r3544  
    5252Light::~Light ()
    5353{
    54   this->destroy();
    55 }
    56 
    57 
    58 /**
    59    \brief frees all alocated memory
    60 
    61    and in this case also deletes the lightSources and GL_LIGHTING
    62 */
    63 void Light::destroy(void)
    64 {
    6554  glDisable(GL_LIGHTING);
    6655 
     
    6958  delete lights;
    7059  Light::singletonRef = NULL;
    71 
    72   static_cast<WorldEntity*>(this)->destroy();
    73 }
    74 
     60}
    7561
    7662/**
  • orxonox/trunk/src/light.h

    r3543 r3544  
    6161  static Light* getInstance();
    6262  virtual ~Light(void);
    63   void destroy(void);
    64 
    6563
    6664  // set Attributes
  • orxonox/trunk/src/orxonox.cc

    r3543 r3544  
    4848Orxonox::~Orxonox ()
    4949{
    50   this->destroy();
    51 }
    52 
    53 /**
    54    \brief destroys orxonox. Frees al memory and so on.
    55 */
    56 void Orxonox::destroy(void)
    57 {
    5850  Orxonox::singletonRef = NULL;
    5951  if( world != NULL) delete world;
     
    6153  if( localcamera != NULL) delete localcamera;
    6254  if( resources != NULL) delete resources;
    63 
    64  
    6555}
    6656
  • orxonox/trunk/src/orxonox.h

    r3543 r3544  
    2525  Orxonox ();
    2626  virtual ~Orxonox ();
    27   void destroy(void);
    2827
    2928  char configfilename[256];   //!< Filename of the configuration-file.
  • orxonox/trunk/src/proto_class.cc

    r3543 r3544  
    4040ProtoClass::~ProtoClass ()
    4141{
    42   this->destroy();
    43 }
    44 
    45 /**
    46    \brief deletes all data and also deletes all data from the class this is derived from
    47 */
    48 ProtoClass::~destroy(void)
    49 {
    5042  // delete what has to be deleted here
    51   static_cast<BaseObject*>(this)->destroy();
    5243}
    5344
  • orxonox/trunk/src/proto_class.h

    r3543 r3544  
    2929  ProtoClass();
    3030  virtual ~ProtoClass();
    31   void destroy(void)
    3231
    3332  bool doNonSense (int nothing);
  • orxonox/trunk/src/story_entities/campaign.h

    r3472 r3544  
    1313 public:
    1414  Campaign ();
    15   ~Campaign ();
     15  virtual ~Campaign ();
    1616
    1717  StoryEntity* currentEntity;
  • orxonox/trunk/src/story_entities/world.cc

    r3543 r3544  
    6969  cn->reset();
    7070
    71   this->localCamera->destroy();
    72   this->nullParent->destroy();
     71  delete this->localCamera;
    7372  delete this->nullParent;
    7473  //delete this->skySphere;
     
    665664  p4->debug ();
    666665
    667   p1->destroy ();
     666  delete p1;
    668667 
    669668 
  • orxonox/trunk/src/track_manager.cc

    r3543 r3544  
    226226TrackManager::~TrackManager(void)
    227227{
    228   this->destroy();
    229 }
    230 
    231 /**
    232    \brief deletes all alocated Memory and also deletes everything from the Class this one is erived from
    233 */
    234 void TrackManager::destroy(void)
    235 {
    236228  PRINTF(3)("Destruct TrackManager\n");
    237229
     
    241233  // we do not have a TrackManager anymore
    242234  singletonRef = NULL;
    243  
    244   static_cast<BaseObject*>(this)->destroy();
    245235}
    246236
  • orxonox/trunk/src/track_manager.h

    r3543 r3544  
    122122 public:
    123123  virtual ~TrackManager(void);
    124   void destroy(void);
     124
    125125  static TrackManager* getInstance(void);
    126126
  • orxonox/trunk/src/track_node.cc

    r3533 r3544  
    6666TrackNode::~TrackNode ()
    6767{
    68   this->destroy();
     68  singletonRef = NULL;
    6969}
    70 
    71 /**
    72    \brief destroys the TrackNode and all its alocated memory.
    73 */
    74 void TrackNode::destroy(void)
    75 {
    76   singletonRef = NULL;
    77  
    78   static_cast<PNode*>(this)->destroy();
    79 }
  • orxonox/trunk/src/track_node.h

    r3533 r3544  
    2222  static TrackNode* getInstance ();
    2323  virtual ~TrackNode ();
    24   void destroy();
    2524
    2625 private:
  • orxonox/trunk/src/world_entities/environment.h

    r3472 r3544  
    1818 public:
    1919  Environment ();
    20   ~Environment ();
     20  virtual ~Environment ();
    2121
    2222 
  • orxonox/trunk/src/world_entities/npc.h

    r3531 r3544  
    1212  NPC ();
    1313  ~NPC ();
    14   void destroy(void);
    1514
    1615  /* collision control */
  • orxonox/trunk/src/world_entities/player.cc

    r3535 r3544  
    3333
    3434/**
    35    \brief destructs the player
     35   \brief destructs the player, deletes alocated memory
    3636*/
    3737Player::~Player ()
    3838{
    39   this->destroy();
    40 }
    41 
    42 /**
    43    \brief deletes all allocated memory of the Player
    44 */
    45 void Player::destroy ()
    46 {
    4739  delete this->model;
    48 
    49   static_cast<WorldEntity*>(this)->destroy();
    5040}
    5141
  • orxonox/trunk/src/world_entities/player.h

    r3531 r3544  
    1919  Player(bool isFree = false);
    2020  virtual ~Player();
    21   void destroy();
    2221 
    2322  virtual void postSpawn();
  • orxonox/trunk/src/world_entities/power_up.h

    r3483 r3544  
    1515 public:
    1616  PowerUp ();
    17   ~PowerUp ();
     17  virtual ~PowerUp ();
    1818 
    1919};
  • orxonox/trunk/src/world_entities/primitive.cc

    r3537 r3544  
    3939}
    4040
    41 void Primitive::destroy ()
    42 {
    43 
    44 
    45   static_cast<WorldEntity*>(this)->destroy();
    46 }
    47 
    48 
    4941void Primitive::tick (float time)
    5042{
  • orxonox/trunk/src/world_entities/primitive.h

    r3531 r3544  
    1313  Primitive (PRIMITIVE_FORM form);
    1414  virtual ~Primitive ();
    15   void destroy(void);
    1615
    1716  virtual void tick (float time);
  • orxonox/trunk/src/world_entities/skysphere.cc

    r3536 r3544  
    5757Skysphere::~Skysphere()
    5858{
    59   this->destroy();
    60 }
    61 
    62 void Skysphere::destroy(void)
    63 {
    64 
    6559  PRINTF(3)("Deleting the SkySphere\n");
    66   delete skyMaterial;
    67   free(sphereObj);
    68  
    69   static_cast<WorldEntity*>(this)->destroy();
     60  delete this->skyMaterial;
     61  free(this->sphereObj);
    7062}
    7163
  • orxonox/trunk/src/world_entities/world_entity.cc

    r3531 r3544  
    4747{
    4848  // if( collisioncluster != NULL) delete collisioncluster;
    49   this->destroy();
    50 }
    51 
    52 /**
    53    \brief Function to call if a WorldEntity is destroyed. deletes all alocated memory.
    54    */
    55 void WorldEntity::destroy()
    56 {
    57 
    58   // delete everything of pNode.
    59   static_cast<PNode*>(this)->destroy();
    60 }
    61 
     49
     50}
    6251
    6352/**
  • orxonox/trunk/src/world_entities/world_entity.h

    r3531 r3544  
    2121  WorldEntity (bool isFree = false);
    2222  virtual ~WorldEntity ();
    23   void destroy ();
    2423
    2524
Note: See TracChangeset for help on using the changeset viewer.