Public Member Functions | |
floattest () | |
floattest (nMessage &m) | |
virtual | ~floattest () |
virtual bool | AcceptClientSync () const |
virtual void | WriteSync (nMessage &m) |
virtual void | ReadSync (nMessage &m) |
virtual void | WriteCreate (nMessage &m) |
virtual void | ReceiveControl (nMessage &m) |
void | SendControl (REAL diff) |
virtual nDescriptor & | CreatorDescriptor () const |
virtual void | debug_out () |
floattest () | |
floattest (nMessage &m) | |
virtual | ~floattest () |
virtual bool | AcceptClientSync () const |
virtual void | WriteSync (nMessage &m) |
virtual void | ReadSync (nMessage &m) |
virtual nDescriptor & | CreatorDescriptor () const |
Public Attributes | |
REAL | x |
REAL | y |
deptest * | dep |
Private Attributes | |
int | listID |
Definition at line 37 of file l3_demo.cpp.
floattest::floattest | ( | ) | [inline] |
Definition at line 43 of file l3_demo.cpp.
References con.
00043 :nNetObject(),x(0),y(1.1){ 00044 con << "created floattest.\n"; 00045 }
floattest::floattest | ( | nMessage & | m | ) | [inline] |
Definition at line 48 of file l3_demo.cpp.
References con, nNetObject::owner, and y.
00048 :nNetObject(m){ 00049 m >> y; 00050 con << "created floattest by remote order from " 00051 << owner << " with fixed state " << y << ".\n"; 00052 // as x is changing, it will be read by the following ReadSync() 00053 }
virtual floattest::~floattest | ( | ) | [inline, virtual] |
floattest::floattest | ( | ) | [inline] |
Definition at line 64 of file nettest.cpp.
References con, dep, floattests, listID, and NULL.
00064 :nNetObject(),listID(-1),x(-4){ 00065 dep=NULL; 00066 con << "created floattest.\n"; 00067 floattests.Add(this,listID); 00068 }
floattest::floattest | ( | nMessage & | m | ) | [inline] |
Definition at line 69 of file nettest.cpp.
References dep, floattests, listID, and NULL.
00069 :nNetObject(m),listID(-1){ 00070 dep=NULL; 00071 //con << "created floattest.\n"; 00072 floattests.Add(this,listID); 00073 }
virtual floattest::~floattest | ( | ) | [inline, virtual] |
Definition at line 75 of file nettest.cpp.
References con, dep, floattests, listID, and tERR_ERROR.
00075 { 00076 if(dep){ 00077 tERR_ERROR("floattest deleted before deptest!"); 00078 } 00079 00080 floattests.Remove(this,listID); 00081 con << "deleted floattest.\n"; 00082 }
virtual bool floattest::AcceptClientSync | ( | ) | const [inline, virtual] |
virtual void floattest::WriteSync | ( | nMessage & | m | ) | [inline, virtual] |
Reimplemented from nNetObject.
Definition at line 66 of file l3_demo.cpp.
References nNetObject::WriteSync(), and x.
00066 { 00067 nNetObject::WriteSync(m); 00068 m << x; 00069 }
virtual void floattest::ReadSync | ( | nMessage & | m | ) | [inline, virtual] |
Reimplemented from nNetObject.
Definition at line 71 of file l3_demo.cpp.
References con, nNetObject::owner, nNetObject::ReadSync(), and x.
00071 { 00072 nNetObject::ReadSync(m); 00073 00074 m >> x; 00075 00076 // print our state 00077 con << "NAO owned by " << owner << " is in state " << x << "\n"; 00078 }
virtual void floattest::WriteCreate | ( | nMessage & | m | ) | [inline, virtual] |
Reimplemented from nNetObject.
Definition at line 81 of file l3_demo.cpp.
References nNetObject::WriteCreate(), and y.
00081 { 00082 nNetObject::WriteCreate(m); 00083 m << y; 00084 }
virtual void floattest::ReceiveControl | ( | nMessage & | m | ) | [inline, virtual] |
Definition at line 88 of file l3_demo.cpp.
References con, nNetObject::owner, nNetObject::ReadSync(), REAL, nNetObject::RequestSync(), and x.
00088 { 00089 nNetObject::ReadSync(m); 00090 00091 REAL diff; 00092 m >> diff; 00093 x+=diff; 00094 00095 // print our state 00096 con << "NAO owned by " << owner << " got order to change by " 00097 << diff<< "; state now is " << x << ".\n"; 00098 00099 RequestSync(); 00100 }
void floattest::SendControl | ( | REAL | diff | ) | [inline] |
Definition at line 103 of file l3_demo.cpp.
References nMessage::BroadCast(), and nNetObject::NewControlMessage().
00103 { 00104 // create the message 00105 nMessage *m=NewControlMessage(); 00106 00107 // write order 00108 (*m) << diff; 00109 00110 // send message 00111 m->BroadCast(); 00112 }
nDescriptor & floattest::CreatorDescriptor | ( | void | ) | const [virtual] |
Implements nNetObject.
Definition at line 120 of file l3_demo.cpp.
References floattest_init.
00120 { 00121 return floattest_init; 00122 }
virtual void floattest::debug_out | ( | ) | [inline, virtual] |
virtual bool floattest::AcceptClientSync | ( | ) | const [inline, virtual] |
virtual void floattest::WriteSync | ( | nMessage & | m | ) | [inline, virtual] |
Reimplemented from nNetObject.
Definition at line 88 of file nettest.cpp.
References nNetObject::WriteSync(), and x.
00088 { 00089 nNetObject::WriteSync(m); 00090 m << x; 00091 }
virtual void floattest::ReadSync | ( | nMessage & | m | ) | [inline, virtual] |
Reimplemented from nNetObject.
Definition at line 93 of file nettest.cpp.
References nNetObject::ReadSync(), and x.
00093 { 00094 nNetObject::ReadSync(m); 00095 m >> x; 00096 }
virtual nDescriptor& floattest::CreatorDescriptor | ( | ) | const [virtual] |
Implements nNetObject.
Definition at line 39 of file l3_demo.cpp.
Referenced by debug_out(), ntest(), ReadSync(), ReceiveControl(), and WriteSync().
int floattest::listID [private] |
Definition at line 54 of file nettest.cpp.
Referenced by deptest::deptest(), floattest(), deptest::~deptest(), and ~floattest().
Definition at line 58 of file nettest.cpp.
Referenced by deptest::ClearToTransmit(), deptest::debug_out(), deptest::deptest(), floattest(), deptest::WriteCreate(), deptest::~deptest(), and ~floattest().