Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/orxonox/trunk/src/lib/lang/base_object.cc @ 3531

Last change on this file since 3531 was 3531, checked in by bensch, 19 years ago

orxonox/trunk: all WorldEntities/PWodes now destroy all date they alocate.

this is done with a virtual destructor:
if PNode is deleted it calls for the delete of the virtual destructor, and deletes the data of it.

File size: 1.0 KB
Line 
1
2
3/*
4   orxonox - the future of 3D-vertical-scrollers
5
6   Copyright (C) 2004 orx
7
8   This program is free software; you can redistribute it and/or modify
9   it under the terms of the GNU General Public License as published by
10   the Free Software Foundation; either version 2, or (at your option)
11   any later version.
12
13   ### File Specific:
14   main-programmer: Patrick Boenzli
15   co-programmer: ...
16*/
17
18
19#include "base_object.h"
20
21
22using namespace std;
23
24
25/**
26   \brief standard constructor
27*/
28BaseObject::BaseObject () 
29{
30  this->className = NULL;
31}
32
33
34/**
35   \brief standard deconstructor
36*/
37BaseObject::~BaseObject () 
38{
39  this->destroy();
40}
41
42/**
43    \brief destorys everything BaseObject allocated
44*/
45void BaseObject::destroy(void)
46{
47  //  delete []this->className;
48}
49
50void BaseObject::setClassName (char* className)
51{
52  this->className = className;
53}
54
55char* BaseObject::getClassName(void) const
56{
57  return className;
58}
59
60bool BaseObject::isA (char* className)
61{
62  if( this->className == className)
63    return false;
64  return true;
65}
Note: See TracBrowser for help on using the repository browser.