Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 30, 2007, 9:48:52 PM (17 years ago)
Author:
rgrieder
Message:
  • fixed multiple template instantiation problem under windows
  • removed some warnings by introducing explicit casts
Location:
code/branches/FICN/src/orxonox
Files:
42 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/orxonox/GraphicsEngine.h

    r715 r729  
    1313#include <OgreSceneManager.h>
    1414
     15#include "OrxonoxPrereqs.h"
     16
    1517
    1618namespace orxonox {
     
    1921   * graphics engine manager class
    2022 */
    21   class GraphicsEngine {
     23  class _OrxonoxExport GraphicsEngine {
    2224    public:
    2325      GraphicsEngine();
  • code/branches/FICN/src/orxonox/InputManager.h

    r673 r729  
    1616#include <OgreRenderWindow.h>
    1717
    18 class InputManager : public OIS::KeyListener, public OIS::MouseListener, public OIS::JoyStickListener {
     18#include "OrxonoxPrereqs.h"
     19
     20class _OrxonoxExport InputManager : public OIS::KeyListener, public OIS::MouseListener, public OIS::JoyStickListener {
    1921  public:
    2022    virtual ~InputManager( void );
  • code/branches/FICN/src/orxonox/Orxonox.cc

    r715 r729  
    7171#include "hud/HUD.h"
    7272#include "objects/weapon_system/BulletManager.h"
    73 
    7473#include "GraphicsEngine.h"
     74
    7575#include "Orxonox.h"
    76 
    7776
    7877namespace orxonox
  • code/branches/FICN/src/orxonox/Orxonox.h

    r717 r729  
    1515#include "OrxonoxPrereqs.h"
    1616#include "loader/LoaderPrereqs.h"
     17
    1718#include "GraphicsEngine.h"
    1819
     
    2930  };
    3031
    31   class Orxonox
     32  class _OrxonoxExport Orxonox
    3233  {
    3334    public:
  • code/branches/FICN/src/orxonox/OrxonoxPlatform.h

    r708 r729  
    116116#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
    117117
    118 // If we're not including this from a client build, specify that the stuff
    119 // should get exported. Otherwise, import it.
    120 #        if defined( ORXONOX_STATIC_LIB )
    121      // don't use exports/imports when building statically
    122 #    define _OrxonoxExport
    123 #    define _OrxonoxPrivate
    124 #  else
    125 #    if defined( ORXONOX_NONCLIENT_BUILD )
    126 #      define _OrxonoxExport __declspec( dllexport )
    127 #    else
    128 #      if defined( __MINGW32__ )
    129 #        define _OrxonoxExport
    130 #      else
    131 #               define _OrxonoxExport __declspec( dllimport )
    132 #      endif
    133 #    endif
    134 #    define _OrxonoxPrivate
    135 #  endif
    136118// Win32 compilers use _DEBUG for specifying debug builds.
    137119#  ifdef _DEBUG
     
    162144#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_LINUX || ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE
    163145
    164 // Enable GCC symbol visibility
    165 #  if defined( ORXONOX_GCC_VISIBILITY )
    166 #    define _OrxonoxExport  __attribute__ ((visibility("default")))
    167 #    define _OrxonoxPrivate __attribute__ ((visibility("hidden")))
    168 #  else
    169 #    define _OrxonoxExport
    170 #    define _OrxonoxPrivate
    171 #  endif
    172146
    173147// A quick define to overcome different names for the same function
  • code/branches/FICN/src/orxonox/OrxonoxPrereqs.h

    r708 r729  
    3636#include "OrxonoxPlatform.h"
    3737
     38//-----------------------------------------------------------------------
     39// Shared library settings
     40//-----------------------------------------------------------------------
     41#if (ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32) && !defined( ORXONOX_STATIC_BUILD )
     42#  ifdef ORXONOX_SHARED_BUILD
     43#    define _OrxonoxExport __declspec(dllexport)
     44#  else
     45#    if defined( __MINGW32__ )
     46#      define _OrxonoxExport
     47#    else
     48#      define _OrxonoxExport __declspec(dllimport)
     49#    endif
     50#  endif
     51#elif defined ( ORXONOX_GCC_VISIBILITY )
     52#  define _OrxonoxExport  __attribute__ ((visibility("default")))
     53#else
     54#  define _OrxonoxExport
     55#endif
     56
     57//-----------------------------------------------------------------------
     58// Forward declarations
     59//-----------------------------------------------------------------------
     60
    3861// classes that have not yet been put into a namespace
    3962class InputManager;
     
    5679namespace orxonox {
    5780  class Ambient;
    58   class BaseEntity;
    5981  class BaseObject;
    6082  class Camera;
    61   class Entity;
    6283  class GraphicsEngine;
    6384  class Mesh;
     
    6687  class OrxListener;
    6788  class Orxonox;
    68   class SceneNode;
    6989  class Skybox;
    7090  class SpaceShip;
    71   class SpaceshipSteeringObject;
    7291  class Tickable;
    7392  class TickFrameListener;
  • code/branches/FICN/src/orxonox/SpaceshipSteering.h

    r708 r729  
    22#define _SpaceShipSteering_H__
    33
    4 #include "OgrePrerequisites.h"
     4#include <OgrePrerequisites.h>
     5
     6#include "OrxonoxPrereqs.h"
    57
    68namespace orxonox
    79{
    8   class SpaceshipSteering
     10  class _OrxonoxExport SpaceshipSteering
    911  {
    1012  public:
  • code/branches/FICN/src/orxonox/core/CoreIncludes.h

    r708 r729  
    8888
    8989/**
     90    @brief Exports the necessary templates in order to make them available to all libraries.
     91    @param ClassName The name of the Class
     92    @param LibraryName The name of the Library
     93*/
     94#define ExportClass(ClassName, LibraryName) \
     95    template class _##LibraryName##Export orxonox::ClassIdentifier<ClassName>; \
     96    template class _##LibraryName##Export orxonox::ObjectList<ClassName>; \
     97    template class _##LibraryName##Export orxonox::ClassFactory<ClassName>
     98
     99/**
     100    @brief Exports the necessary templates in order to make them available to all libraries.
     101    @param ClassName The name of the Class
     102    @param LibraryName The name of the Library
     103*/
     104#define ExportAbstractClass(ClassName, LibraryName) \
     105    template class _##LibraryName##Export orxonox::ClassIdentifier<ClassName>; \
     106    template class _##LibraryName##Export orxonox::ObjectList<ClassName>
     107
     108/**
    90109    @brief Returns the Identifier of the given class.
    91110    @param ClassName The name of the class
  • code/branches/FICN/src/orxonox/core/DebugLevel.cc

    r728 r729  
    3131*/
    3232
    33 #include "CoreIncludes.h"
    3433#include "DebugLevel.h"
    3534
  • code/branches/FICN/src/orxonox/core/DebugLevel.h

    r708 r729  
    4141#include "OrxonoxClass.h"
    4242#include "OutputHandler.h"
     43#include "CoreIncludes.h"
    4344
    4445namespace orxonox
     
    6263            ConfigValueContainer* softDebugLevelContainer_; //!< The config value container for the debug level
    6364    };
     65    ExportAbstractClass(DebugLevel, Core);
    6466}
    6567
  • code/branches/FICN/src/orxonox/core/Identifier.h

    r723 r729  
    5454#include <map>
    5555#include <string>
     56#include <utility>
    5657
    5758#include "CorePrereqs.h"
  • code/branches/FICN/src/orxonox/core/Language.cc

    r728 r729  
    245245            if (lineString.compare("") != 0)
    246246            {
    247                 unsigned int pos = lineString.find('=');
     247                unsigned int pos = (unsigned int)lineString.find('=');
    248248
    249249                // Check if the length is at least 3 and if there's an entry before and behind the =
     
    288288            if (lineString.compare("") != 0)
    289289            {
    290                 unsigned int pos = lineString.find('=');
     290                unsigned int pos = (unsigned int)lineString.find('=');
    291291
    292292                // Check if the length is at least 3 and if there's an entry before and behind the =
  • code/branches/FICN/src/orxonox/core/Language.h

    r728 r729  
    8282            bool bTranslationSet_;                                  //!< True if the translation was set
    8383    };
     84    template class _CoreExport orxonox::ClassIdentifier<LanguageEntry>;
     85    template class _CoreExport orxonox::ObjectList<LanguageEntry>;
    8486
    8587    //! The Language class manges the language files and entries and stores the LanguageEntry objects in a map.
     
    108110            std::map<std::string, LanguageEntry*> languageEntries_; //!< A map to store all LanguageEntry objects and their name
    109111    };
     112    template class _CoreExport orxonox::ClassIdentifier<Language>;
     113    template class _CoreExport orxonox::ObjectList<Language>;
    110114}
    111115
  • code/branches/FICN/src/orxonox/core/ObjectList.h

    r698 r729  
    3939
    4040#include "CorePrereqs.h"
     41#include "Iterator.h"
    4142
    4243namespace orxonox
  • code/branches/FICN/src/orxonox/core/OrxonoxClass.h

    r715 r729  
    4141#include "CorePrereqs.h"
    4242#include "MetaObjectList.h"
    43 #include "Identifier.h"
     43#include "Iterator.h"
    4444
    4545namespace orxonox
     
    158158            bool bVisible_;                 //!< True = the object is visible
    159159    };
     160    template class _CoreExport orxonox::ClassIdentifier<OrxonoxClass>;
     161    template class _CoreExport orxonox::ObjectList<OrxonoxClass>;
    160162}
    161163
  • code/branches/FICN/src/orxonox/hud/HUD.h

    r715 r729  
    3838namespace orxonox
    3939{
    40   class HUD
     40  class _OrxonoxExport HUD
    4141  {
    4242  private:
  • code/branches/FICN/src/orxonox/objects/Ambient.cc

    r716 r729  
    4343namespace orxonox
    4444{
     45    // create a template instantiations
     46    //template class _OrxonoxExport ClassIdentifier<Ambient>;
     47
    4548    CreateFactory(Ambient);
    4649
  • code/branches/FICN/src/orxonox/objects/Ambient.h

    r708 r729  
    88namespace orxonox
    99{
    10     class Ambient : public BaseObject
     10    class _OrxonoxExport Ambient : public BaseObject
    1111    {
    1212        public:
     
    2121
    2222    };
     23    ExportClass(Ambient, Orxonox);
    2324}
    2425
  • code/branches/FICN/src/orxonox/objects/BaseObject.cc

    r708 r729  
    3232
    3333#include "tinyxml/tinyxml.h"
    34 #include "../core/CoreIncludes.h"
    3534
    3635#include "BaseObject.h"
  • code/branches/FICN/src/orxonox/objects/BaseObject.h

    r708 r729  
    1010
    1111#include "../OrxonoxPrereqs.h"
     12#include "../core/CorePrereqs.h"
    1213
    13 #include "../core/OrxonoxClass.h"
     14#include "../core/CoreIncludes.h"
    1415
    1516namespace orxonox
    1617{
    1718    //! The BaseObject is the parent of all classes representing an instance in the game.
    18     class BaseObject : virtual public OrxonoxClass
     19    class _OrxonoxExport BaseObject : virtual public OrxonoxClass
    1920    {
    2021        public:
     
    2324            virtual void loadParams(TiXmlElement* xmlElem);
    2425    };
     26    ExportClass(BaseObject, Orxonox);
    2527}
    2628
  • code/branches/FICN/src/orxonox/objects/BillboardSet.h

    r717 r729  
    1313namespace orxonox
    1414{
    15     class BillboardSet
     15    class _OrxonoxExport BillboardSet
    1616    {
    1717        public:
  • code/branches/FICN/src/orxonox/objects/Camera.h

    r708 r729  
    88namespace orxonox
    99{
    10     class Camera : public BaseObject
     10    class _OrxonoxExport Camera : public BaseObject
    1111    {
    1212        public:
     
    2121
    2222    };
     23    ExportClass(Camera, Orxonox);
    2324}
    2425
  • code/branches/FICN/src/orxonox/objects/Explosion.h

    r708 r729  
    99namespace orxonox
    1010{
    11     class Explosion : public WorldEntity
     11    class _OrxonoxExport Explosion : public WorldEntity
    1212    {
    1313        public:
     
    2121            ParticleInterface* particle_;
    2222    };
     23    ExportClass(Explosion, Orxonox);
    2324}
    2425
  • code/branches/FICN/src/orxonox/objects/Fighter.h

    r708 r729  
    1212namespace orxonox
    1313{
    14     class Fighter : public Model, public OIS::MouseListener
     14    class _OrxonoxExport Fighter : public Model, public OIS::MouseListener
    1515    {
    1616        public:
     
    9090            int emitterRate_;
    9191    };
     92    ExportClass(Fighter, Orxonox);
    9293}
    9394
  • code/branches/FICN/src/orxonox/objects/Light.h

    r716 r729  
    1212namespace orxonox
    1313{
    14     class Light
     14    class _OrxonoxExport Light
    1515    {
    1616        public:
  • code/branches/FICN/src/orxonox/objects/Mesh.h

    r715 r729  
    1010namespace orxonox
    1111{
    12     class Mesh
     12    class _OrxonoxExport Mesh
    1313    {
    1414        public:
  • code/branches/FICN/src/orxonox/objects/Model.cc

    r708 r729  
    6969
    7070    void Model::registerAllVariables(){
    71       registerVar(&meshSrc_, meshSrc_.length()+1, network::STRING);
     71      registerVar(&meshSrc_, (int)meshSrc_.length() + 1, network::STRING);
    7272    }
    7373}
  • code/branches/FICN/src/orxonox/objects/Model.h

    r715 r729  
    1212{
    1313
    14     class Model : public WorldEntity
     14    class _OrxonoxExport Model : public WorldEntity
    1515    {
    1616        public:
     
    2525            void registerAllVariables();
    2626    };
     27    ExportClass(Model, Orxonox);
    2728}
    2829
  • code/branches/FICN/src/orxonox/objects/NPC.h

    r728 r729  
    1616namespace orxonox {
    1717
    18   class NPC : public Model
     18  class _OrxonoxExport NPC : public Model
    1919  {
    2020    public:
     
    4444      static int const NUMELEMENTS = 9;  //number of elements
    4545  };
     46  ExportClass(NPC, Orxonox);
    4647
    4748}
  • code/branches/FICN/src/orxonox/objects/Projectile.h

    r708 r729  
    1212    class SpaceShip; // Forward declaration
    1313
    14     class Projectile : public WorldEntity
     14    class _OrxonoxExport Projectile : public WorldEntity
    1515    {
    1616        public:
     
    2828            Timer<Projectile> destroyTimer_;
    2929    };
     30    ExportClass(Projectile, Orxonox);
    3031}
    3132
  • code/branches/FICN/src/orxonox/objects/Skybox.h

    r708 r729  
    1010namespace orxonox
    1111{
    12     class Skybox : public BaseObject
     12    class _OrxonoxExport Skybox : public BaseObject
    1313    {
    1414        public:
     
    2323
    2424    };
     25    ExportClass(Skybox, Orxonox);
    2526}
    2627
  • code/branches/FICN/src/orxonox/objects/SpaceShip.h

    r708 r729  
    1616    class ParticleInterface; // Forward declaration
    1717
    18     class SpaceShip : public Model, public OIS::MouseListener
     18    class _OrxonoxExport SpaceShip : public Model, public OIS::MouseListener
    1919    {
    2020        public:
     
    4343            bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id);
    4444            bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id);
     45
     46            void doNothing() {
     47            int a = 0;
     48            }
    4549
    4650
     
    125129            int emitterRate_;
    126130    };
     131    ExportClass(SpaceShip, Orxonox);
    127132}
    128133
  • code/branches/FICN/src/orxonox/objects/Tickable.h

    r708 r729  
    5252
    5353    //! The Tickable interface provides a tick(dt) function, that gets called every frame.
    54     class Tickable : virtual public OrxonoxClass
     54    class _OrxonoxExport Tickable : virtual public OrxonoxClass
    5555    {
    5656        public:
     
    6767            Tickable() { RegisterRootObject(Tickable); }
    6868    };
     69    ExportAbstractClass(Tickable, Orxonox);
    6970
    7071    //! The TickFrameListener calls the tick(dt) function of all Tickables every frame.
    71     class TickFrameListener : public Ogre::FrameListener
     72    class _OrxonoxExport TickFrameListener : public Ogre::FrameListener
    7273    {
    7374        private:
  • code/branches/FICN/src/orxonox/objects/Timer.h

    r708 r729  
    6767{
    6868    //! TimerBase is the parent of the Timer class.
    69     class TimerBase : public OrxonoxClass
     69    class _OrxonoxExport TimerBase : public OrxonoxClass
    7070    {
    7171        friend class TimerFrameListener;
     
    104104            float time_;        //!< Internal variable, counting the time till the next function-call
    105105    };
     106    ExportAbstractClass(TimerBase, Orxonox);
    106107
    107108    //! The Timer is a callback-object, calling a given function after a given time-interval.
     
    157158            T* object_;
    158159    };
     160    ExportAbstractClass(Timer<BaseObject>, Orxonox);
    159161
    160162    //! The TimerFrameListener manages all Timers in the game.
  • code/branches/FICN/src/orxonox/objects/WorldEntity.h

    r716 r729  
    1717namespace orxonox
    1818{
    19   class WorldEntity : public BaseObject, public Tickable, public network::Synchronisable
     19  class _OrxonoxExport WorldEntity : public BaseObject, public Tickable, public network::Synchronisable
    2020  {
    2121    public:
     
    147147      bool bStatic_;
    148148  };
     149  ExportClass(WorldEntity, Orxonox);
    149150}
    150151
  • code/branches/FICN/src/orxonox/objects/weapon_system/AmmunitionDump.h

    r715 r729  
    4242
    4343namespace orxonox {
    44   class AmmunitionDump : public BaseObject, public network::Synchronisable
     44  class _OrxonoxExport AmmunitionDump : public BaseObject, public network::Synchronisable
    4545  {
    4646  public:
     
    6666    int *capacity_;
    6767  };
     68  ExportClass(AmmunitionDump, Orxonox);
    6869}
    6970
  • code/branches/FICN/src/orxonox/objects/weapon_system/BarrelGun.h

    r708 r729  
    3838
    3939namespace orxonox {
    40   class BarrelGun : public BaseWeapon
     40  class _OrxonoxExport BarrelGun : public BaseWeapon
    4141  {
    4242 public:
     
    6060
    6161  };
     62  ExportClass(BarrelGun, Orxonox);
    6263}
    6364
  • code/branches/FICN/src/orxonox/objects/weapon_system/BaseWeapon.h

    r708 r729  
    3838
    3939namespace orxonox {
    40   class BaseWeapon : public Model
     40  class _OrxonoxExport BaseWeapon : public Model
    4141  {
    4242  public:
     
    122122
    123123  };
     124  ExportAbstractClass(BaseWeapon, Orxonox);
    124125}
    125126
  • code/branches/FICN/src/orxonox/objects/weapon_system/Bullet.h

    r708 r729  
    3737
    3838namespace orxonox {
    39   class Bullet : public Model
     39  class _OrxonoxExport Bullet : public Model
    4040  {
    4141  public:
     
    4747    inline virtual void loadParams(TiXmlElement* xmlElem) { Model::loadParams(xmlElem); };
    4848 };
     49  ExportClass(Bullet, Orxonox);
    4950}
    5051
  • code/branches/FICN/src/orxonox/objects/weapon_system/BulletManager.h

    r715 r729  
    3838#include "network/Synchronisable.h"
    3939#include "tinyxml/tinyxml.h"
    40 //#include "../core/CoreIncludes.h"
     40#include "../../core/CoreIncludes.h"
    4141#include "../BaseObject.h"
    4242#include "../Tickable.h"
    4343
    4444namespace orxonox {
    45   class BulletManager : public BaseObject, public network::Synchronisable, public Tickable
     45  class _OrxonoxExport BulletManager : public BaseObject, public network::Synchronisable, public Tickable
    4646  {
    4747  public:
     
    6767          int bulletsIndex_;
    6868  };
     69  ExportClass(BulletManager, Orxonox);
    6970}
    7071
  • code/branches/FICN/src/orxonox/objects/weapon_system/WeaponStation.h

    r708 r729  
    3636
    3737namespace orxonox {
    38   class WeaponStation
     38  class _OrxonoxExport WeaponStation
    3939  {
    4040  public:
  • code/branches/FICN/src/orxonox/particle/ParticleInterface.h

    r728 r729  
    2121{
    2222
    23   class ParticleInterface
     23  class _OrxonoxExport ParticleInterface
    2424  {
    2525  public:
Note: See TracChangeset for help on using the changeset viewer.