![]() |
MAK RTIspy API Documentation for HLA 1.3
|
00001 /********************************************************************* 00002 ** Copyright (c) 2006 MaK Technologies, Inc. 00003 ** All rights reserved. 00004 *********************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: lrcStateXmlBlock.h,v $ $Revision: 1.8 $ $State: Exp $ 00007 *******************************************************************************/ 00008 #ifndef DtLrcStateXmlBlock_H_ 00009 #define DtLrcStateXmlBlock_H_ 00010 00011 #include <rtiMsConfig.h> 00012 #include "lrcStateDbXmlBlock.h" 00013 #include <mtl/env.h> 00014 #include <spyXmlBlock.h> 00015 #include <vlutil/vlString.h> 00016 #include <vlutil/vlSmartPointers.h> 00017 00018 // Declare the XML tags used by this block 00019 DtDECLARE_SPY_XML_TAG( DtLrcStateXmlTag ); 00020 DtDECLARE_SPY_XML_TAG( DtLrcStateFederateNameXmlTag ); 00021 DtDECLARE_SPY_XML_TAG( DtLrcStateFederateHandleXmlTag ); 00022 DtDECLARE_SPY_XML_TAG( DtLrcStateFederationHandleXmlTag ); 00023 00024 class DtLrcStateXmlBlock; 00025 typedef DtBoost::shared_ptr<DtLrcStateXmlBlock> DtLrcStateXmlBlockSP; 00026 typedef DtBoost::weak_ptr<DtLrcStateXmlBlock> DtLrcStateXmlBlockWP; 00027 00028 // The DtLrcStateXmlBlock represents the current state of a joined federate 00029 // as seen by the LRC 00030 class DT_DLL_WWW DtLrcStateXmlBlock : public DtSpyXmlBlock 00031 { 00032 public: 00033 00034 static DtSpyXmlBlockSP create( DtNodeAndParentPair xmlNodeAndParent ); 00035 00036 public: 00037 DtLrcStateXmlBlock( DtEnvValueSP existingNode, DtEnvValueSP root ); 00038 DtLrcStateXmlBlock( const DtString& name, unsigned long federationHandle, 00039 unsigned long federateHandle, DtEnvValueSP root ); 00040 virtual ~DtLrcStateXmlBlock(); 00041 00042 // Get the Traffic stats XML 00043 inline DtLrcStateDatabaseXmlBlockSP stats() const; 00044 00045 // Set Federate Name 00046 inline void setFederateName( const DtString& name ); 00047 00048 // Set/Get Federation Handle(); 00049 inline void setFederationHandle( unsigned long handle ); 00050 inline unsigned long federationHandle() const; 00051 00052 // Set/Get Federate Handle(); 00053 inline void setFederateHandle( unsigned long handle ); 00054 inline unsigned long federateHandle() const; 00055 00056 protected: 00057 00058 DtLrcStateDatabaseXmlBlockSP myStats; 00059 00060 DtSpyXmlBlockElement< DtString, false > myFederateName; 00061 DtSpyXmlBlockElement< unsigned long, false > myFederationHandle; 00062 DtSpyXmlBlockElement< unsigned long, false > myFederateHandle; 00063 }; 00064 00065 DtLrcStateDatabaseXmlBlockSP DtLrcStateXmlBlock::stats() const { return myStats; } 00066 void DtLrcStateXmlBlock::setFederateName( const DtString& name ) { myFederateName = name; } 00067 void DtLrcStateXmlBlock::setFederationHandle( unsigned long handle ) { myFederationHandle = handle; } 00068 unsigned long DtLrcStateXmlBlock::federationHandle() const { return myFederationHandle; } 00069 void DtLrcStateXmlBlock::setFederateHandle( unsigned long handle ) { myFederateHandle = handle; } 00070 unsigned long DtLrcStateXmlBlock::federateHandle() const { return myFederateHandle; } 00071 00072 #endif // DtLrcStateXmlBlock_H_ 00073