Changeset 10465 for code/branches/core7
- Timestamp:
- May 25, 2015, 10:24:56 AM (10 years ago)
- Location:
- code/branches/core7/src
- Files:
-
- 1 added
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/network/NetworkFunction.h
r9667 r10465 36 36 #include <map> 37 37 #include <string> 38 #include <boost/preprocessor/cat.hpp>39 #include <boost/static_assert.hpp>40 38 41 39 #include "core/object/Listable.h" … … 237 235 } 238 236 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 above242 NetworkFunctionPointer destptr;243 copyPtr( ptr, destptr );244 new NetworkFunctionStatic( createFunctor(ptr), name, destptr );245 return 0;246 237 } 247 238 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 above251 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, args262 #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, args269 #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 279 239 #endif /* _NetworkFunction_H__ */ -
code/branches/core7/src/modules/docking/Dock.cc
r10347 r10465 38 38 #include "core/GUIManager.h" 39 39 #include "core/command/ConsoleCommandIncludes.h" 40 #include "network/NetworkFunction .h"40 #include "network/NetworkFunctionIncludes.h" 41 41 42 42 #include "infos/HumanPlayer.h" -
code/branches/core7/src/modules/notifications/NotificationDispatcher.cc
r9667 r10465 37 37 #include "core/EventIncludes.h" 38 38 #include "core/XMLPort.h" 39 #include "network/NetworkFunction .h"39 #include "network/NetworkFunctionIncludes.h" 40 40 #include "network/Host.h" 41 41 -
code/branches/core7/src/modules/objects/Script.cc
r9667 r10465 37 37 #include "core/XMLPort.h" 38 38 #include "network/Host.h" 39 #include "network/NetworkFunction .h"39 #include "network/NetworkFunctionIncludes.h" 40 40 41 41 #include "PlayerManager.h" -
code/branches/core7/src/modules/pickup/PickupManager.cc
r10464 r10465 40 40 #include "core/singleton/ScopedSingletonIncludes.h" 41 41 #include "network/Host.h" 42 #include "network/NetworkFunction .h"42 #include "network/NetworkFunctionIncludes.h" 43 43 44 44 #include "infos/PlayerInfo.h" -
code/branches/core7/src/orxonox/Test.cc
r10347 r10465 30 30 #include "core/config/ConfigValueIncludes.h" 31 31 #include "core/command/ConsoleCommandIncludes.h" 32 #include "network/NetworkFunction .h"32 #include "network/NetworkFunctionIncludes.h" 33 33 #include "Test.h" 34 34 #include "util/MultiType.h" -
code/branches/core7/src/orxonox/gamestates/GSRoot.cc
r10347 r10465 34 34 #include "core/GameMode.h" 35 35 #include "core/command/ConsoleCommandIncludes.h" 36 #include "network/NetworkFunction .h"36 #include "network/NetworkFunctionIncludes.h" 37 37 #include "tools/Timer.h" 38 38 #include "tools/interfaces/Tickable.h" -
code/branches/core7/src/orxonox/infos/GametypeInfo.cc
r9667 r10465 37 37 #include "core/GameMode.h" 38 38 #include "network/Host.h" 39 #include "network/NetworkFunction .h"39 #include "network/NetworkFunctionIncludes.h" 40 40 #include "util/Convert.h" 41 41 -
code/branches/core7/src/orxonox/interfaces/NotificationListener.cc
r10380 r10465 34 34 #include "core/CoreIncludes.h" 35 35 #include "network/Host.h" 36 #include "network/NetworkFunction .h"36 #include "network/NetworkFunctionIncludes.h" 37 37 #include "util/SubString.h" 38 38 -
code/branches/core7/src/orxonox/worldentities/ControllableEntity.cc
r9799 r10465 36 36 #include "core/GameMode.h" 37 37 #include "core/XMLPort.h" 38 #include "network/NetworkFunction .h"38 #include "network/NetworkFunctionIncludes.h" 39 39 40 40 #include "Scene.h"
Note: See TracChangeset
for help on using the changeset viewer.