MAK RTIspy API Documentation for HLA 1516
ridParamsXmlBlock.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  ** Copyright (c) 2006 MaK Technologies, Inc.
00003  ** All rights reserved.
00004  *********************************************************************/
00005 /*******************************************************************************
00006  ** $RCSfile: ridParamsXmlBlock.h,v $ $Revision: 1.9 $ $State: Exp $
00007  *******************************************************************************/
00008 #ifndef DtRidParamsXmlBlock_H_
00009 #define DtRidParamsXmlBlock_H_
00010 
00011 #include <rtiMsConfig.h>
00012 #include "spyXmlBlock.h"
00013 #include <mtl/env.h>
00014 #include <vlutil/vlString.h>
00015 #include <vlutil/vlSmartPointers.h>
00016 
00017 class DtRIDParameters;
00018 
00019 // Declare the XML tags used by this block
00020 DtDECLARE_SPY_XML_TAG( DtRidParamsXmlTag );
00021 DtDECLARE_SPY_XML_TAG( DtRidParameterXmlTag );
00022 DtDECLARE_SPY_XML_TAG( DtRidParameterValueXmlTag );
00023 DtDECLARE_SPY_XML_TAG( DtRidParameterEditableXmlTag );
00024 DtDECLARE_SPY_XML_TAG( DtRidParameterTypeXmlTag );
00025 DtDECLARE_SPY_XML_TAG( DtRidParameterRangeXmlTag );
00026 
00027 class DtRidParamsXmlBlock;
00028 class DtRidParameterXmlBlock;
00029 typedef DtBoost::shared_ptr<DtRidParamsXmlBlock> DtRidParamsXmlBlockSP;
00030 typedef DtBoost::weak_ptr<DtRidParamsXmlBlock>   DtRidParamsXmlBlockWP;
00031 typedef DtBoost::shared_ptr<DtRidParameterXmlBlock>     DtRidParameterXmlBlockSP;
00032 typedef DtBoost::weak_ptr<DtRidParameterXmlBlock>       DtRidParameterXmlBlockWP;
00033 
00034 
00035 // Sub-block of DtRidParamsXmlBlock representing a single parameter/value pair
00036 class DT_DLL_WWW DtRidParameterXmlBlock : public DtSpyXmlBlock
00037 {
00038 public:
00039    static DtSpyXmlBlockSP create( DtNodeAndParentPair xmlNodeAndParent );
00040 
00041 public:
00042    DtRidParameterXmlBlock( DtEnvValueSP existingNode, DtEnvValueSP root );
00043    DtRidParameterXmlBlock( const DtString& name, const DtString& value, 
00044       const DtString& type, bool editable, const DtString& range, DtEnvValueSP root );
00045    virtual ~DtRidParameterXmlBlock();
00046 
00047    virtual void setValue( const DtString& value );
00048    virtual DtString value() const;
00049 
00050    virtual void setEditable( bool editable);
00051    virtual bool editable() const;
00052 
00053    virtual void setType( const DtString& type );
00054    virtual DtString type() const;
00055 
00056    virtual void setRange( const DtString& range );
00057    virtual DtString range() const;
00058    
00059 protected:
00060 
00061    DtSpyXmlBlockElement< DtString, true > myValue;   
00062    DtSpyXmlBlockElement< DtString, true > myType;   
00063    DtSpyXmlBlockElement< bool, true > myEditable;  
00064    DtSpyXmlBlockElement< DtString, true > myRange;   
00065 
00066 };
00067 
00068 // The DtRidParamsXmlBlock represents the current state of a joined federate
00069 // as seen by the RTI Exec.
00070 class DT_DLL_WWW DtRidParamsXmlBlock : public DtSpyXmlBlock
00071 {
00072 public:
00073    static DtSpyXmlBlockSP create( DtNodeAndParentPair xmlNodeAndParent );
00074 
00075 public:
00076    DtRidParamsXmlBlock( DtEnvValueSP existingNode, DtEnvValueSP root );
00077    DtRidParamsXmlBlock( const DtRIDParameters& params, DtEnvValueSP root );
00078    virtual ~DtRidParamsXmlBlock();
00079 
00080    // Write params from a RID file to an existing RID block
00081    // - will simply append if any params already exist
00082    virtual void addParams( const DtRIDParameters& params );
00083 
00084    // Return a pointer to a parameter in the RID
00085    virtual DtRidParameterXmlBlockSP getParam( const DtString& name );
00086 
00087 protected:
00088 
00089    // Build the XML params from a RID object (non-virtual since it is used by ctor)
00090    void convertRidParams( const DtRIDParameters& params );
00091 };
00092 
00093 
00094 
00095 
00096 
00097 #endif // DtRidParamsXmlBlock_H_
00098 

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)