# Statistics.cc

Go to the documentation of this file.

    00001 // ----------------------------------------------------------------------------
    00002 // CERTI - HLA RunTime Infrastructure
    00003 // Copyright (C) 2003-2005  ONERA
    00004 //
    00005 // This file is part of CERTI
    00006 //
    00007 // CERTI is free software ; you can redistribute it and/or modify
    00008 // it under the terms of the GNU General Public License as published by
    00009 // the Free Software Foundation ; either version 2 of the License, or
    00010 // (at your option) any later version.
    00011 //
    00012 // CERTI is distributed in the hope that it will be useful,
    00013 // but WITHOUT ANY WARRANTY ; without even the implied warranty of
    00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
    00015 // GNU General Public License for more details.
    00016 //
    00017 // You should have received a copy of the GNU General Public License
    00018 // along with this program ; if not, write to the Free Software
    00019 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    00020 //
    00021 // ----------------------------------------------------------------------------
    00022
    00023 #include <config.h>
    00024 #include "Statistics.hh"
    00025
    00026 #include <cstdlib>
    00027 #include <iostream>
    00028 #include <string>
    00029
    00030 using std::cout ;
    00031 using std::endl ;
    00032 using std::string ;
    00033 using std::ostream ;
    00034 using std::endl ;
    00035 using std::vector ;
    00036
    00037 #define STRINGIZE(m) #m
    00038 #define FED_MSG_NAME(msg_) fedMessageName[msg_] = STRINGIZE(msg_)
    00039 #define RTI_MSG_NAME(msg_) rtiMessageName[msg_] = STRINGIZE(msg_)
    00040
    00041 namespace certi {
    00042 namespace rtia {
    00043
    00044 bool Statistics::initialized = false ;
    00045 vector<string> Statistics::fedMessageName(Message::LAST);
    00046 vector<string> Statistics::rtiMessageName(NetworkMessage::LAST);
    00047
    00048 // ----------------------------------------------------------------------------
    00050 Statistics::Statistics()
    00051     : federateServiceSet(Message::LAST, 0),
    00052       rtiServiceSet(NetworkMessage::LAST, 0),
    00053       myDisplay(true), myDisplayZero(false)
    00054 {
    00055     if (getenv("CERTI_NO_STATISTICS"))
    00056     myDisplay = false ;
    00057
    00058     if (!initialized) {
    00059         FED_MSG_NAME(Message::CLOSE_CONNEXION);
    00060
    00061         // Federation
    00062     FED_MSG_NAME(Message::CREATE_FEDERATION_EXECUTION);
    00063     FED_MSG_NAME(Message::DESTROY_FEDERATION_EXECUTION);
    00064     FED_MSG_NAME(Message::JOIN_FEDERATION_EXECUTION);
    00065     FED_MSG_NAME(Message::RESIGN_FEDERATION_EXECUTION);
    00066     FED_MSG_NAME(Message::REGISTER_FEDERATION_SYNCHRONIZATION_POINT);
    00067     FED_MSG_NAME(Message::SYNCHRONIZATION_POINT_REGISTRATION_FAILED);
    00068     FED_MSG_NAME(Message::SYNCHRONIZATION_POINT_REGISTRATION_SUCCEEDED);
    00069     FED_MSG_NAME(Message::ANNOUNCE_SYNCHRONIZATION_POINT);
    00070     FED_MSG_NAME(Message::SYNCHRONIZATION_POINT_ACHIEVED);
    00071     FED_MSG_NAME(Message::FEDERATION_SYNCHRONIZED);
    00072     FED_MSG_NAME(Message::REQUEST_FEDERATION_SAVE);
    00073     FED_MSG_NAME(Message::INITIATE_FEDERATE_SAVE);
    00074     FED_MSG_NAME(Message::FEDERATE_SAVE_BEGUN);
    00075     FED_MSG_NAME(Message::FEDERATE_SAVE_COMPLETE);
    00076     FED_MSG_NAME(Message::FEDERATE_SAVE_NOT_COMPLETE);
    00077     FED_MSG_NAME(Message::FEDERATION_SAVED);
    00078     FED_MSG_NAME(Message::FEDERATION_NOT_SAVED);
    00079     FED_MSG_NAME(Message::REQUEST_FEDERATION_RESTORE);
    00080     FED_MSG_NAME(Message::REQUEST_FEDERATION_RESTORE_FAILED);
    00081     FED_MSG_NAME(Message::REQUEST_FEDERATION_RESTORE_SUCCEEDED);
    00082     FED_MSG_NAME(Message::INITIATE_FEDERATE_RESTORE);
    00083     FED_MSG_NAME(Message::FEDERATE_RESTORE_COMPLETE);
    00084     FED_MSG_NAME(Message::FEDERATE_RESTORE_NOT_COMPLETE);
    00085     FED_MSG_NAME(Message::FEDERATION_RESTORED);
    00086     FED_MSG_NAME(Message::FEDERATION_NOT_RESTORED);
    00087     FED_MSG_NAME(Message::FEDERATION_RESTORE_BEGUN);
    00088
    00089     // Declaration
    00090     FED_MSG_NAME(Message::PUBLISH_OBJECT_CLASS);
    00091     FED_MSG_NAME(Message::UNPUBLISH_OBJECT_CLASS);
    00092     FED_MSG_NAME(Message::PUBLISH_INTERACTION_CLASS);
    00093     FED_MSG_NAME(Message::UNPUBLISH_INTERACTION_CLASS);
    00094     FED_MSG_NAME(Message::SUBSCRIBE_OBJECT_CLASS_ATTRIBUTES);
    00095     FED_MSG_NAME(Message::UNSUBSCRIBE_OBJECT_CLASS);
    00096     FED_MSG_NAME(Message::SUBSCRIBE_INTERACTION_CLASS);
    00097     FED_MSG_NAME(Message::UNSUBSCRIBE_INTERACTION_CLASS);
    00098     FED_MSG_NAME(Message::START_REGISTRATION_FOR_OBJECT_CLASS);
    00099     FED_MSG_NAME(Message::STOP_REGISTRATION_FOR_OBJECT_CLASS);
    00100     FED_MSG_NAME(Message::TURN_INTERACTIONS_ON);
    00101     FED_MSG_NAME(Message::TURN_INTERACTIONS_OFF);
    00102
    00103     // Object
    00104     FED_MSG_NAME(Message::REGISTER_OBJECT_INSTANCE);
    00105     FED_MSG_NAME(Message::UPDATE_ATTRIBUTE_VALUES);
    00106     FED_MSG_NAME(Message::DISCOVER_OBJECT_INSTANCE);
    00107     FED_MSG_NAME(Message::REFLECT_ATTRIBUTE_VALUES);
    00108     FED_MSG_NAME(Message::SEND_INTERACTION);
    00109     FED_MSG_NAME(Message::RECEIVE_INTERACTION);
    00110     FED_MSG_NAME(Message::DELETE_OBJECT_INSTANCE);
    00111     FED_MSG_NAME(Message::LOCAL_DELETE_OBJECT_INSTANCE);
    00112     FED_MSG_NAME(Message::REMOVE_OBJECT_INSTANCE);
    00113     FED_MSG_NAME(Message::CHANGE_ATTRIBUTE_TRANSPORTATION_TYPE);
    00114     FED_MSG_NAME(Message::CHANGE_INTERACTION_TRANSPORTATION_TYPE);
    00115     FED_MSG_NAME(Message::REQUEST_OBJECT_ATTRIBUTE_VALUE_UPDATE);
    00116     FED_MSG_NAME(Message::REQUEST_CLASS_ATTRIBUTE_VALUE_UPDATE);
    00117     FED_MSG_NAME(Message::PROVIDE_ATTRIBUTE_VALUE_UPDATE);
    00118     FED_MSG_NAME(Message::ATTRIBUTES_IN_SCOPE);
    00119     FED_MSG_NAME(Message::ATTRIBUTES_OUT_OF_SCOPE);
    00120     FED_MSG_NAME(Message::TURN_UPDATES_ON_FOR_OBJECT_INSTANCE);
    00121     FED_MSG_NAME(Message::TURN_UPDATES_OFF_FOR_OBJECT_INSTANCE);
    00122
    00123     // Ownership
    00124     FED_MSG_NAME(Message::REQUEST_ATTRIBUTE_OWNERSHIP_DIVESTITURE);
    00125     FED_MSG_NAME(Message::REQUEST_ATTRIBUTE_OWNERSHIP_ASSUMPTION);
    00126     FED_MSG_NAME(Message::NEGOTIATED_ATTRIBUTE_OWNERSHIP_DIVESTITURE);
    00127     FED_MSG_NAME(Message::ATTRIBUTE_OWNERSHIP_DIVESTITURE_NOTIFICATION);
    00128     FED_MSG_NAME(Message::ATTRIBUTE_OWNERSHIP_ACQUISITION_NOTIFICATION);
    00129     FED_MSG_NAME(Message::REQUEST_ATTRIBUTE_OWNERSHIP_ACQUISITION);
    00130     FED_MSG_NAME(Message::REQUEST_ATTRIBUTE_OWNERSHIP_RELEASE);
    00131     FED_MSG_NAME(Message::QUERY_ATTRIBUTE_OWNERSHIP);
    00132     FED_MSG_NAME(Message::INFORM_ATTRIBUTE_OWNERSHIP);
    00133     FED_MSG_NAME(Message::IS_ATTRIBUTE_OWNED_BY_FEDERATE);
    00134     FED_MSG_NAME(Message::ATTRIBUTE_IS_NOT_OWNED);
    00135     FED_MSG_NAME(Message::ATTRIBUTE_OWNED_BY_RTI);
    00136     FED_MSG_NAME(Message::ATTRIBUTE_OWNERSHIP_ACQUISITION_IF_AVAILABLE);
    00137     FED_MSG_NAME(Message::ATTRIBUTE_OWNERSHIP_UNAVAILABLE);
    00138     FED_MSG_NAME(Message::UNCONDITIONAL_ATTRIBUTE_OWNERSHIP_DIVESTITURE);
    00139     FED_MSG_NAME(Message::ATTRIBUTE_OWNERSHIP_ACQUISITION);
    00140     FED_MSG_NAME(Message::CANCEL_NEGOTIATED_ATTRIBUTE_OWNERSHIP_DIVESTITURE);
    00141     FED_MSG_NAME(Message::ATTRIBUTE_OWNERSHIP_RELEASE_RESPONSE);
    00142     FED_MSG_NAME(Message::CANCEL_ATTRIBUTE_OWNERSHIP_ACQUISITION);
    00143     FED_MSG_NAME(Message::CONFIRM_ATTRIBUTE_OWNERSHIP_ACQUISITION_CANCELLATION);
    00144
    00145     // Time
    00146     FED_MSG_NAME(Message::CHANGE_ATTRIBUTE_ORDER_TYPE);
    00147     FED_MSG_NAME(Message::CHANGE_INTERACTION_ORDER_TYPE);
    00148     FED_MSG_NAME(Message::ENABLE_TIME_REGULATION);
    00149     FED_MSG_NAME(Message::DISABLE_TIME_REGULATION);
    00150     FED_MSG_NAME(Message::ENABLE_TIME_CONSTRAINED);
    00151     FED_MSG_NAME(Message::DISABLE_TIME_CONSTRAINED);
    00152     FED_MSG_NAME(Message::QUERY_LBTS);
    00153     FED_MSG_NAME(Message::QUERY_FEDERATE_TIME);
    00154     FED_MSG_NAME(Message::QUERY_MIN_NEXT_EVENT_TIME);
    00155     FED_MSG_NAME(Message::MODIFY_LOOKAHEAD);
    00156     FED_MSG_NAME(Message::QUERY_LOOKAHEAD);
    00157     FED_MSG_NAME(Message::RETRACT);
    00158     FED_MSG_NAME(Message::REQUEST_RETRACTION);
    00159     FED_MSG_NAME(Message::TIME_ADVANCE_REQUEST);
    00160     FED_MSG_NAME(Message::TIME_ADVANCE_REQUEST_AVAILABLE);
    00161     FED_MSG_NAME(Message::NEXT_EVENT_REQUEST);
    00162     FED_MSG_NAME(Message::NEXT_EVENT_REQUEST_AVAILABLE);
    00163     FED_MSG_NAME(Message::FLUSH_QUEUE_REQUEST);
    00164     FED_MSG_NAME(Message::TIME_ADVANCE_GRANT);
    00165     FED_MSG_NAME(Message::ENABLE_ASYNCHRONOUS_DELIVERY);
    00166     FED_MSG_NAME(Message::DISABLE_ASYNCHRONOUS_DELIVERY);
    00167     FED_MSG_NAME(Message::TIME_REGULATION_ENABLED);
    00168     FED_MSG_NAME(Message::TIME_CONSTRAINED_ENABLED);
    00169
    00170     // Data Distribution
    00171     FED_MSG_NAME(Message::DDM_CREATE_REGION);
    00172     FED_MSG_NAME(Message::DDM_MODIFY_REGION);
    00173     FED_MSG_NAME(Message::DDM_DELETE_REGION);
    00174     FED_MSG_NAME(Message::DDM_REGISTER_OBJECT);
    00175     FED_MSG_NAME(Message::DDM_ASSOCIATE_REGION);
    00176     FED_MSG_NAME(Message::DDM_UNASSOCIATE_REGION);
    00177     FED_MSG_NAME(Message::DDM_SUBSCRIBE_ATTRIBUTES);
    00178     FED_MSG_NAME(Message::DDM_UNSUBSCRIBE_ATTRIBUTES);
    00179     FED_MSG_NAME(Message::DDM_SUBSCRIBE_INTERACTION);
    00180     FED_MSG_NAME(Message::DDM_UNSUBSCRIBE_INTERACTION);
    00181     FED_MSG_NAME(Message::DDM_REQUEST_UPDATE);
    00182
    00183     // Support Services
    00184     FED_MSG_NAME(Message::GET_OBJECT_CLASS_HANDLE);
    00185     FED_MSG_NAME(Message::GET_OBJECT_CLASS_NAME);
    00186     FED_MSG_NAME(Message::GET_ATTRIBUTE_HANDLE);
    00187     FED_MSG_NAME(Message::GET_ATTRIBUTE_NAME);
    00188     FED_MSG_NAME(Message::GET_INTERACTION_CLASS_HANDLE);
    00189     FED_MSG_NAME(Message::GET_INTERACTION_CLASS_NAME);
    00190     FED_MSG_NAME(Message::GET_PARAMETER_HANDLE);
    00191     FED_MSG_NAME(Message::GET_PARAMETER_NAME);
    00192     FED_MSG_NAME(Message::GET_OBJECT_INSTANCE_HANDLE);
    00193     FED_MSG_NAME(Message::GET_OBJECT_INSTANCE_NAME);
    00194     FED_MSG_NAME(Message::GET_SPACE_HANDLE);
    00195     FED_MSG_NAME(Message::GET_SPACE_NAME);
    00196     FED_MSG_NAME(Message::GET_DIMENSION_HANDLE);
    00197     FED_MSG_NAME(Message::GET_DIMENSION_NAME);
    00198     FED_MSG_NAME(Message::GET_ATTRIBUTE_SPACE_HANDLE);
    00199     FED_MSG_NAME(Message::GET_OBJECT_CLASS);
    00200     FED_MSG_NAME(Message::GET_INTERACTION_SPACE_HANDLE);
    00201     FED_MSG_NAME(Message::GET_TRANSPORTATION_HANDLE);
    00202     FED_MSG_NAME(Message::GET_TRANSPORTATION_NAME);
    00203     FED_MSG_NAME(Message::GET_ORDERING_HANDLE);
    00204     FED_MSG_NAME(Message::GET_ORDERING_NAME);
    00205     FED_MSG_NAME(Message::ENABLE_CLASS_RELEVANCE_ADVISORY_SWITCH);
    00206     FED_MSG_NAME(Message::DISABLE_CLASS_RELEVANCE_ADVISORY_SWITCH);
    00207     FED_MSG_NAME(Message::ENABLE_ATTRIBUTE_RELEVANCE_ADVISORY_SWITCH);
    00208     FED_MSG_NAME(Message::DISABLE_ATTRIBUTE_RELEVANCE_ADVISORY_SWITCH);
    00209     FED_MSG_NAME(Message::ENABLE_ATTRIBUTE_SCOPE_ADVISORY_SWITCH);
    00210     FED_MSG_NAME(Message::DISABLE_ATTRIBUTE_SCOPE_ADVISORY_SWITCH);
    00211     FED_MSG_NAME(Message::ENABLE_INTERACTION_RELEVANCE_ADVISORY_SWITCH);
    00212     FED_MSG_NAME(Message::DISABLE_INTERACTION_RELEVANCE_ADVISORY_SWITCH);
    00213     FED_MSG_NAME(Message::TICK_REQUEST);
    00214     FED_MSG_NAME(Message::TICK_REQUEST_NEXT);
    00215     FED_MSG_NAME(Message::TICK_REQUEST_STOP);
    00216
    00217     // RTI messages
    00218     RTI_MSG_NAME(NetworkMessage::CLOSE_CONNEXION);
    00219     RTI_MSG_NAME(NetworkMessage::MESSAGE_NULL);
    00220     RTI_MSG_NAME(NetworkMessage::CREATE_FEDERATION_EXECUTION);
    00221     RTI_MSG_NAME(NetworkMessage::DESTROY_FEDERATION_EXECUTION);
    00222     RTI_MSG_NAME(NetworkMessage::JOIN_FEDERATION_EXECUTION);
    00223     RTI_MSG_NAME(NetworkMessage::RESIGN_FEDERATION_EXECUTION);
    00224     RTI_MSG_NAME(NetworkMessage::SET_TIME_REGULATING);
    00225     RTI_MSG_NAME(NetworkMessage::SET_TIME_CONSTRAINED);
    00226     RTI_MSG_NAME(NetworkMessage::TIME_REGULATION_ENABLED);
    00227     RTI_MSG_NAME(NetworkMessage::TIME_CONSTRAINED_ENABLED);
    00228     RTI_MSG_NAME(NetworkMessage::REGISTER_FEDERATION_SYNCHRONIZATION_POINT);
    00229     RTI_MSG_NAME(NetworkMessage::SYNCHRONIZATION_POINT_REGISTRATION_SUCCEEDED);
    00230     RTI_MSG_NAME(NetworkMessage::ANNOUNCE_SYNCHRONIZATION_POINT);
    00231     RTI_MSG_NAME(NetworkMessage::SYNCHRONIZATION_POINT_ACHIEVED);
    00232     RTI_MSG_NAME(NetworkMessage::FEDERATION_SYNCHRONIZED);
    00233     RTI_MSG_NAME(NetworkMessage::REQUEST_FEDERATION_SAVE);
    00234     RTI_MSG_NAME(NetworkMessage::FEDERATE_SAVE_BEGUN);
    00235     RTI_MSG_NAME(NetworkMessage::FEDERATE_SAVE_COMPLETE);
    00236     RTI_MSG_NAME(NetworkMessage::FEDERATE_SAVE_NOT_COMPLETE);
    00237     RTI_MSG_NAME(NetworkMessage::INITIATE_FEDERATE_SAVE);
    00238     RTI_MSG_NAME(NetworkMessage::FEDERATION_SAVED);
    00239     RTI_MSG_NAME(NetworkMessage::FEDERATION_NOT_SAVED);
    00240     RTI_MSG_NAME(NetworkMessage::REQUEST_FEDERATION_RESTORE);
    00241     RTI_MSG_NAME(NetworkMessage::FEDERATE_RESTORE_COMPLETE);
    00242     RTI_MSG_NAME(NetworkMessage::FEDERATE_RESTORE_NOT_COMPLETE);
    00243     RTI_MSG_NAME(NetworkMessage::REQUEST_FEDERATION_RESTORE_SUCCEEDED);
    00244     RTI_MSG_NAME(NetworkMessage::REQUEST_FEDERATION_RESTORE_FAILED);
    00245     RTI_MSG_NAME(NetworkMessage::FEDERATION_RESTORE_BEGUN);
    00246     RTI_MSG_NAME(NetworkMessage::INITIATE_FEDERATE_RESTORE);
    00247     RTI_MSG_NAME(NetworkMessage::FEDERATION_RESTORED);
    00248     RTI_MSG_NAME(NetworkMessage::FEDERATION_NOT_RESTORED);
    00249     RTI_MSG_NAME(NetworkMessage::PUBLISH_OBJECT_CLASS);
    00250     RTI_MSG_NAME(NetworkMessage::UNPUBLISH_OBJECT_CLASS);
    00251     RTI_MSG_NAME(NetworkMessage::PUBLISH_INTERACTION_CLASS);
    00252     RTI_MSG_NAME(NetworkMessage::UNPUBLISH_INTERACTION_CLASS);
    00253     RTI_MSG_NAME(NetworkMessage::SUBSCRIBE_OBJECT_CLASS);
    00254     RTI_MSG_NAME(NetworkMessage::UNSUBSCRIBE_OBJECT_CLASS);
    00255     RTI_MSG_NAME(NetworkMessage::SUBSCRIBE_INTERACTION_CLASS);
    00256     RTI_MSG_NAME(NetworkMessage::UNSUBSCRIBE_INTERACTION_CLASS);
    00257     RTI_MSG_NAME(NetworkMessage::TURN_INTERACTIONS_ON);
    00258     RTI_MSG_NAME(NetworkMessage::TURN_INTERACTIONS_OFF);
    00259     RTI_MSG_NAME(NetworkMessage::REGISTER_OBJECT);
    00260     RTI_MSG_NAME(NetworkMessage::DISCOVER_OBJECT);
    00261     RTI_MSG_NAME(NetworkMessage::UPDATE_ATTRIBUTE_VALUES);
    00262     RTI_MSG_NAME(NetworkMessage::REFLECT_ATTRIBUTE_VALUES);
    00263     RTI_MSG_NAME(NetworkMessage::SEND_INTERACTION);
    00264     RTI_MSG_NAME(NetworkMessage::RECEIVE_INTERACTION);
    00265     RTI_MSG_NAME(NetworkMessage::DELETE_OBJECT);
    00266     RTI_MSG_NAME(NetworkMessage::REMOVE_OBJECT);
    00267     RTI_MSG_NAME(NetworkMessage::CHANGE_ATTRIBUTE_TRANSPORT_TYPE);
    00268     RTI_MSG_NAME(NetworkMessage::CHANGE_ATTRIBUTE_ORDER_TYPE);
    00269     RTI_MSG_NAME(NetworkMessage::CHANGE_INTERACTION_TRANSPORT_TYPE);
    00270     RTI_MSG_NAME(NetworkMessage::CHANGE_INTERACTION_ORDER_TYPE);
    00271     RTI_MSG_NAME(NetworkMessage::REQUEST_CLASS_ATTRIBUTE_VALUE_UPDATE);
    00272     RTI_MSG_NAME(NetworkMessage::REQUEST_OBJECT_ATTRIBUTE_VALUE_UPDATE);
    00273     RTI_MSG_NAME(NetworkMessage::IS_ATTRIBUTE_OWNED_BY_FEDERATE);
    00274     RTI_MSG_NAME(NetworkMessage::QUERY_ATTRIBUTE_OWNERSHIP);
    00275     RTI_MSG_NAME(NetworkMessage::ATTRIBUTE_IS_NOT_OWNED);
    00276     RTI_MSG_NAME(NetworkMessage::INFORM_ATTRIBUTE_OWNERSHIP);
    00277     RTI_MSG_NAME(NetworkMessage::NEGOTIATED_ATTRIBUTE_OWNERSHIP_DIVESTITURE);
    00278     RTI_MSG_NAME(NetworkMessage::ATTRIBUTE_OWNERSHIP_ACQUISITION_NOTIFICATION);
    00279     RTI_MSG_NAME(NetworkMessage::ATTRIBUTE_OWNERSHIP_DIVESTITURE_NOTIFICATION);
    00280     RTI_MSG_NAME(NetworkMessage::REQUEST_ATTRIBUTE_OWNERSHIP_ASSUMPTION);
    00281     RTI_MSG_NAME(NetworkMessage::ATTRIBUTE_OWNERSHIP_UNAVAILABLE);
    00282     RTI_MSG_NAME(NetworkMessage::ATTRIBUTE_OWNERSHIP_ACQUISITION_IF_AVAILABLE);
    00283     RTI_MSG_NAME(NetworkMessage::UNCONDITIONAL_ATTRIBUTE_OWNERSHIP_DIVESTITURE);
    00284     RTI_MSG_NAME(NetworkMessage::ATTRIBUTE_OWNERSHIP_ACQUISITION);
    00285     RTI_MSG_NAME(NetworkMessage::REQUEST_ATTRIBUTE_OWNERSHIP_RELEASE);
    00286     RTI_MSG_NAME(NetworkMessage::CANCEL_NEGOTIATED_ATTRIBUTE_OWNERSHIP_DIVESTITURE);
    00287     RTI_MSG_NAME(NetworkMessage::ATTRIBUTE_OWNERSHIP_RELEASE_RESPONSE);
    00288     RTI_MSG_NAME(NetworkMessage::CANCEL_ATTRIBUTE_OWNERSHIP_ACQUISITION);
    00289     RTI_MSG_NAME(NetworkMessage::CONFIRM_ATTRIBUTE_OWNERSHIP_ACQUISITION_CANCELLATION);
    00290     RTI_MSG_NAME(NetworkMessage::DDM_CREATE_REGION);
    00291     RTI_MSG_NAME(NetworkMessage::DDM_MODIFY_REGION);
    00292     RTI_MSG_NAME(NetworkMessage::DDM_DELETE_REGION);
    00293     RTI_MSG_NAME(NetworkMessage::DDM_ASSOCIATE_REGION);
    00294     RTI_MSG_NAME(NetworkMessage::DDM_UNASSOCIATE_REGION);
    00295     RTI_MSG_NAME(NetworkMessage::DDM_SUBSCRIBE_ATTRIBUTES);
    00296     RTI_MSG_NAME(NetworkMessage::DDM_UNSUBSCRIBE_ATTRIBUTES);
    00297     RTI_MSG_NAME(NetworkMessage::DDM_SUBSCRIBE_INTERACTION);
    00298     RTI_MSG_NAME(NetworkMessage::DDM_UNSUBSCRIBE_INTERACTION);
    00299         RTI_MSG_NAME(NetworkMessage::PROVIDE_ATTRIBUTE_VALUE_UPDATE);
    00300         RTI_MSG_NAME(NetworkMessage::GET_FED_FILE);
    00301     RTI_MSG_NAME(NetworkMessage::SET_CLASS_RELEVANCE_ADVISORY_SWITCH);
    00302     RTI_MSG_NAME(NetworkMessage::SET_INTERACTION_RELEVANCE_ADVISORY_SWITCH);
    00303     RTI_MSG_NAME(NetworkMessage::SET_ATTRIBUTE_RELEVANCE_ADVISORY_SWITCH);
    00304     RTI_MSG_NAME(NetworkMessage::SET_ATTRIBUTE_SCOPE_ADVISORY_SWITCH);
    00305     RTI_MSG_NAME(NetworkMessage::START_REGISTRATION_FOR_OBJECT_CLASS);
    00306     RTI_MSG_NAME(NetworkMessage::STOP_REGISTRATION_FOR_OBJECT_CLASS);
    00307
    00308         initialized = true ;
    00309     }
    00310 }
    00311
    00312 // ----------------------------------------------------------------------------
    00314 void
    00315 Statistics::rtiService(NetworkMessage::Type service)
    00316 {
    00317     rtiServiceSet[service]++ ;
    00318 }
    00319
    00320 // ----------------------------------------------------------------------------
    00322 void
    00323 Statistics::federateService(Message::Type service)
    00324 {
    00325     federateServiceSet[service]++ ;
    00326 }
    00327
    00328 // ----------------------------------------------------------------------------
    00330 ostream &
    00331 operator<<(ostream &s, Statistics &stat)
    00332 {
    00333     cout << endl << "RTIA: Statistics (processed messages)" << endl ;
    00334
    00335     s << "List of federate initiated services " << endl
    00336       << "--------------------------------------------------" << endl ;
    00337
    00338     int sentFederateMessages = 0 ;
    00339
    00340     for (int i = Message::NOT_USED ; i < Message::LAST ; ++i) {
    00341     int nb = stat.federateServiceSet[i] ;
    00342     if (nb > 0 || stat.displayZero()) {
    00343         s.width(8);
    00344         s << nb << ' ' << Statistics::fedMessageName[i].c_str() << " (MSG#"
    00345           << i << ")" << endl ;
    00346         }
    00347         sentFederateMessages += nb ;
    00348     }
    00349
    00350     s << endl << "List of RTI initiated services " << endl
    00351       << "--------------------------------------------------" << endl ;
    00352
    00353     int sentRtiMessages = 0 ;
    00354
    00355     for (int i = NetworkMessage::NOT_USED ; i < NetworkMessage::LAST ; ++i) {
    00356         int nb = stat.rtiServiceSet[i] ;
    00357         if (nb > 0 || stat.displayZero()) {
    00358             s.width(8);
    00359             s << nb << ' ' << Statistics::rtiMessageName[i].c_str() << " (MSG#"
    00360           << i << ")" << endl ;
    00361         }
    00362         sentRtiMessages += nb ;
    00363     }
    00364
    00365     s << endl
    00366       << " Number of Federate messages : " << sentFederateMessages << endl
    00367       << " Number of RTIG messages : " << sentRtiMessages << endl ;
    00368
    00369     return s ;
    00370 }
    00371
    00372 }} // namespace certi::rtia
    00373
    00374 #undef FED_MSG_NAME
    00375 #undef RTI_MSG_NAME
    00376
    00377 // $Id: Statistics.cc,v 3.19 2009/04/08 10:47:18 approx Exp $