MAK RTIspy API Documentation for HLA 1516
federateStateContainerXmlBlock.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  ** Copyright (c) 2006 MaK Technologies, Inc.
00003  ** All rights reserved.
00004  *********************************************************************/
00005 /*******************************************************************************
00006  ** $RCSfile: federateStateContainerXmlBlock.h,v $ $Revision: 1.6 $ $State: Exp $
00007  *******************************************************************************/
00008 #ifndef DtFederateStateContainerXmlBlock_H_
00009 #define DtFederateStateContainerXmlBlock_H_
00010 
00011 #include <rtiMsConfig.h>
00012 #include "spyXmlBlock.h"
00013 #include "spyXmlBlockElements.h"
00014 #include "federateStateXmlBlock.h"
00015 #include <mtl/env.h>
00016 #include <vlutil/vlString.h>
00017 #include <vlutil/vlSmartPointers.h>
00018 
00019 
00020 // Declare the XML tags used by this block
00021 DtDECLARE_SPY_XML_TAG( DtFederateStateContainerXmlTag );
00022 DtDECLARE_SPY_XML_TAG( DtFederateStateContainerFederationNameXmlTag );
00023 DtDECLARE_SPY_XML_TAG( DtFederateStateContainerFederationHandleXmlTag );
00024 DtDECLARE_SPY_XML_TAG( DtFederateStateContainerFedFileNameXmlTag );
00025 DtDECLARE_SPY_XML_TAG( DtFederateStateContainerRidFileNameXmlTag );
00026 DtDECLARE_SPY_XML_TAG( DtFederateStateContainerRtiVersionXmlTag );
00027 
00028 class DtFederateStateContainerXmlBlock;
00029 typedef DtBoost::shared_ptr<DtFederateStateContainerXmlBlock> DtFederateStateContainerXmlBlockSP;
00030 typedef DtBoost::weak_ptr<DtFederateStateContainerXmlBlock>   DtFederateStateContainerXmlBlockWP;
00031 
00032 
00033 // The DtFederateStateContainerXmlBlock holds the current state info for a single federation
00034 class DT_DLL_WWW DtFederateStateContainerXmlBlock : public DtSpyXmlBlock
00035 {
00036 public:
00037    
00038    static DtSpyXmlBlockSP create( DtNodeAndParentPair xmlNodeAndParent );
00039 
00040 public:
00041    DtFederateStateContainerXmlBlock( DtEnvValueSP existingNode, DtEnvValueSP root );
00042    DtFederateStateContainerXmlBlock( DtEnvValueSP root );
00043    virtual ~DtFederateStateContainerXmlBlock();   
00044    
00045    // Set/Get the contained Federate State XML block
00046    // Set adds federateSP as a child of the container block
00047    void setFederate( DtFederateStateXmlBlockSP federateSP );
00048    DtFederateStateXmlBlockSP federate();
00049 
00050    // Set and get federation name and handle
00051    // (these may not be available initially)
00052    inline void setFederationName( const DtString& name );
00053    inline DtString federationName() const;
00054    inline void setFederationHandle( unsigned long handle );
00055    inline unsigned long federationHandle() const;
00056    
00057    // Set and get fed and rid file names
00058    // (these may not be available initially)
00059    inline void setFedFileName( const DtString& name );
00060    inline DtString fedFileName() const;
00061    inline void setRidFileName( const DtString& name );
00062    inline DtString ridFileName() const;
00063    
00064 
00065    // Get the RTI Version string
00066    inline DtString rtiVersion() const;
00067 
00068 protected:
00069 
00070    DtFederateStateXmlBlockSP myFederateState;
00071 
00072    DtSpyXmlBlockElement< DtString, true > myFederationName;
00073    DtSpyXmlBlockElement< unsigned long, true >  myFederationHandle;    
00074    DtSpyXmlBlockElement< DtString, true > myFedFile;
00075    DtSpyXmlBlockElement< DtString, true > myRidFile;
00076    DtSpyXmlBlockElement< DtString, true > myRtiVersion;
00077 };
00078 
00079 void DtFederateStateContainerXmlBlock::setFederationName( const DtString& name ) { myFederationName = name; }
00080 DtString DtFederateStateContainerXmlBlock::federationName() const { return myFederationName; }
00081 void DtFederateStateContainerXmlBlock::setFederationHandle( unsigned long handle ) { myFederationHandle = handle; }
00082 unsigned long DtFederateStateContainerXmlBlock::federationHandle() const { return myFederationHandle; }
00083 
00084 void DtFederateStateContainerXmlBlock::setFedFileName( const DtString& name ) { myFedFile = name; }
00085 DtString DtFederateStateContainerXmlBlock::fedFileName() const { return myFedFile; }
00086 void DtFederateStateContainerXmlBlock::setRidFileName( const DtString& name ) { myRidFile = name; }
00087 DtString DtFederateStateContainerXmlBlock::ridFileName() const { return myRidFile; }
00088 DtString DtFederateStateContainerXmlBlock::rtiVersion() const { return myRtiVersion; }
00089 
00090 
00091 #endif // DtFederateStateContainerXmlBlock_H_
00092 
00093 

Document ID: Generated on Thu Jun 14 14:15:04 EDT 2012 from SVN revision 116116
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)