![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 /********************************************************************* 00002 ** Copyright (c) 2006 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: interSendRecvXmlBlock.h,v $ $Revision: 1.6 $ $State: Exp $ 00007 *******************************************************************************/ 00008 #ifndef DtInteractionSendRecvXmlBlock_H_ 00009 #define DtInteractionSendRecvXmlBlock_H_ 00010 00011 #include <rtiMsConfig.h> 00012 #include "spyXmlBlock.h" 00013 #include <mtl/env.h> 00014 #include "webSpyUtils.h" 00015 00016 #include <vlutil/vlString.h> 00017 #include <vlutil/vlFilename.h> 00018 #include <vlutil/vlSmartPointers.h> 00019 00020 #include <iosfwd> 00021 #include <map> 00022 00023 // Define the XML tags used by this block 00024 DtDECLARE_SPY_XML_TAG( DtInteractionSendRecvXmlTag ); 00025 DtDECLARE_SPY_XML_TAG( DtInteractionSendRecvClassXmlTag ); 00026 DtDECLARE_SPY_XML_TAG( DtInteractionSendRecvHandleXmlTag ); 00027 DtDECLARE_SPY_XML_TAG( DtInteractionSendRecvSendCountXmlTag ); 00028 DtDECLARE_SPY_XML_TAG( DtInteractionSendRecvReceiveCountXmlTag ); 00029 00030 class DtInteractionSendRecvXmlBlock; 00031 class DtInteractionSendRecvClassXmlBlock; 00032 typedef DtBoost::shared_ptr<DtInteractionSendRecvXmlBlock> DtInteractionSendRecvXmlBlockSP; 00033 typedef DtBoost::weak_ptr<DtInteractionSendRecvXmlBlock> DtInteractionSendRecvXmlBlockWP; 00034 typedef DtBoost::shared_ptr<DtInteractionSendRecvClassXmlBlock> DtInteractionSendRecvClassXmlBlockSP; 00035 typedef DtBoost::weak_ptr<DtInteractionSendRecvClassXmlBlock> DtInteractionSendRecvClassXmlBlockWP; 00036 00037 00038 // The DtInteractionSendRecvClassXmlBlock holds a single name/value pair for a WWW request message 00039 // Helper class to DtInteractionSendRecvXmlBlock. 00040 class DT_DLL_WWW DtInteractionSendRecvClassXmlBlock : public DtSpyXmlBlock 00041 { 00042 public: 00043 00044 static DtSpyXmlBlockSP create( DtNodeAndParentPair xmlNodeAndParent ); 00045 00046 public: 00047 DtInteractionSendRecvClassXmlBlock( DtEnvValueSP existingNode, DtEnvValueSP root ); 00048 DtInteractionSendRecvClassXmlBlock( unsigned long handle, DtEnvValueSP root ); 00049 virtual ~DtInteractionSendRecvClassXmlBlock(); 00050 00051 virtual void interactionSent(); 00052 virtual void interactionReceived(); 00053 00054 inline unsigned long handle() const; 00055 inline unsigned long sent() const; 00056 inline unsigned long received() const; 00057 00058 protected: 00059 00060 DtSpyXmlBlockElement< unsigned long, true > myHandle; 00061 DtSpyXmlBlockElement< unsigned long, true > mySentCount; 00062 DtSpyXmlBlockElement< unsigned long, true > myReceivedCount; 00063 }; 00064 00065 00066 // The DtInteractionSendRecvXmlBlock holds a complete WWW request message 00067 class DT_DLL_WWW DtInteractionSendRecvXmlBlock : public DtSpyXmlBlock 00068 { 00069 public: 00070 typedef std::map< unsigned long, DtInteractionSendRecvClassXmlBlockSP > InteractionSendRecvClassXmlBlocksByHandle; 00071 00072 static DtSpyXmlBlockSP create( DtNodeAndParentPair xmlNodeAndParent ); 00073 00074 public: 00075 DtInteractionSendRecvXmlBlock( DtEnvValueSP existingNode, DtEnvValueSP root ); 00076 DtInteractionSendRecvXmlBlock( DtEnvValueSP root ); 00077 virtual ~DtInteractionSendRecvXmlBlock(); 00078 00079 // Increment the Send and Receive count for interactions 00080 virtual DtInteractionSendRecvClassXmlBlockSP interactionSent( unsigned long handle ); 00081 virtual DtInteractionSendRecvClassXmlBlockSP interactionReceived( unsigned long handle ); 00082 00083 // List the request parameters 00084 inline const InteractionSendRecvClassXmlBlocksByHandle& interactions() const; 00085 00086 protected: 00087 00088 // Cache for fast lookups 00089 InteractionSendRecvClassXmlBlocksByHandle myInteractions; 00090 }; 00091 00092 unsigned long DtInteractionSendRecvClassXmlBlock::handle() const { return myHandle; } 00093 unsigned long DtInteractionSendRecvClassXmlBlock::sent() const { return mySentCount; } 00094 unsigned long DtInteractionSendRecvClassXmlBlock::received() const { return myReceivedCount; } 00095 const DtInteractionSendRecvXmlBlock::InteractionSendRecvClassXmlBlocksByHandle& DtInteractionSendRecvXmlBlock::interactions() const { return myInteractions; } 00096 00097 #endif // DtInteractionSendRecvXmlBlock_H_ 00098