Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3370 for code/trunk/src/util


Ignore:
Timestamp:
Jul 30, 2009, 2:10:44 PM (15 years ago)
Author:
rgrieder
Message:

Merged resource branch back to the trunk. Changes:

  • Automated graphics loading by evaluating whether a GameState requires it
  • Using native Tcl library (x3n)

Windows users: Update your dependency package!

Location:
code/trunk
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/util/ScopeGuard.h

    r3280 r3370  
    124124        }
    125125
    126     protected:
    127126        ScopeGuardImpl0(F fun) : fun_(fun)
    128127        {}
    129128
     129    protected:
    130130        F fun_;
    131131    };
     
    171171        }
    172172
    173     protected:
    174173        ScopeGuardImpl1(F fun, P1 p1) : fun_(fun), p1_(p1)
    175174        {}
    176175
     176    protected:
    177177        F fun_;
    178178        const P1 p1_;
     
    219219        }
    220220
    221     protected:
    222221        ScopeGuardImpl2(F fun, P1 p1, P2 p2) : fun_(fun), p1_(p1), p2_(p2)
    223222        {}
    224223
     224    protected:
    225225        F fun_;
    226226        const P1 p1_;
     
    268268        }
    269269
    270     protected:
    271270        ScopeGuardImpl3(F fun, P1 p1, P2 p2, P3 p3) : fun_(fun), p1_(p1), p2_(p2), p3_(p3)
    272271        {}
    273272
     273    protected:
    274274        F fun_;
    275275        const P1 p1_;
     
    319319        }
    320320
    321     protected:
    322321        ScopeGuardImpl4( F fun, P1 p1, P2 p2, P3 p3, P4 p4 ) :
    323322             fun_( fun ), p1_( p1 ), p2_( p2 ), p3_( p3 ), p4_( p4 )
    324323        {}
    325324
     325    protected:
    326326        F fun_;
    327327        const P1 p1_;
     
    372372        }
    373373
    374     protected:
    375374        ScopeGuardImpl5( F fun, P1 p1, P2 p2, P3 p3, P4 p4, P5 p5 ) :
    376375             fun_( fun ), p1_( p1 ), p2_( p2 ), p3_( p3 ), p4_( p4 ), p5_( p5 )
    377376        {}
    378377
     378    protected:
    379379        F fun_;
    380380        const P1 p1_;
     
    426426        }
    427427
    428     protected:
    429428        ObjScopeGuardImpl0(Obj& obj, MemFun memFun) : obj_(obj), memFun_(memFun)
    430429        {}
    431430
     431    protected:
    432432        Obj& obj_;
    433433        MemFun memFun_;
     
    488488        }
    489489
    490     protected:
    491490        ObjScopeGuardImpl1(Obj& obj, MemFun memFun, P1 p1) : obj_(obj), memFun_(memFun), p1_(p1)
    492491        {}
    493492       
     493    protected:
    494494        Obj& obj_;
    495495        MemFun memFun_;
     
    551551        }
    552552
    553     protected:
    554553        ObjScopeGuardImpl2(Obj& obj, MemFun memFun, P1 p1, P2 p2) : obj_(obj), memFun_(memFun), p1_(p1), p2_(p2)
    555554        {}
    556555
     556    protected:
    557557        Obj& obj_;
    558558        MemFun memFun_;
     
    616616        }
    617617
    618     protected:
    619618        ObjScopeGuardImpl3( Obj & obj, MemFun memFun, P1 p1, P2 p2, P3 p3 ) :
    620619             obj_( obj ), memFun_( memFun ), p1_( p1 ), p2_( p2 ), p3_( p3 )
    621620        {}
    622621
     622    protected:
    623623        Obj& obj_;
    624624        MemFun memFun_;
  • code/trunk/src/util/SignalHandler.cc

    r3301 r3370  
    4141namespace orxonox
    4242{
    43     SignalHandler* SignalHandler::singletonRef_s = NULL;
     43    SignalHandler* SignalHandler::singletonPtr_s = NULL;
    4444}
    4545
     
    122122      }
    123123      // if the signalhandler has already been destroyed then don't do anything
    124       if( SignalHandler::singletonRef_s == 0 )
     124      if( SignalHandler::singletonPtr_s == 0 )
    125125      {
    126126        COUT(0) << "recieved signal " << sigName.c_str() << std::endl << "can't write backtrace because SignalHandler already destroyed" << std::endl;
  • code/trunk/src/util/SignalHandler.h

    r3068 r3370  
    4040#include <list>
    4141#include <string>
     42#include "Singleton.h"
    4243
    4344namespace orxonox
     
    6768    typedef std::list<SignalCallbackRec> SignalCallbackList;
    6869
    69     class SignalHandler
     70    class SignalHandler : public Singleton<SignalHandler>
    7071    {
     72        friend class Singleton<SignalHandler>;
    7173    public:
    72         SignalHandler()  { assert(SignalHandler::singletonRef_s == 0); SignalHandler::singletonRef_s = this; }
    73         ~SignalHandler() { assert(SignalHandler::singletonRef_s != 0); SignalHandler::singletonRef_s = NULL; }
    74         inline static SignalHandler& getInstance() { assert(SignalHandler::singletonRef_s); return *SignalHandler::singletonRef_s; }
     74        SignalHandler()  { }
     75        ~SignalHandler() { }
    7576
    7677        void registerCallback( SignalCallback cb, void * someData );
     
    8788        SignalCallbackList callbackList;
    8889
    89         static SignalHandler* singletonRef_s;
     90        static SignalHandler* singletonPtr_s;
    9091
    9192        std::string appName;
     
    9899namespace orxonox
    99100{
    100     class _UtilExport SignalHandler
     101    class _UtilExport SignalHandler : public Singleton<SignalHandler>
    101102    {
     103        friend class Singleton<SignalHandler>;
    102104    public:
    103         SignalHandler()  { assert(SignalHandler::singletonRef_s == 0); SignalHandler::singletonRef_s = this; }
    104         ~SignalHandler() { assert(SignalHandler::singletonRef_s != 0); SignalHandler::singletonRef_s = 0; }
    105         inline static SignalHandler& getInstance() { assert(SignalHandler::singletonRef_s); return *SignalHandler::singletonRef_s; }
     105        SignalHandler()  { }
     106        ~SignalHandler() { }
    106107        void doCatch( const std::string & appName, const std::string & filename ) {}
    107108        void dontCatch() {}
     
    109110
    110111    private:
    111         static SignalHandler* singletonRef_s;
     112        static SignalHandler* singletonPtr_s;
    112113    };
    113114}
Note: See TracChangeset for help on using the changeset viewer.