MAK RTIspy API Documentation for HLA Evolved
fomObjectXmlBlock.h
Go to the documentation of this file.
00001 /*********************************************************************
00002  ** Copyright (c) 2006 MaK Technologies, Inc.
00003  ** All rights reserved.
00004  *********************************************************************/
00005 /*******************************************************************************
00006  ** $RCSfile: fomObjectXmlBlock.h,v $ $Revision: 1.7 $ $State: Exp $
00007  *******************************************************************************/
00008 #ifndef DtFomObjectXmlBlock_H_
00009 #define DtFomObjectXmlBlock_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( DtFomObjectXmlTag );
00026 DtDECLARE_SPY_XML_TAG( DtFomAttributeXmlTag );
00027 DtDECLARE_SPY_XML_TAG( DtAttrTransportXmlTag );
00028 DtDECLARE_SPY_XML_TAG( DtAttrOrderXmlTag );
00029 DtDECLARE_SPY_XML_TAG( DtObjHandleXmlTag );
00030 DtDECLARE_SPY_XML_TAG( DtAttrHandleXmlTag );
00031 
00032 class DtFomObjectXmlBlock;
00033 class DtFomAttributeXmlBlock;
00034 typedef DtBoost::shared_ptr<DtFomObjectXmlBlock> DtFomObjectXmlBlockSP;
00035 typedef DtBoost::weak_ptr<DtFomObjectXmlBlock>   DtFomObjectXmlBlockWP;
00036 typedef DtBoost::shared_ptr<DtFomAttributeXmlBlock> DtFomAttributeXmlBlockSP;
00037 typedef DtBoost::weak_ptr<DtFomAttributeXmlBlock>   DtFomAttributeXmlBlockWP;
00038 
00039 
00040 // The DtFomAttributeXmlBlock holds a single FOM object class attribute
00041 // Helper class to DtFomObjectXmlBlock.
00042 class DT_DLL_WWW DtFomAttributeXmlBlock : public DtSpyXmlBlock
00043 {
00044 public:
00045    
00046    static DtSpyXmlBlockSP create( DtNodeAndParentPair xmlNodeAndParent );
00047 
00048 public:
00049    DtFomAttributeXmlBlock( DtEnvValueSP existingNode, DtEnvValueSP root );
00050    DtFomAttributeXmlBlock( const DtString& name, unsigned long handle, DtTransportType transport, DtOrderType order, DtEnvValueSP root );
00051    virtual ~DtFomAttributeXmlBlock();
00052 
00053    inline unsigned long handle() const;
00054    inline DtTransportType transport() const;
00055    inline DtOrderType order() const;
00056    
00057 protected:
00058 
00059    DtSpyXmlBlockElement< unsigned long, true > myHandle;
00060    DtSpyXmlBlockElement< unsigned long, true > myTransport;
00061    DtSpyXmlBlockElement< unsigned long, true > myOrder;    
00062 };
00063 
00064    
00065 
00066 // The DtFomObjectXmlBlock holds a complete WWW request message
00067 class DT_DLL_WWW DtFomObjectXmlBlock : public DtSpyXmlBlock
00068 {
00069 public:
00070    typedef std::set< DtFomAttributeXmlBlockSP > FomAttributeXmlBlockSet;
00071    typedef std::set< DtFomObjectXmlBlockSP > FomStateObjectXmlBlockSet;   
00072 
00073    static DtSpyXmlBlockSP create( DtNodeAndParentPair xmlNodeAndParent );
00074 
00075 public:
00076    DtFomObjectXmlBlock( DtEnvValueSP existingNode, DtEnvValueSP root );
00077    DtFomObjectXmlBlock( const DtString& name, unsigned long handle, DtEnvValueSP root );
00078    virtual ~DtFomObjectXmlBlock();
00079 
00080    inline unsigned long handle() const;
00081    
00082    // Add and Remove attributes from the list
00083    virtual DtFomAttributeXmlBlockSP addAttribute( const DtString& name, unsigned long handle, DtTransportType transport, DtOrderType order );
00084    virtual DtFomAttributeXmlBlockSP removeAttribute( const DtString& name );
00085    virtual void removeAttribute( DtFomAttributeXmlBlockSP attrSP );
00086 
00087    // List the attribute classes
00088    virtual FomAttributeXmlBlockSet attributes();
00089 
00090    // Add and Remove child objects from the list
00091    virtual DtFomObjectXmlBlockSP addObject( const DtString& name, unsigned long handle );
00092    virtual DtFomObjectXmlBlockSP removeObject( const DtString& name );
00093    virtual void removeObject( DtFomObjectXmlBlockSP objectSP );
00094 
00095    // List the child object classes
00096    virtual FomStateObjectXmlBlockSet objects();
00097 
00098 protected:
00099 
00100    DtSpyXmlBlockElement< unsigned long, true > myHandle;
00101    
00102 };
00103 
00104 inline DtTransportType DtFomAttributeXmlBlock::transport() const { return (DtTransportType) static_cast<unsigned long>( myTransport ); }
00105 inline DtOrderType DtFomAttributeXmlBlock::order() const { return (DtOrderType) static_cast<unsigned long>( myOrder ); }
00106 inline unsigned long DtFomAttributeXmlBlock::handle() const { return myHandle; }
00107 inline unsigned long DtFomObjectXmlBlock::handle() const { return myHandle; }
00108 
00109 #endif // DtFomObjectXmlBlock_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)