MAK RTIspy API Documentation for HLA Evolved
fomInteractionXmlBlock.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  ** Copyright (c) 2006 MaK Technologies, Inc.
00003  ** All rights reserved.
00004  *********************************************************************/
00005 /*******************************************************************************
00006  ** $RCSfile: fomInteractionXmlBlock.h,v $ $Revision: 1.7 $ $State: Exp $
00007  *******************************************************************************/
00008 #ifndef DtFomInteractionXmlBlock_H_
00009 #define DtFomInteractionXmlBlock_H_
00010 
00011 #include <rtiMsConfig.h>
00012 #include "spyXmlBlock.h"
00013 #include <mtl/env.h>
00014 #include "webSpyUtils.h"
00015 
00016 #include <vlutil/vlFedTarget.h>
00017 #include <vlutil/vlString.h>
00018 #include <vlutil/vlFilename.h>
00019 #include <vlutil/vlSmartPointers.h>
00020 
00021 #include <iosfwd>
00022 #include <map>
00023 
00024 // Define the XML tags used by this block
00025 DtDECLARE_SPY_XML_TAG( DtFomInteractionXmlTag );
00026 DtDECLARE_SPY_XML_TAG( DtFomParameterXmlTag );
00027 DtDECLARE_SPY_XML_TAG( DtInterTransportXmlTag );
00028 DtDECLARE_SPY_XML_TAG( DtInterOrderXmlTag );
00029 DtDECLARE_SPY_XML_TAG( DtInterHandleXmlTag );
00030 DtDECLARE_SPY_XML_TAG( DtParamHandleXmlTag );
00031 
00032 
00033 class DtFomInteractionXmlBlock;
00034 class DtFomParameterXmlBlock;
00035 typedef DtBoost::shared_ptr<DtFomInteractionXmlBlock> DtFomInteractionXmlBlockSP;
00036 typedef DtBoost::weak_ptr<DtFomInteractionXmlBlock>   DtFomInteractionXmlBlockWP;
00037 typedef DtBoost::shared_ptr<DtFomParameterXmlBlock> DtFomParameterXmlBlockSP;
00038 typedef DtBoost::weak_ptr<DtFomParameterXmlBlock>   DtFomParameterXmlBlockWP;
00039 
00040 
00041 // The DtFomParameterXmlBlock holds a single FOM interaction class parameter
00042 // Helper class to DtFomInteractionXmlBlock.
00043 class DT_DLL_WWW DtFomParameterXmlBlock : public DtSpyXmlBlock
00044 {
00045 public:
00046    
00047    static DtSpyXmlBlockSP create( DtNodeAndParentPair xmlNodeAndParent );
00048 
00049 public:
00050    DtFomParameterXmlBlock( DtEnvValueSP existingNode, DtEnvValueSP root );
00051    DtFomParameterXmlBlock( const DtString& name, unsigned long handle, DtEnvValueSP root );
00052    virtual ~DtFomParameterXmlBlock();
00053 
00054    inline unsigned long handle() const;
00055    
00056 protected:
00057    
00058    DtSpyXmlBlockElement< unsigned long, true > myHandle;
00059 };
00060 
00061 
00062 
00063 // The DtFomInteractionXmlBlock holds a complete WWW request message
00064 class DT_DLL_WWW DtFomInteractionXmlBlock : public DtSpyXmlBlock
00065 {
00066 public:
00067    typedef std::set< DtFomParameterXmlBlockSP > FomParameterXmlBlockSet;
00068    typedef std::set< DtFomInteractionXmlBlockSP > FomStateInteractionXmlBlockSet;
00069 
00070    static DtSpyXmlBlockSP create( DtNodeAndParentPair xmlNodeAndParent );
00071 
00072 public:
00073    DtFomInteractionXmlBlock( DtEnvValueSP existingNode, DtEnvValueSP root );
00074    DtFomInteractionXmlBlock( const DtString& name, unsigned long handle, DtTransportType transport, DtOrderType order, DtEnvValueSP root );
00075    virtual ~DtFomInteractionXmlBlock();
00076 
00077    inline unsigned long handle() const;
00078    inline DtTransportType transport() const;
00079    inline DtOrderType order() const;
00080 
00081    // Add and Remove parameters from the list
00082    virtual DtFomParameterXmlBlockSP addParameter( const DtString& name, unsigned long handle );
00083    virtual DtFomParameterXmlBlockSP removeParameter( const DtString& name );
00084    virtual void removeParameter( DtFomParameterXmlBlockSP parameterSP );
00085 
00086    // List the parameter classes
00087    virtual FomParameterXmlBlockSet parameters();
00088 
00089    // Add and Remove child interactions from the list
00090    virtual DtFomInteractionXmlBlockSP addInteraction( const DtString& name, unsigned long handle, DtTransportType transport, DtOrderType order );
00091    virtual DtFomInteractionXmlBlockSP removeInteraction( const DtString& name );
00092    virtual void removeInteraction( DtFomInteractionXmlBlockSP objectSP );
00093 
00094    // List the child interaction classes
00095    virtual FomStateInteractionXmlBlockSet interactions();   
00096 
00097 protected:
00098 
00099    DtSpyXmlBlockElement< unsigned long, true > myHandle;
00100    DtSpyXmlBlockElement< unsigned long, true > myTransport;
00101    DtSpyXmlBlockElement< unsigned long, true > myOrder;    
00102 };
00103 
00104 inline DtTransportType DtFomInteractionXmlBlock::transport() const { return (DtTransportType) static_cast<unsigned long>( myTransport ); }
00105 inline DtOrderType DtFomInteractionXmlBlock::order() const { return (DtOrderType) static_cast<unsigned long>( myOrder ); }
00106 inline unsigned long DtFomParameterXmlBlock::handle() const { return myHandle; }
00107 inline unsigned long DtFomInteractionXmlBlock::handle() const { return myHandle; }
00108 
00109 #endif // DtFomInteractionXmlBlock_H_
00110 

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)