Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/core2/src/orxonox/OrxonoxStableHeaders.h @ 1421

Last change on this file since 1421 was 1001, checked in by landauf, 17 years ago

ok, be aware, here comes a big one. people with weak nerves should probably better look away or take some serious drugs.
this update includes partial and explicit class template specialization, partial and explicit specialized template function overloading, template meta programming and a simple typecast.
yeah right, a typecast. but let me explain the whole story from the beginning.

it all started with a simple problem: i had a double in a MultiType and wanted a float, but i always got 0. what was the problem? the conversion 'MultiType to anyting' was handled by the Converter class in util/Convert.h and the Converter was specialized for strings, multitypes, vectors and so on, but not for int, float, bool, …
so i've first wanted to implement a typecast as default, but this was a bad idea because it doesn't work for almost every generic type.
implementing an explicit specialization for every possible pair of primitives (did you ever happened to use an unsigned short? or a long double? no? ignorants :D) would have been a simple but ugly solution.
but there were other problems: if there's a rule to convert a string into anything and another rule to convert anything into an int - what happens if you want to convert a string into an int? compiler error! …ambiguous partial template specialization.
so i've spent days and nights to find a solution. this is my 5th try or so and i'm still really unsure if it works, but it's the first version i want to commit to have at least a backup.
if you're interested in looking at the code you better wait until i've cleaned up the whole thing, it's a real mess. and i want to do further tests, but now i'm tired. good night ;)

File size: 3.5 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *
4 *
5 *   License notice:
6 *
7 *   This program is free software; you can redistribute it and/or
8 *   modify it under the terms of the GNU General Public License
9 *   as published by the Free Software Foundation; either version 2
10 *   of the License, or (at your option) any later version.
11 *
12 *   This program is distributed in the hope that it will be useful,
13 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 *   GNU General Public License for more details.
16 *
17 *   You should have received a copy of the GNU General Public License
18 *   along with this program; if not, write to the Free Software
19 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
20 *
21 *   Author:
22 *      Reto Grieder
23 *   Co-authors:
24 *      ...
25 *
26 */
27
28/**
29 @file  OrxonoxStableHeaders.h
30 @brief Contains the bigger (or smaller) header files in order to precompile them with MSVC
31 */
32
33#ifndef _OrxonoxStableHeaders_H__
34#define _OrxonoxStableHeaders_H__
35
36#include "OrxonoxPlatform.h"
37
38#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
39
40// including std headers here is useless since they're already precompiled
41
42// not including the entire Ogre.h doesn't exceed the default heap size for pch
43//#include <Ogre.h>
44#include <OgreBillboardSet.h>
45#include <OgreCamera.h>
46#include <OgreConfigFile.h>
47#include <OgreEntity.h>
48#include <OgreException.h>
49#include <OgreFrameListener.h>
50#include <OgreLight.h>
51#include <OgreOverlay.h>
52#include <OgreOverlayElement.h>
53#include <OgreOverlayManager.h>
54#include <OgreParticleEmitter.h>
55#include <OgreParticleSystem.h>
56#include <OgrePlatform.h>
57#include <OgrePrerequisites.h>
58#include <OgreRenderWindow.h>
59#include <OgreRoot.h>
60#include <OgreSceneManager.h>
61#include <OgreSceneNode.h>
62#include <OgreStringConverter.h>
63#include <OgreTextureManager.h>
64#include <OgreViewport.h>
65
66#include <OIS/OIS.h>
67
68/**
69* Some of the not so stable header files.
70* But it's not very useful to include them anyway..
71**/
72
73//#include "audio/AudioManager.h"
74
75//#include "core/CoreIncludes.h"
76#include "core/BaseObject.h"
77//#include "core/ArgReader.h"
78#include "core/Error.h"
79
80#include "network/Synchronisable.h"
81//#include "network/Server.h"
82//#include "network/Client.h"
83
84#include "util/Math.h"
85#include "util/Sleep.h"
86#include "util/String2Number.h"
87#include "util/Tokenizer.h"
88#include "util/tinyxml/ticpp.h"
89#include "util/tinyxml/tinyxml.h"
90
91//#include "hud/HUD.h"
92//#include "loader/LevelLoader.h"
93//#include "objects/weapon/AmmunitionDump.h"
94//#include "objects/weapon/BarrelGun.h"
95//#include "objects/weapon/Bullet.h"
96//#include "objects/weapon/BulletManager.h"
97//#include "objects/weapon/WeaponStation.h"
98//#include "objects/Ambient.h"
99//#include "objects/Camera.h"
100//#include "objects/Explosion.h"
101//#include "objects/Fighter.h"
102#include "objects/Model.h"
103//#include "objects/NPC.h"
104//#include "objects/Projectile.h"
105//#include "objects/Skybox.h"
106//#include "objects/SpaceShipSteeringObject.h"
107#include "objects/Tickable.h"
108#include "objects/WorldEntity.h"
109//#include "particle/ParticleInterface.h"
110//#include "tools/BillboardSet.h"
111//#include "tools/Light.h"
112//#include "tools/Mesh.h"
113//#include "tools/Timer.h"
114//#include "GraphicsEngine.h"
115//#include "InputManager.h"
116//#include "Orxonox.h"
117//#include "SpaceshipSteering.h"
118
119#endif
120
121#endif /* _OrxonoxStableHeaders_H__ */
Note: See TracBrowser for help on using the repository browser.