Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/lib/util/multi_type.cc @ 5536

Last change on this file since 5536 was 5536, checked in by bensch, 18 years ago

orxonox/trunk: added class MultiType, for multi-typed Atrribute handling… working

File size: 1.0 KB
Line 
1/*
2   orxonox - the future of 3D-vertical-scrollers
3
4   Copyright (C) 2004 orx
5
6   This program is free software; you can redistribute it and/or modify
7   it under the terms of the GNU General Public License as published by
8   the Free Software Foundation; either version 2, or (at your option)
9   any later version.
10
11   ### File Specific:
12   main-programmer: ...
13   co-programmer: ...
14*/
15
16//#define DEBUG_SPECIAL_MODULE DEBUG_MODULE_
17
18#include "multi_type.h"
19#include "stdincl.h"
20
21using namespace std;
22
23MultiType::MultiType(int value)
24{
25  this->type = M_Int;
26  this->value.typeInt = value;
27}
28
29
30MultiType::MultiType(float value)
31{
32  this->type = M_Float;
33  this->value.typeFloat = value;
34}
35
36
37MultiType::MultiType(char value)
38{
39  this->type = M_Char;
40  this->value.typeChar = value;
41}
42
43
44MultiType::MultiType(const char* value)
45{
46  this->type = M_String;
47  this->value.typeString = new char[strlen(value)+1];
48  strcpy(this->value.typeString, value);
49}
50
51/**
52 * standard deconstructor
53*/
54MultiType::~MultiType ()
55{
56  // delete what has to be deleted here
57}
Note: See TracBrowser for help on using the repository browser.