MAK RTIspy API Documentation for HLA 1.3
syncPointXmlBlock.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  ** Copyright (c) 2006 MaK Technologies, Inc.
00003  ** All rights reserved.
00004  *********************************************************************/
00005 /*******************************************************************************
00006  ** $RCSfile: syncPointXmlBlock.h,v $ $Revision: 1.6 $ $State: Exp $
00007  *******************************************************************************/
00008 #ifndef DtSyncPointXmlBlock_H_
00009 #define DtSyncPointXmlBlock_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( DtSyncPointXmlTag );
00025 DtDECLARE_SPY_XML_TAG( DtSyncPointFederateXmlTag );
00026 DtDECLARE_SPY_XML_TAG( DtSyncPointFederateStatusXmlTag );
00027 DtDECLARE_SPY_XML_TAG( DtSyncPointFederateHandleXmlTag );
00028 
00029 class DtSyncPointXmlBlock;
00030 class DtSyncPointFederateXmlBlock;
00031 
00032 typedef DtBoost::shared_ptr<DtSyncPointXmlBlock> DtSyncPointXmlBlockSP;
00033 typedef DtBoost::weak_ptr<DtSyncPointXmlBlock>   DtSyncPointXmlBlockWP;
00034 typedef DtBoost::shared_ptr<DtSyncPointFederateXmlBlock> DtSyncPointFederateXmlBlockSP;
00035 typedef DtBoost::weak_ptr<DtSyncPointFederateXmlBlock>   DtSyncPointFederateXmlBlockWP;
00036 
00037 
00038 // The DtSyncPointFederateXmlBlock holds the status of a single federate participating
00039 // in a sync point federate set
00040 class DT_DLL_WWW DtSyncPointFederateXmlBlock : public DtSpyXmlBlock
00041 {
00042 public:
00043    
00044    static DtSpyXmlBlockSP create( DtNodeAndParentPair xmlNodeAndParent );
00045 
00046 public:
00047    DtSyncPointFederateXmlBlock( DtEnvValueSP existingNode, DtEnvValueSP root );
00048    DtSyncPointFederateXmlBlock( unsigned long handle, const DtString& status, DtEnvValueSP root );
00049    virtual ~DtSyncPointFederateXmlBlock();
00050    
00051    // Get the federate handle
00052    inline unsigned long handle() const;
00053 
00054    // Set/Get current status w.r.t. sync point
00055    virtual void setStatus( const DtString& status );
00056    inline DtString status() const;
00057 
00058 protected:
00059 
00060    DtSpyXmlBlockElement< unsigned long, true > myHandle;
00061    DtSpyXmlBlockElement< DtString, true > myStatus;
00062 };
00063 
00064 
00065 // The DtSyncPointXmlBlock holds a complete list of known objects and ownership states
00066 class DT_DLL_WWW DtSyncPointXmlBlock : public DtSpyXmlBlock
00067 {
00068 public:
00069    typedef std::set< DtSyncPointFederateXmlBlockSP > SyncPointFederateXmlBlockSet;
00070 
00071    static DtSpyXmlBlockSP create( DtNodeAndParentPair xmlNodeAndParent );
00072 
00073 public:
00074    DtSyncPointXmlBlock( DtEnvValueSP existingNode, DtEnvValueSP root );
00075    DtSyncPointXmlBlock( const DtString& name, DtEnvValueSP root );
00076    virtual ~DtSyncPointXmlBlock();
00077 
00078    // Add and Remove federates from the sync. set
00079    virtual DtSyncPointFederateXmlBlockSP addFederate( unsigned long handle, const DtString& status );
00080    virtual DtSyncPointFederateXmlBlockSP removeFederate( unsigned long handle );
00081    virtual void removeFederate( DtSyncPointFederateXmlBlockSP federateSP );
00082 
00083    // List the participating federate set
00084    virtual SyncPointFederateXmlBlockSet federates();
00085 
00086    // Set the status of a federate with respect to the point
00087    virtual void setFederateStatus( unsigned long handle, const DtString& status );
00088 };
00089 
00090 unsigned long DtSyncPointFederateXmlBlock::handle() const { return myHandle; }
00091 DtString DtSyncPointFederateXmlBlock::status() const { return myStatus; }
00092 
00093 #endif // DtSyncPointXmlBlock_H_
00094 

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)