![]() |
MAK RTIspy API Documentation for HLA 1516
|
00001 /********************************************************************* 00002 ** Copyright (c) 2006 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: lrcEventLog.h,v $ $Revision: 1.6 $ $State: Exp $ 00007 *******************************************************************************/ 00010 00011 #ifndef DtLrcEventLog_H_ 00012 #define DtLrcEventLog_H_ 00013 00014 #include <rtiMsConfig.h> 00015 #include "webSpyUtils.h" 00016 00017 #include "lrcConsoleLogXmlBlock.h" 00018 #include <mtl/env.h> 00019 #include <vlutil/vlTime.h> 00020 #include <vlutil/vlString.h> 00021 #include <vlutil/vlSmartPointers.h> 00022 #include <vector> 00023 #include <list> 00024 #include <map> 00025 00028 class DtLrcEventLog; 00029 typedef DtBoost::shared_ptr<DtLrcEventLog> DtLrcEventLogSP; 00030 typedef DtBoost::weak_ptr<DtLrcEventLog> DtLrcEventLogWP; 00031 00032 00036 class DT_DLL_WWW DtLrcEventLog 00037 { 00038 public: 00039 00041 DtLrcEventLog(); 00042 virtual ~DtLrcEventLog(); 00043 00046 virtual void pushLogEvent( unsigned long componentId, DtTime time, bool isRtiAmbCall, 00047 bool isException, const DtString& description ); 00048 00049 00051 virtual void appendLogSegment( unsigned long componentId, DtLrcConsoleLogXmlBlockSP logSegmentSP ); 00052 00053 00061 virtual DtLrcConsoleLogXmlBlockSP getLogSegment( DtEnvValueSP parentNode, unsigned long componentId, 00062 unsigned int startIndex, unsigned int stopIndex ); 00063 00064 00067 virtual DtTime timeOfLastUpdate( unsigned long componentId ) const; 00068 00069 00070 protected: 00071 00072 struct LogEvent 00073 { 00074 LogEvent() : 00075 myCacheUpToDate( false), 00076 myTime( 0.0f ), 00077 myIsRtiAmbCall( false ), 00078 myIsException( false ), 00079 myDescription("Log Out of Date") {} 00080 00081 LogEvent( DtTime time, bool isRtiAmbCall, bool isException, const DtString& description ) : 00082 myCacheUpToDate( true ), 00083 myTime( time ), 00084 myIsRtiAmbCall( isRtiAmbCall ), 00085 myIsException( isException ), 00086 myDescription( description ) {} 00087 00088 LogEvent& operator=( const LogEvent& orig ); 00089 00090 bool myCacheUpToDate; 00091 DtTime myTime; 00092 bool myIsRtiAmbCall; 00093 bool myIsException; 00094 DtString myDescription; 00095 }; 00096 00097 typedef std::vector< LogEvent > LogEventsList; 00098 typedef std::map< unsigned long, LogEventsList > LogsByComponentIdMap; 00099 typedef std::map< unsigned long, DtTime > UpdateAgeByComponentIdMap; 00100 00101 protected: 00102 00103 DtClock myClock; 00104 LogsByComponentIdMap myEvents; 00105 UpdateAgeByComponentIdMap myTimesOfLastUpdates; 00106 }; 00107 00108 00109 #endif //! DtLrcEventLog_H_ 00110 00111