Changeset 2309 for code/branches/network64/src/orxonox
- Timestamp:
- Dec 2, 2008, 9:10:00 PM (16 years ago)
- Location:
- code/branches/network64/src/orxonox/objects
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network64/src/orxonox/objects/Test.cc
r2245 r2309 61 61 void Test::setConfigValues() 62 62 { 63 SetConfigValue ( v1, 1 )/*.callback ( this, &Test::checkV1 )*/; 64 SetConfigValue ( v2, 2 )/*.callback ( this, &Test::checkV2 )*/; 65 SetConfigValue ( v3, 3 )/*.callback ( this, &Test::checkV3 )*/; 66 SetConfigValue ( v4, 4 )/*.callback ( this, &Test::checkV4 )*/; 63 SetConfigValue ( u1, 1 )/*.callback ( this, &Test::checkV1 )*/; 64 SetConfigValue ( u2, 2 )/*.callback ( this, &Test::checkV2 )*/; 65 SetConfigValue ( u3, 3 )/*.callback ( this, &Test::checkV3 )*/; 66 SetConfigValue ( u4, 4 )/*.callback ( this, &Test::checkV4 )*/; 67 68 SetConfigValue ( s1, 1 )/*.callback ( this, &Test::checkV1 )*/; 69 SetConfigValue ( s2, 2 )/*.callback ( this, &Test::checkV2 )*/; 70 SetConfigValue ( s3, 3 )/*.callback ( this, &Test::checkV3 )*/; 71 SetConfigValue ( s4, 4 )/*.callback ( this, &Test::checkV4 )*/; 67 72 } 68 73 … … 70 75 void Test::registerVariables() 71 76 { 72 registerVariable ( v1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkV1 )); 73 registerVariable ( v2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkV2 )); 74 registerVariable ( v3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkV3 ), true ); 75 registerVariable ( v4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkV4 ), true ); 77 registerVariable ( u1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkU1 )); 78 registerVariable ( u2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkU2 )); 79 registerVariable ( u3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkU3 ), true ); 80 registerVariable ( u4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkU4 ), true ); 81 82 registerVariable ( s1, variableDirection::toclient, new NetworkCallback<Test> ( this, &Test::checkS1 )); 83 registerVariable ( s2, variableDirection::toserver, new NetworkCallback<Test> ( this, &Test::checkS2 )); 84 registerVariable ( s3, variableDirection::serverMaster, new NetworkCallback<Test> ( this, &Test::checkS3 ), true ); 85 registerVariable ( s4, variableDirection::clientMaster, new NetworkCallback<Test> ( this, &Test::checkS4 ), true ); 76 86 } 77 87 78 void Test::checkV1(){ 79 COUT(1) << "V1 changed: " << v1 << std::endl; 80 } 88 void Test::checkU1(){ COUT(1) << "U1 changed: " << u1 << std::endl; } 89 void Test::checkU2(){ COUT(1) << "U2 changed: " << u2 << std::endl; } 90 void Test::checkU3(){ COUT(1) << "U3 changed: " << u3 << std::endl; } 91 void Test::checkU4(){ COUT(1) << "U4 changed: " << u4 << std::endl; } 81 92 82 void Test::checkV2(){ 83 COUT(1) << "V2 changed: " << v2 << std::endl; 84 } 85 86 void Test::checkV3(){ 87 COUT(1) << "V3 changed: " << v3 << std::endl; 88 } 89 90 void Test::checkV4(){ 91 COUT(1) << "V4 changed: " << v4 << std::endl; 92 } 93 93 void Test::checkS1(){ COUT(1) << "S1 changed: " << s1 << std::endl; } 94 void Test::checkS2(){ COUT(1) << "S2 changed: " << s2 << std::endl; } 95 void Test::checkS3(){ COUT(1) << "S3 changed: " << s3 << std::endl; } 96 void Test::checkS4(){ COUT(1) << "S4 changed: " << s4 << std::endl; } 94 97 95 98 } -
code/branches/network64/src/orxonox/objects/Test.h
r2245 r2309 34 34 #include "network/synchronisable/Synchronisable.h" 35 35 36 37 typedef int TYPE; 38 typedef unsigned int UTYPE; 39 40 36 41 namespace orxonox 37 42 { … … 45 50 void registerVariables(); 46 51 47 void setV1(unsigned int value){ v1 = value; }48 void setV2(unsigned int value){ v2 = value; }49 void setV3(unsigned int value){ v3 = value; }50 void setV4(unsigned int value){ v4 = value; }51 52 52 void checkV1(); 53 void checkV2(); 54 void checkV3(); 55 void checkV4(); 53 //unsigned functions 54 void setU1(UTYPE value){ u1 = value; } 55 void setU2(UTYPE value){ u2 = value; } 56 void setU3(UTYPE value){ u3 = value; } 57 void setU4(UTYPE value){ u4 = value; } 58 void checkU1(); 59 void checkU2(); 60 void checkU3(); 61 void checkU4(); 56 62 57 static void printV1(){ instance_->checkV1(); } 58 static void printV2(){ instance_->checkV2(); } 59 static void printV3(){ instance_->checkV3(); } 60 static void printV4(){ instance_->checkV4(); } 63 //signed functions 64 void setS1(TYPE value){ s1 = value; } 65 void setS2(TYPE value){ s2 = value; } 66 void setS3(TYPE value){ s3 = value; } 67 void setS4(TYPE value){ s4 = value; } 68 void checkS1(); 69 void checkS2(); 70 void checkS3(); 71 void checkS4(); 72 73 static void printV1(){ instance_->checkU1(); } 74 static void printV2(){ instance_->checkU2(); } 75 static void printV3(){ instance_->checkU3(); } 76 static void printV4(){ instance_->checkU4(); } 61 77 62 78 private: 63 unsigned int v1; 64 unsigned int v2; 65 unsigned int v3; 66 unsigned int v4; 79 UTYPE u1; 80 UTYPE u2; 81 UTYPE u3; 82 UTYPE u4; 83 84 TYPE s1; 85 TYPE s2; 86 TYPE s3; 87 TYPE s4; 67 88 68 89 static Test* instance_;
Note: See TracChangeset
for help on using the changeset viewer.