Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10465


Ignore:
Timestamp:
May 25, 2015, 10:24:56 AM (10 years ago)
Author:
landauf
Message:

moved macro ans helperfunction from NetworkFunction.h to NetworkFunctionIncludes.h

Location:
code/branches/core7/src
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/network/NetworkFunction.h

    r9667 r10465  
    3636#include <map>
    3737#include <string>
    38 #include <boost/preprocessor/cat.hpp>
    39 #include <boost/static_assert.hpp>
    4038
    4139#include "core/object/Listable.h"
     
    237235}
    238236
    239 template<class T> inline void* registerStaticNetworkFunctionFct( T ptr, const std::string& name )
    240 {
    241   BOOST_STATIC_ASSERT( sizeof(T)<=sizeof(NetworkFunctionPointer) ); // if this fails your compiler uses bigger pointers for static functions than defined above
    242   NetworkFunctionPointer destptr;
    243   copyPtr( ptr, destptr );
    244   new NetworkFunctionStatic( createFunctor(ptr), name, destptr );
    245   return 0;
    246237}
    247238
    248 template<class T, class PT> inline void* registerMemberNetworkFunctionFct( PT ptr, const std::string& name )
    249 {
    250   BOOST_STATIC_ASSERT( sizeof(PT)<=sizeof(NetworkFunctionPointer) ); // if this fails your compiler uses bigger pointers for a specific kind of member functions than defined above
    251   NetworkFunctionPointer destptr;
    252   copyPtr( ptr, destptr );
    253   new NetworkMemberFunction<T>( createFunctor(ptr), name, destptr );
    254   return 0;
    255 }
    256 
    257 #define registerStaticNetworkFunction( functionPointer ) \
    258   static void* BOOST_PP_CAT( NETWORK_FUNCTION_, __UNIQUE_NUMBER__ ) = registerStaticNetworkFunctionFct( functionPointer, #functionPointer );
    259 #define registerMemberNetworkFunction( class, function ) \
    260   static void* BOOST_PP_CAT( NETWORK_FUNCTION_##class, __UNIQUE_NUMBER__ ) = registerMemberNetworkFunctionFct<class>( &class::function, #class "_" #function);
    261   // call it with functionPointer, clientID, args
    262 #define callStaticNetworkFunction( functionPointer, ...) \
    263   { \
    264     NetworkFunctionPointer p1; \
    265     copyPtr( functionPointer, p1 ); \
    266     FunctionCallManager::addCallStatic(NetworkFunctionStatic::getFunction(p1)->getNetworkID(), __VA_ARGS__); \
    267   }
    268   // call it with class, function, objectID, clientID, args
    269 #define callMemberNetworkFunction( class, function, objectID, ...) \
    270   { \
    271     NetworkFunctionPointer p1; \
    272     copyPtr( &class::function, p1 ); \
    273     FunctionCallManager::addCallMember(NetworkMemberFunctionBase::getFunction(p1)->getNetworkID(), objectID, __VA_ARGS__); \
    274   }
    275 
    276 
    277 }
    278 
    279239#endif /* _NetworkFunction_H__ */
  • code/branches/core7/src/modules/docking/Dock.cc

    r10347 r10465  
    3838#include "core/GUIManager.h"
    3939#include "core/command/ConsoleCommandIncludes.h"
    40 #include "network/NetworkFunction.h"
     40#include "network/NetworkFunctionIncludes.h"
    4141
    4242#include "infos/HumanPlayer.h"
  • code/branches/core7/src/modules/notifications/NotificationDispatcher.cc

    r9667 r10465  
    3737#include "core/EventIncludes.h"
    3838#include "core/XMLPort.h"
    39 #include "network/NetworkFunction.h"
     39#include "network/NetworkFunctionIncludes.h"
    4040#include "network/Host.h"
    4141
  • code/branches/core7/src/modules/objects/Script.cc

    r9667 r10465  
    3737#include "core/XMLPort.h"
    3838#include "network/Host.h"
    39 #include "network/NetworkFunction.h"
     39#include "network/NetworkFunctionIncludes.h"
    4040
    4141#include "PlayerManager.h"
  • code/branches/core7/src/modules/pickup/PickupManager.cc

    r10464 r10465  
    4040#include "core/singleton/ScopedSingletonIncludes.h"
    4141#include "network/Host.h"
    42 #include "network/NetworkFunction.h"
     42#include "network/NetworkFunctionIncludes.h"
    4343
    4444#include "infos/PlayerInfo.h"
  • code/branches/core7/src/orxonox/Test.cc

    r10347 r10465  
    3030#include "core/config/ConfigValueIncludes.h"
    3131#include "core/command/ConsoleCommandIncludes.h"
    32 #include "network/NetworkFunction.h"
     32#include "network/NetworkFunctionIncludes.h"
    3333#include "Test.h"
    3434#include "util/MultiType.h"
  • code/branches/core7/src/orxonox/gamestates/GSRoot.cc

    r10347 r10465  
    3434#include "core/GameMode.h"
    3535#include "core/command/ConsoleCommandIncludes.h"
    36 #include "network/NetworkFunction.h"
     36#include "network/NetworkFunctionIncludes.h"
    3737#include "tools/Timer.h"
    3838#include "tools/interfaces/Tickable.h"
  • code/branches/core7/src/orxonox/infos/GametypeInfo.cc

    r9667 r10465  
    3737#include "core/GameMode.h"
    3838#include "network/Host.h"
    39 #include "network/NetworkFunction.h"
     39#include "network/NetworkFunctionIncludes.h"
    4040#include "util/Convert.h"
    4141
  • code/branches/core7/src/orxonox/interfaces/NotificationListener.cc

    r10380 r10465  
    3434#include "core/CoreIncludes.h"
    3535#include "network/Host.h"
    36 #include "network/NetworkFunction.h"
     36#include "network/NetworkFunctionIncludes.h"
    3737#include "util/SubString.h"
    3838
  • code/branches/core7/src/orxonox/worldentities/ControllableEntity.cc

    r9799 r10465  
    3636#include "core/GameMode.h"
    3737#include "core/XMLPort.h"
    38 #include "network/NetworkFunction.h"
     38#include "network/NetworkFunctionIncludes.h"
    3939
    4040#include "Scene.h"
Note: See TracChangeset for help on using the changeset viewer.