Definition at line 43 of file test.cpp. 00043 { 00044 00045 bool found = false; 00046 Message m(formatString); 00047 00048 if ( !found ) try { 00049 ServiceRequest sr1 = m; 00050 found = true; 00051 cout << "ServiceRequest" << endl 00052 << endl; 00053 } 00054 catch ( MessageCastException& e ) {} 00055 00056 if ( !found ) try { 00057 ServiceOffer temp = m; 00058 found = true; 00059 cout << "ServiceOffer" << endl 00060 << "sessionId: " << temp.getSessionId() << endl 00061 << "method: " << temp.getMethod() << endl 00062 << "prefixBytes: " << temp.getPrefixBytes() << endl 00063 << "referenceOutput: " << temp.getReferenceOutput() << endl 00064 << "inputBytes: " << temp.getInputBytes() << endl 00065 << endl; 00066 } 00067 catch ( MessageCastException& e ) {} 00068 00069 if ( !found ) try { 00070 NoServiceNeeded temp = m; 00071 found = true; 00072 cout << "NoServiceNeeded" << endl 00073 << endl; 00074 } 00075 catch ( MessageCastException& e ) {} 00076 00077 if ( !found ) try { 00078 ServiceDone temp = m; 00079 found = true; 00080 cout << "ServiceDone" << endl 00081 << "sessionId: " << temp.getSessionId() << endl 00082 << "found: " << temp.isFoundMatch() << endl 00083 << "match: " << temp.getMatchingBytes() << endl 00084 << endl; 00085 } 00086 catch ( MessageCastException& e ) {} 00087 00088 if ( !found ) try { 00089 ServiceCancel temp = m; 00090 found = true; 00091 cout << "ServiceCancel" << endl 00092 << "sessionId: " << temp.getSessionId() << endl 00093 << "reason: " << temp.getReason() << endl 00094 << endl; 00095 } 00096 catch ( MessageCastException& e ) {} 00097 00098 if ( !found ) try { 00099 Acknowledgement temp = m; 00100 found = true; 00101 cout << "Acknowledgement" << endl 00102 << endl; 00103 } 00104 catch ( MessageCastException& e ) {} 00105 00106 if ( !found ) try { 00107 Error temp = m; 00108 found = true; 00109 cout << "Error" << endl 00110 << "reason: " << temp.getReason() << endl 00111 << endl; 00112 } 00113 catch ( MessageCastException& e ) {} 00114 00115 if ( !found ) try { 00116 StatusRequest temp = m; 00117 found = true; 00118 cout << "StatusRequest" << endl 00119 << "jobId: " << temp.getJobId() << endl 00120 << endl; 00121 } 00122 catch ( MessageCastException& e ) {} 00123 00124 if ( !found ) try { 00125 StatusOffer temp = m; 00126 found = true; 00127 cout << "StatusOffer" << endl 00128 << "status: " << temp.getStatus() << endl 00129 << endl; 00130 } 00131 catch ( MessageCastException& e ) {} 00132 00133 if ( !found ) try { 00134 HaltRequest temp = m; 00135 found = true; 00136 cout << "HaltRequest" << endl 00137 << "jobId: " << temp.getJobId() << endl 00138 << endl; 00139 } 00140 catch ( MessageCastException& e ) {} 00141 00142 if ( !found ) try { 00143 AliveStatement temp = m; 00144 found = true; 00145 cout << "AliveStatement" << endl 00146 << "sessionId: " << temp.getSessionId() << endl 00147 << endl; 00148 } 00149 catch ( MessageCastException& e ) {} 00150 00151 if ( !found ) try { 00152 GoOnCommand temp = m; 00153 found = true; 00154 cout << "GoOnCommand" << endl 00155 << endl; 00156 } 00157 catch ( MessageCastException& e ) {} 00158 00159 if ( !found ) try { 00160 StopCommand temp = m; 00161 found = true; 00162 cout << "StopCommand" << endl 00163 << endl; 00164 } 00165 catch ( MessageCastException& e ) {} 00166 00167 if ( !found ) { 00168 cout << "unexpected Message type" << endl 00169 << endl; 00170 } 00171 }
|
1.5.1