# Message_R.cc

Go to the documentation of this file.

    00001 // ----------------------------------------------------------------------------
    00002 // CERTI - HLA RunTime Infrastructure
    00003 // Copyright (C) 2002-2006  ONERA
    00004 //
    00005 // This program is free software ; you can redistribute it and/or
    00006 // modify it under the terms of the GNU Lesser General Public License
    00007 // as published by the Free Software Foundation ; either version 2 of
    00008 // the License, or (at your option) any later version.
    00009 //
    00010 // This program is distributed in the hope that it will be useful, but
    00011 // WITHOUT ANY WARRANTY ; without even the implied warranty of
    00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    00013 // Lesser General Public License for more details.
    00014 //
    00015 // You should have received a copy of the GNU Lesser General Public
    00016 // License along with this program ; if not, write to the Free Software
    00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
    00018 // USA
    00019 //
    00020 // $Id: Message_R.cc,v 3.34 2008/11/21 12:45:25 approx Exp $
    00021 // ----------------------------------------------------------------------------
    00022
    00023
    00024 #include "Message.hh"
    00025
    00026 #include <cassert>
    00027
    00028 using std::vector ;
    00029
    00030 namespace certi {
    00031
    00032 static PrettyDebug D("RTIA_MSG","Message::");
    00033 static PrettyDebug G("GENDOC",__FILE__);
    00034
    00035 // ----------------------------------------------------------------------------
    00036 void
    00037 Message::receive(SocketUN* socket, MessageBuffer &msgBuffer) throw (NetworkError, NetworkSignal) {
    00038     G.Out(pdGendoc,"enter Message::receive");
    00039     /* 0- Reset receive buffer */
    00040     /* FIXME this reset may not be necessary since we do
    00041      * raw-receive + assume-size
    00042      */
    00043     msgBuffer.reset();
    00044     /* 1- Read 'reserved bytes' header from socket */
    00045     D.Out(pdDebug,"Reading %d 'reserved' bytes",msgBuffer.reservedBytes);
    00046     socket->receive(static_cast<const unsigned char *>(msgBuffer(0)), msgBuffer.reservedBytes);
    00047     //msgBuffer.show(msgBuffer(0),5);fflush(stdout);
    00048     /* 2- update (assume) complete message size from reserved bytes */
    00049     msgBuffer.assumeSizeFromReservedBytes();
    00050     D.Out(pdDebug,"Got a MsgBuffer of size %d bytes (including %d reserved)",msgBuffer.size(),msgBuffer.reservedBytes);
    00051     /* 3- receive the rest of the message */
    00052     socket->receive(static_cast<const unsigned char *>(msgBuffer(msgBuffer.reservedBytes)),msgBuffer.size()-msgBuffer.reservedBytes);
    00053     /* 4- deserialize the message
    00054      * This is a polymorphic call
    00055      * which may specialized in a daughter class
    00056      */
    00057     deserialize(msgBuffer);
    00058     G.Out(pdGendoc,"exit  Message::receive");
    00059 } /* end of receive */
    00060
    00061 void Message::deserialize(MessageBuffer& msgBuffer) {
    00062     G.Out(pdGendoc,"enter Message::deserialize");
    00063     /* We serialize the common Message part
    00064      * ALL Messages will contain the following
    00065      */
    00066     D[pdDebug] << "Deserialize <" << getName().c_str()<<">"<<std::endl;
    00067         readHeader(msgBuffer);
    00068         readBody(msgBuffer) ;
    00069     G.Out(pdGendoc,"exit Message::deserialize");
    00070 } /* end of deserialize */
    00071
    00072 // ----------------------------------------------------------------------------
    00074 void
    00075 Message::readBody(MessageBuffer &msgBuffer)
    00076 {
    00077     G.Out(pdGendoc,"enter Message::readBody");
    00078
    00079     // 1. Read Body from socket.
    00080     //socket->receive(body.getBuffer(), header.bodySize);
    00081      // FIXME EN: we must update the write pointer of the
    00082      //           MessageBody because we have just written
    00083      //           on it using direct pointer access !! (nasty usage)
    00084      //body.addToWritePointer(header.bodySize);
    00085
    00086     // 3. Read informations from Message Body according to message type.
    00087     if (exception != e_NO_EXCEPTION) {
    00088         exceptionReason = msgBuffer.read_string();
    00089     }
    00090     else {
    00091
    00092         // 1- Prepare Body Structure according to Message Type
    00093             //D.Mes(pdMessage, 'M', header.type);
    00094             this->trace("RTIG::chooseProcessingMethod ");
    00095
    00096         switch(type) {
    00097
    00098           // Empty body
    00099           case CLOSE_CONNEXION:
    00100             break;
    00101
    00102           // Body contains federationName, FEDid
    00103           // Note : relevant only on federate request
    00104           case CREATE_FEDERATION_EXECUTION:
    00105             readFederationName(msgBuffer);
    00106             readFEDid(msgBuffer) ;
    00107             break ;
    00108
    00109           // Body contains federationName
    00110           case DESTROY_FEDERATION_EXECUTION:
    00111             readFederationName(msgBuffer);
    00112             break ;
    00113
    00114           // Body contains label,tag,boolean and maybe
    00115           // handleArraySize,handleArray
    00116           case REGISTER_FEDERATION_SYNCHRONIZATION_POINT:
    00117             readLabel(msgBuffer);
    00118             readTag(msgBuffer);
    00119             boolean = msgBuffer.read_bool();
    00120             // boolean true means federates set exists
    00121             if ( boolean )
    00122                 {
    00123                 handleArraySize = msgBuffer.read_int16();
    00124                 readHandleArray(msgBuffer);
    00125                 }
    00126             break ;
    00127
    00128           // Body contains label,tag
    00129           case ANNOUNCE_SYNCHRONIZATION_POINT:
    00130           case REQUEST_FEDERATION_RESTORE_FAILED:
    00131             readLabel(msgBuffer);
    00132             readTag(msgBuffer);
    00133             break ;
    00134
    00135           // Body contains label
    00136           case SYNCHRONIZATION_POINT_REGISTRATION_FAILED:
    00137           case SYNCHRONIZATION_POINT_REGISTRATION_SUCCEEDED:
    00138           case SYNCHRONIZATION_POINT_ACHIEVED:
    00139           case FEDERATION_SYNCHRONIZED:
    00140           case REQUEST_FEDERATION_RESTORE:
    00141           case REQUEST_FEDERATION_RESTORE_SUCCEEDED:
    00142             readLabel(msgBuffer);
    00143             break ;
    00144
    00145           // Body contains federate,label
    00146           case INITIATE_FEDERATE_RESTORE:
    00147             federate = msgBuffer.read_int16();
    00148             readLabel(msgBuffer);
    00149             break ;
    00150
    00151           // Body contains label
    00152           case INITIATE_FEDERATE_SAVE:
    00153             readLabel(msgBuffer);
    00154             break ;
    00155
    00156           // Body contains label, boolean
    00157           case REQUEST_FEDERATION_SAVE:
    00158             readLabel(msgBuffer);
    00159             // boolean true means with time (in the header)
    00160             boolean = msgBuffer.read_bool();
    00161             break ;
    00162
    00163           // Body contains objectClass
    00164           case UNPUBLISH_OBJECT_CLASS:
    00165           case UNSUBSCRIBE_OBJECT_CLASS:
    00166           case START_REGISTRATION_FOR_OBJECT_CLASS:
    00167           case STOP_REGISTRATION_FOR_OBJECT_CLASS:
    00168             objectClass = msgBuffer.read_int64();
    00169             break;
    00170
    00171           // Body contains object,attribute,tag
    00172           case IS_ATTRIBUTE_OWNED_BY_FEDERATE:
    00173           case QUERY_ATTRIBUTE_OWNERSHIP:
    00174             object = msgBuffer.read_int64();
    00175             attribute = msgBuffer.read_int16();
    00176             readTag(msgBuffer);
    00177             break ;
    00178
    00179           // Body contains object,attribute,federate
    00180           case ATTRIBUTE_IS_NOT_OWNED:
    00181           case INFORM_ATTRIBUTE_OWNERSHIP:
    00182             object = msgBuffer.read_int64();
    00183             attribute = msgBuffer.read_int16();
    00184             federate = msgBuffer.read_int16();
    00185             break ;
    00186
    00187           // Body contains object,handleArraySize,HandleArray,tag
    00188           case NEGOTIATED_ATTRIBUTE_OWNERSHIP_DIVESTITURE:
    00189           case REQUEST_ATTRIBUTE_OWNERSHIP_ASSUMPTION:
    00190           case ATTRIBUTE_OWNERSHIP_ACQUISITION:
    00191           case REQUEST_ATTRIBUTE_OWNERSHIP_RELEASE:
    00192             object = msgBuffer.read_int64();
    00193             handleArraySize = msgBuffer.read_int16();
    00194             readHandleArray(msgBuffer);
    00195             readTag(msgBuffer);
    00196             break ;
    00197
    00198           // Body contains object,handleArraySize,HandleArray
    00199           case ATTRIBUTE_OWNERSHIP_ACQUISITION_IF_AVAILABLE:
    00200           case ATTRIBUTE_OWNERSHIP_ACQUISITION_NOTIFICATION:
    00201           case ATTRIBUTE_OWNERSHIP_UNAVAILABLE:
    00202           case UNCONDITIONAL_ATTRIBUTE_OWNERSHIP_DIVESTITURE:
    00203           case CANCEL_NEGOTIATED_ATTRIBUTE_OWNERSHIP_DIVESTITURE:
    00204           case ATTRIBUTE_OWNERSHIP_RELEASE_RESPONSE:
    00205           case CANCEL_ATTRIBUTE_OWNERSHIP_ACQUISITION:
    00206           case CONFIRM_ATTRIBUTE_OWNERSHIP_ACQUISITION_CANCELLATION:
    00207           case ATTRIBUTE_OWNERSHIP_DIVESTITURE_NOTIFICATION:
    00208             object = msgBuffer.read_int64();
    00209             handleArraySize = msgBuffer.read_int16();
    00210             readHandleArray(msgBuffer);
    00211             break ;
    00212
    00213           // Body contains object,region,boolean,handleArraySize,handleArray
    00214       case DDM_ASSOCIATE_REGION:
    00215         object = msgBuffer.read_int64();
    00216         region = msgBuffer.read_int64();
    00217         boolean = msgBuffer.read_bool();
    00218         handleArraySize = msgBuffer.read_int16();
    00219             readHandleArray(msgBuffer);
    00220         break ;
    00221
    00222           // Body contains objectClass,object,tag,handleArraySize,handleArray,
    00223           // regions
    00224       case DDM_REGISTER_OBJECT:
    00225         objectClass = msgBuffer.read_int64();
    00226         object = msgBuffer.read_int64();
    00227         readTag(msgBuffer);
    00228         handleArraySize = msgBuffer.read_int16();
    00229             readHandleArray(msgBuffer);
    00230         readRegions(msgBuffer);
    00231         break ;
    00232
    00233           // Body contains objectClass,region,boolean,handleArraySize,
    00234           // handleArray
    00235       case DDM_SUBSCRIBE_ATTRIBUTES:
    00236         objectClass = msgBuffer.read_int64();
    00237         region = msgBuffer.read_int64();
    00238         boolean = msgBuffer.read_bool();
    00239         handleArraySize = msgBuffer.read_int16();
    00240             readHandleArray(msgBuffer);
    00241         break ;
    00242
    00243           // Body contains object,region
    00244       case DDM_UNASSOCIATE_REGION:
    00245         object = msgBuffer.read_int64();
    00246         region = msgBuffer.read_int64();
    00247         break ;
    00248
    00249           // Body contains objectClass,region
    00250       case DDM_UNSUBSCRIBE_ATTRIBUTES:
    00251         objectClass = msgBuffer.read_int64();
    00252         region = msgBuffer.read_int64();
    00253         break ;
    00254
    00255           // Body contains interactionClass,region,boolean
    00256       case DDM_SUBSCRIBE_INTERACTION:
    00257       case DDM_UNSUBSCRIBE_INTERACTION:
    00258         interactionClass = msgBuffer.read_int64();
    00259         region = msgBuffer.read_int64();
    00260         boolean = msgBuffer.read_bool();
    00261         break ;
    00262
    00263           // Body contains objectClass,attribute,space
    00264           case GET_ATTRIBUTE_SPACE_HANDLE:
    00265             objectClass = msgBuffer.read_int64();
    00266             attribute = msgBuffer.read_int64();
    00267             space = msgBuffer.read_int64();
    00268             break ;
    00269
    00270           // Body contains space,number,region
    00271           case DDM_CREATE_REGION:
    00272             space  = msgBuffer.read_int64();
    00273             number = msgBuffer.read_int64();
    00274             region = msgBuffer.read_int64();
    00275             break ;
    00276
    00277           // Body contains interactionClass,space
    00278           case GET_INTERACTION_SPACE_HANDLE:
    00279             interactionClass = msgBuffer.read_int64();
    00280             space = msgBuffer.read_int64();
    00281             break ;
    00282
    00283           // Body contains federate,Federationname,FederateName
    00284           // Note : federate relevant on RTIA answer only
    00285           case JOIN_FEDERATION_EXECUTION:
    00286             federate = msgBuffer.read_int16();
    00287             readFederationName(msgBuffer);
    00288             readFederateName(msgBuffer);
    00289             break ;
    00290
    00291           // federationTime got from header
    00292           // Body contains objectClass,handleArraySize,HandleArray
    00293           case PUBLISH_OBJECT_CLASS:
    00294           case SUBSCRIBE_OBJECT_CLASS_ATTRIBUTES:
    00295             objectClass = msgBuffer.read_int64();
    00296             handleArraySize = msgBuffer.read_int16();
    00297             readHandleArray(msgBuffer);
    00298             break ;
    00299
    00300           // federationTime got from header
    00301           // Body contains objectClass,object,name
    00302           case REGISTER_OBJECT_INSTANCE:
    00303             objectClass = msgBuffer.read_int64();
    00304             object = msgBuffer.read_int64();
    00305             readName(msgBuffer);
    00306             break ;
    00307
    00308           // FederationTime (or zero) yet got from header
    00309           // Body contains objectClass,handleArraySize,object,tag,HandleArray,
    00310           // ValueArray,ResignAction and
    00311           // boolean (true with time, false without time)
    00312           case UPDATE_ATTRIBUTE_VALUES:
    00313           case REFLECT_ATTRIBUTE_VALUES:
    00314             objectClass = msgBuffer.read_int64();
    00315             handleArraySize = msgBuffer.read_int16();
    00316             object = msgBuffer.read_int64();
    00317             readTag(msgBuffer);
    00318             readHandleArray(msgBuffer);
    00319             readValueArray(msgBuffer);
    00320             readResignAction(msgBuffer);
    00321             boolean = msgBuffer.read_bool();
    00322             break ;
    00323
    00324           // FederationTime yet got from header
    00325           // Body contains objectClass,object,tag,name,label,resignAction
    00326           case DISCOVER_OBJECT_INSTANCE:
    00327             objectClass = msgBuffer.read_int64();
    00328             object = msgBuffer.read_int64();
    00329             readTag(msgBuffer);
    00330             readName(msgBuffer);
    00331             readLabel(msgBuffer);
    00332             readResignAction(msgBuffer);
    00333             break ;
    00334
    00335           // FederationTime yet put in header
    00336           // Body contains objectClass,object,tag,name,label,resignAction
    00337           case DELETE_OBJECT_INSTANCE:
    00338           case REMOVE_OBJECT_INSTANCE:
    00339             objectClass = msgBuffer.read_int64();
    00340             object = msgBuffer.read_int64();
    00341             readTag(msgBuffer);
    00342             readName(msgBuffer);
    00343             readLabel(msgBuffer);
    00344             readResignAction(msgBuffer);
    00345             boolean = msgBuffer.read_bool();
    00346             break ;
    00347
    00348           // Body contains object
    00349           case LOCAL_DELETE_OBJECT_INSTANCE:
    00350             break ;
    00351
    00352           // FederationTime yet got from header
    00353           // Body contains objectClass,name,attribute
    00354           case GET_OBJECT_CLASS_HANDLE:
    00355           case GET_OBJECT_CLASS_NAME:
    00356           case GET_ATTRIBUTE_HANDLE:
    00357           case GET_ATTRIBUTE_NAME:
    00358             objectClass = msgBuffer.read_int64();
    00359             readName(msgBuffer);
    00360             attribute = msgBuffer.read_int16();
    00361             break ;
    00362
    00363          // FederationTime yet got from header
    00364           // Body contains object,objectClass
    00365           case GET_OBJECT_CLASS:
    00366             object = msgBuffer.read_int64();
    00367             objectClass = msgBuffer.read_int64();
    00368             break ;
    00369
    00370           // Body contains name,space
    00371           case GET_SPACE_HANDLE:
    00372           case GET_SPACE_NAME:
    00373             this->readName(msgBuffer);
    00374             this->space = msgBuffer.read_int64();
    00375             break ;
    00376
    00377           // Body contains name,dimension,space
    00378           case GET_DIMENSION_HANDLE:
    00379           case GET_DIMENSION_NAME:
    00380             this->readName(msgBuffer);
    00381             this->dimension = msgBuffer.read_int64();
    00382             this->space = msgBuffer.read_int64();
    00383             break ;
    00384
    00385           case SEND_INTERACTION:
    00386           case RECEIVE_INTERACTION:
    00387             // Body contains interactionClass,handleArraySize,tag,handleArray,
    00388             // valueArray,region,resignAction,boolean
    00389             // boolean true means with time, false without time
    00390             interactionClass = msgBuffer.read_int64();
    00391             handleArraySize = msgBuffer.read_int16();
    00392             readTag(msgBuffer);
    00393             readHandleArray(msgBuffer);
    00394             readValueArray(msgBuffer);
    00395         region = msgBuffer.read_int64();
    00396             readResignAction(msgBuffer);
    00397             boolean = msgBuffer.read_bool();
    00398             break ;
    00399
    00400           // Body contains interactionClass,name,parameter
    00401           case GET_INTERACTION_CLASS_HANDLE:
    00402           case GET_INTERACTION_CLASS_NAME:
    00403           case GET_PARAMETER_HANDLE:
    00404           case GET_PARAMETER_NAME:
    00405             interactionClass = msgBuffer.read_int64();
    00406             readName(msgBuffer);
    00407             parameter = msgBuffer.read_int16();
    00408             break ;
    00409
    00410           // Body contains handleArraySize,transport,order,object,HandleArray
    00411           case CHANGE_ATTRIBUTE_TRANSPORTATION_TYPE:
    00412           case CHANGE_ATTRIBUTE_ORDER_TYPE:
    00413             handleArraySize = msgBuffer.read_int64();
    00414             transport = msgBuffer.read_int64();
    00415             order = msgBuffer.read_int64();
    00416             object = msgBuffer.read_int64();
    00417             readHandleArray(msgBuffer);
    00418             break ;
    00419
    00420           // Body contains interactionClass,transport,order
    00421           case CHANGE_INTERACTION_TRANSPORTATION_TYPE:
    00422           case CHANGE_INTERACTION_ORDER_TYPE:
    00423             interactionClass = msgBuffer.read_int64();
    00424             transport = msgBuffer.read_int64();
    00425             order = msgBuffer.read_int64();
    00426             break;
    00427
    00428           // Body contains name,transport
    00429           case GET_TRANSPORTATION_HANDLE:
    00430           case GET_TRANSPORTATION_NAME:
    00431             this->readName(msgBuffer);
    00432             transport = msgBuffer.read_int64();
    00433             break;
    00434
    00435           // Body contains name,order
    00436           case GET_ORDERING_HANDLE:
    00437           case GET_ORDERING_NAME:
    00438             this->readName(msgBuffer);
    00439             order = msgBuffer.read_int64();
    00440             break;
    00441
    00442           // Body contains region,extents
    00443       case DDM_MODIFY_REGION:
    00444             region = msgBuffer.read_int64();
    00445         readExtents(msgBuffer);
    00446         break ;
    00447
    00448           // Body contains region
    00449       case DDM_DELETE_REGION:
    00450             region = msgBuffer.read_int64();
    00451         break ;
    00452
    00453           // Body contains object,name
    00454       case GET_OBJECT_INSTANCE_HANDLE:
    00455       case GET_OBJECT_INSTANCE_NAME:
    00456             object = msgBuffer.read_int64();
    00457         readName(msgBuffer);
    00458         break;
    00459
    00460           // Body contains resignAction
    00461           case RESIGN_FEDERATION_EXECUTION:
    00462             readResignAction(msgBuffer);
    00463             break;
    00464
    00465           // Body contains interactionClass
    00466           case PUBLISH_INTERACTION_CLASS:
    00467           case UNPUBLISH_INTERACTION_CLASS:
    00468           case SUBSCRIBE_INTERACTION_CLASS:
    00469           case UNSUBSCRIBE_INTERACTION_CLASS:
    00470           case TURN_INTERACTIONS_ON:
    00471           case TURN_INTERACTIONS_OFF:
    00472             interactionClass = msgBuffer.read_int64();
    00473             break ;
    00474
    00475           // Body contains boolean
    00476           case ENABLE_TIME_REGULATION:
    00477           case DISABLE_TIME_REGULATION:
    00478           case ENABLE_TIME_CONSTRAINED:
    00479           case DISABLE_TIME_CONSTRAINED:
    00480             boolean = msgBuffer.read_bool();
    00481             lookahead = msgBuffer.read_double();
    00482             break ;
    00483
    00484       // Body contains boolean
    00485       case ENABLE_CLASS_RELEVANCE_ADVISORY_SWITCH:
    00486       case DISABLE_CLASS_RELEVANCE_ADVISORY_SWITCH:
    00487       case ENABLE_INTERACTION_RELEVANCE_ADVISORY_SWITCH:
    00488       case DISABLE_INTERACTION_RELEVANCE_ADVISORY_SWITCH:
    00489       case ENABLE_ATTRIBUTE_RELEVANCE_ADVISORY_SWITCH:
    00490       case DISABLE_ATTRIBUTE_RELEVANCE_ADVISORY_SWITCH:
    00491       case ENABLE_ATTRIBUTE_SCOPE_ADVISORY_SWITCH:
    00492       case DISABLE_ATTRIBUTE_SCOPE_ADVISORY_SWITCH:
    00493         break;
    00494
    00495           // Body contains boolean, TickTime, TickTime
    00496           case TICK_REQUEST:
    00497             boolean = msgBuffer.read_bool();
    00498             msgBuffer.read_bytes((char *)&minTickTime, sizeof(minTickTime));
    00499             msgBuffer.read_bytes((char *)&maxTickTime, sizeof(maxTickTime));
    00500             break ;
    00501
    00502           // Body contains objectClass, handleArraySize,
    00503           // handleArray
    00504           case REQUEST_CLASS_ATTRIBUTE_VALUE_UPDATE:
    00505             objectClass = msgBuffer.read_int64();
    00506             handleArraySize = msgBuffer.read_int16();
    00507             readHandleArray(msgBuffer);
    00508             break;
    00509
    00510           // Body contains object,handleArraySize,
    00511           // handleArray
    00512           case REQUEST_OBJECT_ATTRIBUTE_VALUE_UPDATE:
    00513             object = msgBuffer.read_int64();
    00514             handleArraySize = msgBuffer.read_int16();
    00515             readHandleArray(msgBuffer);
    00516             break;
    00517
    00518           case PROVIDE_ATTRIBUTE_VALUE_UPDATE:
    00519         object = msgBuffer.read_int64();
    00520             handleArraySize = msgBuffer.read_int16();
    00521             readHandleArray(msgBuffer);
    00522         break ;
    00523
    00524           // lookahead got from header
    00525           // Warning : FederationTime has been modified (needs validation)
    00526           case MODIFY_LOOKAHEAD:
    00527           case QUERY_LOOKAHEAD:
    00528             // we get another time but is the lookahead
    00529             lookahead = msgBuffer.read_double();
    00530             fed_time.setZero();
    00531             break ;
    00532
    00533             // -- Default Handler --
    00534             default:
    00535               G.Out(pdGendoc,"exit  Message::readBody with nothing to do");
    00536
    00537         }
    00538     }
    00539     G.Out(pdGendoc,"exit  Message::readBody");
    00540 }
    00541
    00542 // ----------------------------------------------------------------------------
    00545 void
    00546 Message::readHeader(MessageBuffer &msgBuffer)
    00547 {
    00548     G.Out(pdGendoc,"enter Message::readHeader");
    00549
    00550     // 1- get Header (not a really header but buffer beginning)
    00551
    00552     type = (Type)msgBuffer.read_int32() ;
    00553     exception = (TypeException)msgBuffer.read_int32();
    00554     setFederationTime(msgBuffer.read_double());
    00555     // If the message carry an exception, the Body will only contain the
    00556     // exception reason.
    00557
    00558     D.Out(pdDebug,"Received message type <%d> ",type);
    00559
    00560     if (exception != e_NO_EXCEPTION)
    00561         {
    00562         G.Out(pdGendoc,"exit  Message::readHeader carrying an exception");
    00563         return ;
    00564         }
    00565
    00566     G.Out(pdGendoc,"exit  Message::readHeader");
    00567 }
    00568
    00569 // ----------------------------------------------------------------------------
    00570 void
    00571 Message::readHandleArray(MessageBuffer &msgBuffer)
    00572 {
    00573     //handleArraySize = msgBuffer.read_uint16() ;
    00574     handleArray.resize(handleArraySize) ;
    00575     for ( short i=0 ; i<handleArraySize ; i++)
    00576       {
    00577       handleArray[i] = msgBuffer.read_uint64() ;
    00578       }
    00579 }
    00580
    00581 // ----------------------------------------------------------------------------
    00582 void
    00583 Message::readLabel(MessageBuffer &msgBuffer)
    00584 {
    00585     label = msgBuffer.read_string() ;
    00586 }
    00587
    00588 // ----------------------------------------------------------------------------
    00589 void
    00590 Message::readName(MessageBuffer &msgBuffer)
    00591 {
    00592     name = msgBuffer.read_string();
    00593 }
    00594
    00595 // ----------------------------------------------------------------------------
    00596 void
    00597 Message::readFederationName(MessageBuffer &msgBuffer)
    00598 {
    00599     federationName = msgBuffer.read_string() ;
    00600 }
    00601
    00602 // ----------------------------------------------------------------------------
    00603 void
    00604 Message::readFederateName(MessageBuffer &msgBuffer)
    00605 {
    00606     federateName = msgBuffer.read_string() ;
    00607 }
    00608
    00609 // ----------------------------------------------------------------------------
    00610 void
    00611 Message::readResignAction(MessageBuffer &msgBuffer)
    00612 {
    00613     // BUG: Should do something.
    00614 }
    00615
    00616 // ----------------------------------------------------------------------------
    00617 void
    00618 Message::readTag(MessageBuffer &msgBuffer)
    00619 {
    00620     tag = msgBuffer.read_string();
    00621 }
    00622
    00623 // ----------------------------------------------------------------------------
    00624 void
    00625 Message::readFEDid(MessageBuffer &msgBuffer)
    00626 {
    00627     FEDid = msgBuffer.read_string();
    00628 }
    00629
    00630 // ----------------------------------------------------------------------------
    00632 void
    00633 Message::readValueArray(MessageBuffer &msgBuffer)
    00634 {
    00635    G.Out(pdGendoc,"enter Message::readValueArray");
    00636
    00637     valueArray.resize(handleArraySize) ;
    00638     for (int i = 0 ; i < handleArraySize ; i ++)
    00639         valueArray[i] = msgBuffer.read_string();
    00640 }
    00641
    00642 // ----------------------------------------------------------------------------
    00643 void Message::trace(const char* context)
    00644 {
    00645 #ifndef NDEBUG
    00646 D.Mes(pdMessage,'M',this->type,context);
    00647 #endif
    00648 }
    00649
    00650 } // namespace certi
    00651
    00652 // $Id: Message_R.cc,v 3.34 2008/11/21 12:45:25 approx Exp $