VR-Forces 4.0.4 Class Documentation
include/vrfmsgs/ifEntityResourceResponse.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2004 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: ifEntityResourceResponse.h,v $ $Revision: 1.9 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00017 
00018 
00019 #ifndef DtIfEntityResourceResponse_H_
00020 #define DtIfEntityResourceResponse_H_
00021 
00022 #include <vlutil/vlString.h>
00023 #include <vrfExtProtocol/ifaceCont.h>
00024 #include <vlutil/vlNetTypes.h>
00025 #include <vl/hostStructs.h>
00026 
00027 #include <list>
00028 
00029 class DtSimResource;
00030 
00035 
00036 #include "vrfmsgs/vrfmsgsDefines.h"
00037 class DT_DLL_vrfmsgs DtResource
00038 {
00039 public:
00040    DtResource() {};
00041    DtResource& operator=(const DtResource& res)
00042    {
00043       myResourceName = res.myResourceName;
00044       myResourceType = res.myResourceType;
00045       myCurrentAmount = res.myCurrentAmount;
00046       myFullAmount = res.myFullAmount;
00047       myResourceEntityType = res.myResourceEntityType;
00048 
00049       return *this;
00050    };
00051 
00052    DtNetFloat64   myCurrentAmount;
00053    DtNetFloat64   myFullAmount;
00054    DtString       myResourceName;
00055    DtString       myResourceType;
00059    DtEntityType   myResourceEntityType;
00060 };
00061 
00062 typedef std::list<DtResource> DtEntityResourceList;
00063 
00066 class DT_DLL_vrfmsgs DtIfEntityResourceResponse : public DtSimInterfaceContent
00067 {
00068 
00069 public:
00071    DtIfEntityResourceResponse();
00072 
00074    DtIfEntityResourceResponse(const DtIfEntityResourceResponse & orig);
00075 
00077    const DtIfEntityResourceResponse & operator=(const DtIfEntityResourceResponse & orig);
00078 
00079    virtual ~DtIfEntityResourceResponse();
00080 
00082    virtual int type() const;
00083 
00084    virtual DtSimInterfaceContent * clone() const;
00085 
00086    virtual int netRepSize() const;
00087    virtual bool setFromNet(const char* contentBuffer, 
00088       unsigned contentSize);
00089    virtual bool setToNet();
00090    virtual bool setToNet(char* buffer);
00091 
00092    virtual void printDataToString(DtString& str);
00093 
00094    static DtSimInterfaceContent* creator();
00095 
00096 public:
00097    virtual void setObjectName(const DtString& name);
00098    const DtString& objectName() const { return myObjectName; };
00099 
00100    virtual void addResource(const DtSimResource* resource, const DtString& fullName);
00101    const DtEntityResourceList& resources() const { return myResources; };
00102 
00105    virtual bool resourceInformation(const DtString& resource,
00106       DtResource& resourceInfo) const;
00107 
00108 protected:
00109    virtual int sizeOfResourceEntry(const DtResource& entry) const;
00110    virtual char* setToNet(char* buffer, const DtResource& entry);
00111    virtual const char * setFromNet(const char* buffer, DtResource& entry);
00112 
00113 protected:
00114    DtString             myObjectName;
00115    DtEntityResourceList myResources;
00116 };
00117 
00118 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)