# Message_W.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_W.cc,v 3.40 2009/04/02 19:58:08 erk 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::send(SocketUN *socket, MessageBuffer &msgBuffer) throw (NetworkError, NetworkSignal) {
    00038     G.Out(pdGendoc,"enter Message::send");
    00039     /* 0- reset send buffer */
    00040     msgBuffer.reset();
    00041     /* 1- serialize the message
    00042      * This is a polymorphic call
    00043      * which may specialized in a daughter class
    00044      */
    00045     serialize(msgBuffer);
    00046     /* 2- update message buffer 'reserved bytes' header */
    00047     msgBuffer.updateReservedBytes();
    00048     D.Out(pdDebug,"Sending <%s> whose buffer has <%u> bytes",getName().c_str(),msgBuffer.size());
    00049     //msgBuf.show(msgBuffer(0),5);
    00050     /* 3- effectively send the raw message to socket */
    00051     socket->send(static_cast<unsigned char*>(msgBuffer(0)), msgBuffer.size());
    00052     G.Out(pdGendoc,"exit  Message::send");
    00053 } /* end of send */
    00054
    00055 // ----------------------------------------------------------------------------
    00056 void Message::serialize(MessageBuffer& msgBuffer) {
    00057     G.Out(pdGendoc,"enter Message::serialize");
    00058     /* We serialize the common messages part
    00059      * ALL Message will contain the following
    00060      */
    00061     if ((type==NOT_USED) || (type==LAST)) {
    00062         throw RTIinternalError("Invalid message type (not a valid type);");
    00063     }
    00064     D.Out(pdDebug, "Serialize <%s>", getName().c_str());
    00065         writeHeader(msgBuffer);
    00066         writeBody(msgBuffer);
    00067     /*
    00068      * "builtin" Optional part
    00069      * The subclass may chose in the constructor the variable part.
    00070      * isDated may be chosen on Message instance basis
    00071      * (same message may Dated or Not Dated)
    00072      */
    00073     G.Out(pdGendoc,"exit Message::serialize");
    00074 } /* end of serialize */
    00075
    00076
    00077 // ----------------------------------------------------------------------------
    00082 void
    00083 Message::writeBody(MessageBuffer &msgBuffer)
    00084 {
    00085     G.Out(pdGendoc,"enter Message::writeBody type %d",type);
    00086
    00087     // If the message carry an exception, the Body will only contain the
    00088     // exception reason.
    00089
    00090     if (exception != e_NO_EXCEPTION) {
    00091         msgBuffer.write_string(exceptionReason);
    00092     }
    00093     else {
    00094
    00095         // 1- Prepare Body Structure according to Message type
    00096         switch(type) {
    00097
    00098           // Empty body
    00099           case CLOSE_CONNEXION:
    00100             break;
    00101
    00102           // Body contains federationName,FEDid
    00103           case CREATE_FEDERATION_EXECUTION:
    00104             writeFederationName(msgBuffer);
    00105             writeFEDid(msgBuffer);
    00106             break ;
    00107
    00108           // Body contains federationName
    00109           case DESTROY_FEDERATION_EXECUTION:
    00110             writeFederationName(msgBuffer);
    00111             break ;
    00112
    00113           // Body contains label,tag,boolean and maybe
    00114           // handleArraySize,handleArray
    00115           case REGISTER_FEDERATION_SYNCHRONIZATION_POINT:
    00116             msgBuffer.write_string(label);
    00117             msgBuffer.write_string(tag);
    00118             msgBuffer.write_bool(boolean);
    00119             // boolean true means federates set exists
    00120             if ( boolean )
    00121                 {
    00122                 msgBuffer.write_int16(handleArraySize);
    00123                 writeHandleArray(msgBuffer);
    00124                 }
    00125             break ;
    00126
    00127           // RFS needs label and boolean in the body and time in the header
    00128           case REQUEST_FEDERATION_SAVE:
    00129             msgBuffer.write_string(label);
    00130             msgBuffer.write_bool(boolean);
    00131             break;
    00132
    00133           // Body contains label
    00134           case INITIATE_FEDERATE_SAVE:
    00135             msgBuffer.write_string(label);
    00136             break;
    00137
    00138           // Body contains federate,label
    00139           case INITIATE_FEDERATE_RESTORE:
    00140             msgBuffer.write_int16(federate);
    00141             msgBuffer.write_string(label);
    00142             break;
    00143
    00144           // Body contains label,tag
    00145           case ANNOUNCE_SYNCHRONIZATION_POINT:
    00146           case REQUEST_FEDERATION_RESTORE_FAILED:
    00147             msgBuffer.write_string(label);
    00148             msgBuffer.write_string(tag);
    00149             break ;
    00150
    00151           // Body contains label (i.e. String)
    00152           case SYNCHRONIZATION_POINT_REGISTRATION_FAILED:
    00153           case SYNCHRONIZATION_POINT_REGISTRATION_SUCCEEDED:
    00154           case SYNCHRONIZATION_POINT_ACHIEVED:
    00155           case FEDERATION_SYNCHRONIZED:
    00156           case REQUEST_FEDERATION_RESTORE:
    00157           case REQUEST_FEDERATION_RESTORE_SUCCEEDED:
    00158             msgBuffer.write_string(label);
    00159             break ;
    00160
    00161           // Body contains objectClass
    00162           case UNPUBLISH_OBJECT_CLASS:
    00163           case UNSUBSCRIBE_OBJECT_CLASS:
    00164           case START_REGISTRATION_FOR_OBJECT_CLASS:
    00165           case STOP_REGISTRATION_FOR_OBJECT_CLASS:
    00166             msgBuffer.write_int64(objectClass);
    00167             break;
    00168
    00169           // Body contains object,attribute,tag
    00170           case IS_ATTRIBUTE_OWNED_BY_FEDERATE:
    00171           case QUERY_ATTRIBUTE_OWNERSHIP:
    00172             msgBuffer.write_int64(object);
    00173             msgBuffer.write_int16(attribute);
    00174             msgBuffer.write_string(tag);
    00175             break ;
    00176
    00177           // Body contains object,attribute,federate
    00178           case ATTRIBUTE_IS_NOT_OWNED:
    00179           case INFORM_ATTRIBUTE_OWNERSHIP:
    00180             msgBuffer.write_int64(object);
    00181             msgBuffer.write_int16(attribute);
    00182             msgBuffer.write_int16(federate);
    00183             break ;
    00184
    00185           // Body contains object,handleArraySize,HandleArray,tag
    00186           case NEGOTIATED_ATTRIBUTE_OWNERSHIP_DIVESTITURE:
    00187           case REQUEST_ATTRIBUTE_OWNERSHIP_ASSUMPTION:
    00188           case ATTRIBUTE_OWNERSHIP_ACQUISITION:
    00189           case REQUEST_ATTRIBUTE_OWNERSHIP_RELEASE:
    00190             msgBuffer.write_int64(object);
    00191             msgBuffer.write_int16(handleArraySize);
    00192             writeHandleArray(msgBuffer);
    00193             msgBuffer.write_string(tag);
    00194             break ;
    00195
    00196           // Body contains object,handleArraySize,HandleArray
    00197           case ATTRIBUTE_OWNERSHIP_ACQUISITION_IF_AVAILABLE:
    00198           case ATTRIBUTE_OWNERSHIP_ACQUISITION_NOTIFICATION:
    00199           case ATTRIBUTE_OWNERSHIP_UNAVAILABLE:
    00200           case UNCONDITIONAL_ATTRIBUTE_OWNERSHIP_DIVESTITURE:
    00201           case ATTRIBUTE_OWNERSHIP_DIVESTITURE_NOTIFICATION:
    00202           case CANCEL_NEGOTIATED_ATTRIBUTE_OWNERSHIP_DIVESTITURE:
    00203           case ATTRIBUTE_OWNERSHIP_RELEASE_RESPONSE:
    00204           case CANCEL_ATTRIBUTE_OWNERSHIP_ACQUISITION:
    00205           case CONFIRM_ATTRIBUTE_OWNERSHIP_ACQUISITION_CANCELLATION:
    00206             msgBuffer.write_int64(object);
    00207             msgBuffer.write_int16(handleArraySize);
    00208             writeHandleArray(msgBuffer);
    00209             break ;
    00210
    00211           // Body contains object,handleArraySize,
    00212           // handleArray
    00213           case REQUEST_OBJECT_ATTRIBUTE_VALUE_UPDATE:
    00214         msgBuffer.write_int64(object);
    00215             msgBuffer.write_int16(handleArraySize);
    00216             writeHandleArray(msgBuffer);
    00217         break ;
    00218
    00219           // Body contains object,handleArraySize,
    00220           // handleArray
    00221           case PROVIDE_ATTRIBUTE_VALUE_UPDATE:
    00222         msgBuffer.write_int64(object);
    00223             msgBuffer.write_int16(handleArraySize);
    00224             writeHandleArray(msgBuffer);
    00225         break ;
    00226
    00227
    00228           // Body contains object,region,boolean,handleArraySize,handleArray
    00229       case DDM_ASSOCIATE_REGION:
    00230         msgBuffer.write_int64(object);
    00231         msgBuffer.write_int64(region);
    00232         msgBuffer.write_bool(boolean);
    00233             msgBuffer.write_int16(handleArraySize);
    00234             writeHandleArray(msgBuffer);
    00235         break ;
    00236
    00237           // Body contains objectClass,object,tag,handleArraySize,handleArray,
    00238           // regions
    00239       case DDM_REGISTER_OBJECT:
    00240         msgBuffer.write_int64(objectClass);
    00241         msgBuffer.write_int64(object);
    00242         msgBuffer.write_string(tag);
    00243             msgBuffer.write_int16(handleArraySize);
    00244             writeHandleArray(msgBuffer);
    00245         writeRegions(msgBuffer);
    00246         break ;
    00247
    00248           // Body contains objectClass,region,boolean,handleArraySize,
    00249           // handleArray
    00250       case DDM_SUBSCRIBE_ATTRIBUTES:
    00251         msgBuffer.write_int64(objectClass);
    00252         msgBuffer.write_int64(region);
    00253         msgBuffer.write_bool(boolean);
    00254             msgBuffer.write_int16(handleArraySize);
    00255             writeHandleArray(msgBuffer);
    00256         break ;
    00257
    00258           // Body contains object,region
    00259       case DDM_UNASSOCIATE_REGION:
    00260         msgBuffer.write_int64(object);
    00261         msgBuffer.write_int64(region);
    00262         break ;
    00263
    00264           // Body contains objectClass,region
    00265       case DDM_UNSUBSCRIBE_ATTRIBUTES:
    00266         msgBuffer.write_int64(objectClass);
    00267         msgBuffer.write_int64(region);
    00268         break ;
    00269
    00270           // Body contains interactionClass,region,boolean
    00271       case DDM_SUBSCRIBE_INTERACTION:
    00272       case DDM_UNSUBSCRIBE_INTERACTION:
    00273         msgBuffer.write_int64(interactionClass);
    00274         msgBuffer.write_int64(region);
    00275         msgBuffer.write_bool(boolean);
    00276         break ;
    00277
    00278           // Body contains objectClass,attribute,space
    00279           case GET_ATTRIBUTE_SPACE_HANDLE:
    00280             msgBuffer.write_int64(objectClass);
    00281             msgBuffer.write_int64(attribute);
    00282             msgBuffer.write_int64(space);
    00283             break ;
    00284
    00285           // Body contains space,number,region
    00286           case DDM_CREATE_REGION:
    00287             msgBuffer.write_int64(space) ;
    00288             msgBuffer.write_int64(number);
    00289             msgBuffer.write_int64(region);
    00290             break ;
    00291
    00292           // Body contains interactionClass,space
    00293           case GET_INTERACTION_SPACE_HANDLE:
    00294             msgBuffer.write_int64(interactionClass);
    00295             msgBuffer.write_int64(space);
    00296             break ;
    00297
    00298           // Body contains federate,federationName,federateName
    00299           // Note : federate relevant on RTIA answer only
    00300           case JOIN_FEDERATION_EXECUTION:
    00301             msgBuffer.write_int16(federate);
    00302             writeFederationName(msgBuffer);
    00303             msgBuffer.write_string(federateName);
    00304             break ;
    00305
    00306           // FederationTime yet put in header
    00307           // Body contains objectClass,handleArraySize,HandleArray
    00308           case PUBLISH_OBJECT_CLASS:
    00309           case SUBSCRIBE_OBJECT_CLASS_ATTRIBUTES:
    00310             msgBuffer.write_int64(objectClass);
    00311             msgBuffer.write_int16(handleArraySize);
    00312             writeHandleArray(msgBuffer);
    00313             break ;
    00314
    00315           // FederationTime yet put in header
    00316           // Body contains objectClass,object,name
    00317           case REGISTER_OBJECT_INSTANCE:
    00318             msgBuffer.write_int64(objectClass);
    00319             msgBuffer.write_int64(object);
    00320             msgBuffer.write_string(name);
    00321             break ;
    00322
    00323           // FederationTime (or zero) yet put in header
    00324           // Body contains objectClass,handleArraySize,object,tag,HandleArray,
    00325           // ValueArray,ResignAction and
    00326           // boolean (true with time, false without time)
    00327           case UPDATE_ATTRIBUTE_VALUES:
    00328           case REFLECT_ATTRIBUTE_VALUES:
    00329             msgBuffer.write_int64(objectClass);
    00330             msgBuffer.write_int16(handleArraySize);
    00331             msgBuffer.write_int64(object);
    00332             msgBuffer.write_string(tag);
    00333             writeHandleArray(msgBuffer);
    00334             writeValueArray(msgBuffer);
    00335             writeResignAction(msgBuffer);
    00336             msgBuffer.write_bool(boolean);
    00337             break ;
    00338
    00339           // FederationTime yet put in header
    00340           // Body contains objectClass,object,tag,name,label,resignAction
    00341           case DISCOVER_OBJECT_INSTANCE:
    00342             msgBuffer.write_int64(objectClass);
    00343             msgBuffer.write_int64(object);
    00344             msgBuffer.write_string(tag);
    00345             msgBuffer.write_string(name);
    00346             msgBuffer.write_string(label);
    00347             writeResignAction(msgBuffer);
    00348             break ;
    00349
    00350           // FederationTime yet put in header
    00351           // Body contains objectClass,object,tag,name,label,resignAction
    00352           case DELETE_OBJECT_INSTANCE:
    00353           case REMOVE_OBJECT_INSTANCE:
    00354             msgBuffer.write_int64(objectClass);
    00355             msgBuffer.write_int64(object);
    00356             msgBuffer.write_string(tag);
    00357             msgBuffer.write_string(name);
    00358             msgBuffer.write_string(label);
    00359             writeResignAction(msgBuffer);
    00360         msgBuffer.write_bool(boolean);
    00361             break ;
    00362
    00363           // Body contains object
    00364           case LOCAL_DELETE_OBJECT_INSTANCE:
    00365             msgBuffer.write_int64(object);
    00366             break;
    00367
    00368           // FederationTime yet put in header
    00369           // Body contains objectClass,name,attribute
    00370           case GET_OBJECT_CLASS_HANDLE:
    00371           case GET_OBJECT_CLASS_NAME:
    00372           case GET_ATTRIBUTE_HANDLE:
    00373           case GET_ATTRIBUTE_NAME:
    00374             msgBuffer.write_int64(objectClass);
    00375             msgBuffer.write_string(name);
    00376             msgBuffer.write_int16(attribute);
    00377             break ;
    00378
    00379          // FederationTime yet put in header
    00380           // Body contains object,objectClass
    00381           case GET_OBJECT_CLASS:
    00382             msgBuffer.write_int64(object);
    00383             msgBuffer.write_int64(objectClass);
    00384             break;
    00385
    00386           // Body contains name,space
    00387           case GET_SPACE_HANDLE:
    00388           case GET_SPACE_NAME:
    00389             msgBuffer.write_string(name);
    00390             msgBuffer.write_int64(space);
    00391             break ;
    00392
    00393           // Body contains name,dimension,space
    00394           case GET_DIMENSION_HANDLE:
    00395           case GET_DIMENSION_NAME:
    00396             msgBuffer.write_string(name);
    00397             msgBuffer.write_int64(dimension);
    00398             msgBuffer.write_int64(space);
    00399             break ;
    00400
    00401           // Body contains interactionClass,handleArraySize,tag,handleArray,
    00402           // valueArray,region,resignAction
    00403           // and boolean (true with time, false without time)
    00404           case SEND_INTERACTION:
    00405           case RECEIVE_INTERACTION:
    00406             msgBuffer.write_int64(interactionClass);
    00407             msgBuffer.write_int16(handleArraySize);
    00408             msgBuffer.write_string(tag);
    00409             writeHandleArray(msgBuffer);
    00410             writeValueArray(msgBuffer);
    00411         msgBuffer.write_int64(region);
    00412             writeResignAction(msgBuffer);
    00413             msgBuffer.write_bool(boolean);
    00414             break ;
    00415
    00416           // Body contains interactionClass,name,parameter
    00417           case GET_INTERACTION_CLASS_HANDLE:
    00418           case GET_INTERACTION_CLASS_NAME:
    00419           case GET_PARAMETER_HANDLE:
    00420           case GET_PARAMETER_NAME:
    00421             msgBuffer.write_int64(interactionClass);
    00422             msgBuffer.write_string(name);
    00423             msgBuffer.write_int16(parameter);
    00424             break ;
    00425
    00426           // Body contains handleArraySize,transport,order,object,HandleArray
    00427           case CHANGE_ATTRIBUTE_TRANSPORTATION_TYPE:
    00428           case CHANGE_ATTRIBUTE_ORDER_TYPE:
    00429             msgBuffer.write_int16(handleArraySize);
    00430             msgBuffer.write_int64(transport);
    00431             msgBuffer.write_int64(order);
    00432             msgBuffer.write_int64(object);
    00433             writeHandleArray(msgBuffer);
    00434             break ;
    00435
    00436           // Body contains interactionClass,transport,order
    00437           case CHANGE_INTERACTION_TRANSPORTATION_TYPE:
    00438           case CHANGE_INTERACTION_ORDER_TYPE:
    00439             msgBuffer.write_int64(interactionClass);
    00440             msgBuffer.write_int64(transport);
    00441             msgBuffer.write_int64(order);
    00442             break ;
    00443
    00444           // Body contains name,transport
    00445           case GET_TRANSPORTATION_HANDLE:
    00446           case GET_TRANSPORTATION_NAME:
    00447             msgBuffer.write_string(name);
    00448             msgBuffer.write_int64(transport);
    00449             break ;
    00450
    00451           // Body contains name,order
    00452           case GET_ORDERING_HANDLE:
    00453           case GET_ORDERING_NAME:
    00454             msgBuffer.write_string(name);
    00455             msgBuffer.write_int64(order);
    00456             break ;
    00457
    00458           // Body contains region,extents
    00459       case DDM_MODIFY_REGION:
    00460             msgBuffer.write_int64(region);
    00461         writeExtents(msgBuffer);
    00462         break ;
    00463
    00464           // Body contains region
    00465       case DDM_DELETE_REGION:
    00466             msgBuffer.write_int64(region);
    00467         break ;
    00468
    00469           // Body contains object,name
    00470       case GET_OBJECT_INSTANCE_HANDLE:
    00471       case GET_OBJECT_INSTANCE_NAME :
    00472         msgBuffer.write_int64(object);
    00473         msgBuffer.write_string(name);
    00474         break;
    00475
    00476           // Body contains ResignAction
    00477           case RESIGN_FEDERATION_EXECUTION:
    00478             writeResignAction(msgBuffer);
    00479             break;
    00480
    00481           // Body contains interactionClass
    00482           case PUBLISH_INTERACTION_CLASS:
    00483           case UNPUBLISH_INTERACTION_CLASS:
    00484           case SUBSCRIBE_INTERACTION_CLASS:
    00485           case UNSUBSCRIBE_INTERACTION_CLASS:
    00486           case TURN_INTERACTIONS_ON:
    00487           case TURN_INTERACTIONS_OFF:
    00488             msgBuffer.write_int64(interactionClass);
    00489             break ;
    00490
    00491           // Body contains boolean
    00492           case ENABLE_TIME_REGULATION:
    00493           case DISABLE_TIME_REGULATION:
    00494           case ENABLE_TIME_CONSTRAINED:
    00495           case DISABLE_TIME_CONSTRAINED:
    00496             msgBuffer.write_bool(boolean);
    00497             msgBuffer.write_double(lookahead.getTime());
    00498             break ;
    00499
    00500       // Body contains boolean
    00501       case ENABLE_CLASS_RELEVANCE_ADVISORY_SWITCH:
    00502       case DISABLE_CLASS_RELEVANCE_ADVISORY_SWITCH:
    00503       case ENABLE_INTERACTION_RELEVANCE_ADVISORY_SWITCH:
    00504       case DISABLE_INTERACTION_RELEVANCE_ADVISORY_SWITCH:
    00505       case ENABLE_ATTRIBUTE_RELEVANCE_ADVISORY_SWITCH:
    00506       case DISABLE_ATTRIBUTE_RELEVANCE_ADVISORY_SWITCH:
    00507       case ENABLE_ATTRIBUTE_SCOPE_ADVISORY_SWITCH:
    00508       case DISABLE_ATTRIBUTE_SCOPE_ADVISORY_SWITCH:
    00509         break;
    00510
    00511           // Body contains boolean, TickTime, TickTime
    00512           case TICK_REQUEST:
    00513             msgBuffer.write_bool(boolean);
    00514             msgBuffer.write_bytes((char *)&minTickTime, sizeof(minTickTime));
    00515             msgBuffer.write_bytes((char *)&maxTickTime, sizeof(maxTickTime));
    00516             break ;
    00517
    00518           // Body contains objectClass, handleArray
    00519           case REQUEST_CLASS_ATTRIBUTE_VALUE_UPDATE:
    00520             msgBuffer.write_int64(objectClass);
    00521             msgBuffer.write_int16(handleArraySize);
    00522             writeHandleArray(msgBuffer);
    00523             break;
    00524
    00525           // lookahead
    00526           // Warning : FederationTime has been modified (needs validation)
    00527           case MODIFY_LOOKAHEAD:
    00528           case QUERY_LOOKAHEAD:
    00529             // we put another time but is the lookahead
    00530         msgBuffer.write_double(lookahead.getTime());
    00531             break ;
    00532             // -- Default Handler --
    00533
    00534           default:
    00535           // Nothing to do
    00536           G.Out(pdGendoc,"exit  Message::writeBody with nothing to do");
    00537
    00538         }
    00539     }
    00540     G.Out(pdGendoc,"exit  Message::writeBody");
    00541 }
    00542
    00543 // ----------------------------------------------------------------------------
    00544 void
    00545 Message::writeHandleArray(MessageBuffer &msgBuffer)
    00546 {
    00547     //msgBuffer.write_bytes( (char *)handleArray,(unsigned int)(handleArraySize * sizeof(AttributeHandle))) ;
    00548     //msgBuffer.write_uint16(handleArraySize) ;
    00549     for ( short i=0 ; i<handleArraySize ; i++)
    00550       {
    00551       msgBuffer.write_uint64(handleArray[i]) ;
    00552       }
    00553 }
    00554
    00555 // ----------------------------------------------------------------------------
    00558 void
    00559 Message::writeHeader(MessageBuffer &msgBuffer)
    00560 {
    00561     G.Out(pdGendoc,"enter Message::writeHeader");
    00562
    00563     // header contains type,exception and federationTime
    00564     // Note sometimes federationTime is not useful.
    00565     msgBuffer.write_int32(this->type) ;
    00566     msgBuffer.write_int32(this->exception);
    00567     msgBuffer.write_double(getFederationTime().getTime());
    00568
    00569     // If the message carry an exception, the Body will only contain the
    00570     // exception reason.
    00571     if (exception != e_NO_EXCEPTION) {
    00572         G.Out(pdGendoc,"exit  Message::writeHeader carrying exception");
    00573         return ;
    00574     }
    00575
    00576     G.Out(pdGendoc,"exit  Message::writeHeader");
    00577 }
    00578
    00579 // ---------------------------------------------------------------
    00580 void
    00581 Message::writeResignAction(MessageBuffer &msgBuffer)
    00582 {
    00583     //assert(false);
    00584 }
    00585
    00586 // ---------------------------------------------------------------
    00587 void
    00588 Message::writeFEDid(MessageBuffer &msgBuffer)
    00589 {
    00590     msgBuffer.write_string(FEDid) ;
    00591 }
    00592
    00593 // ---------------------------------------------------------------
    00594 void
    00595 Message::writeFederationName(MessageBuffer &msgBuffer)
    00596 {
    00597     msgBuffer.write_string(federationName) ;
    00598 }
    00599
    00600 // ---------------------------------------------------------------------------
    00601 void
    00602 Message::writeValueArray(MessageBuffer &msgBuffer)
    00603 {
    00604     // length and value are stored into valueArray
    00605     // so we have to write length and then value with a write_bytes
    00606     for (int i = 0 ; i < handleArraySize ; i ++)
    00607         msgBuffer.write_string(valueArray[i]) ;
    00608 }
    00609
    00610 } // namespace certi
    00611
    00612 // $Id: Message_W.cc,v 3.40 2009/04/02 19:58:08 erk Exp $