Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# deNetData.hpp

Go to the documentation of this file.

    00001 ///////////////////////////////////////////////////////////////////////////////
    00002 /// @file deNetData.hpp
    00003 ///
    00004 /// @brief
    00005 ///
    00006 /// @author trajar
    00007 ///
    00008 /// This file is the intellectual property of Novus Delta, LLC.. Usage of the
    00009 /// contents of this file is subject to the Destiny3D Member License which
    00010 /// can be found at http://www.destiny3d.com.  Any other usage is prohibited.
    00011 ///
    00012 /// This file is distributed "AS IS" without warranty of any kind.  Novus
    00013 /// Delta, LLC. does not guarantee the fitness of the contents of this file
    00014 /// for any particular purpose.
    00015 ///
    00016 /// Copyright (C) 2001-2003 Novus Delta, LLC. All Rights Reserved.
    00017 ///
    00018 /// <hr>
    00019 ///                                 Change History
    00020 /// <hr>
    00021 ///
    00022 /// @date Jun 2002
    00023 /// @author trajar
    00024 /// @remarks Creation
    00025 ///
    00026 ///////////////////////////////////////////////////////////////////////////////
    00027
    00028 #ifndef _DENETDATA_HPP
    00029 #define _DENETDATA_HPP
    00030
    00031 #ifndef     _DENET_HPP
    00032  #include   "deNet.hpp"
    00033 #endif
    00034
    00035 class deNetDataGroup;
    00036
    00037 //---------------------------------------------------------------------------
    00038 // deNetDataItem
    00039 //
    00040 // - base item transferred over network
    00041 //---------------------------------------------------------------------------
    00042 typedef class DENET_API deNetDataItem
    00043 {
    00044 public:
    00045
    00046     deNetDataItem(void)                 { }
    00047     virtual ~deNetDataItem(void)        { }
    00048
    00049     virtual bool        StreamFrom( const deNetDataItem * pFrom );
    00050     virtual bool        ApplyFrom ( const deNetDataItem * pFrom );
    00051
    00052     const char *        GetDataName(void)       const   { return m_DataName; }
    00053     DWORD               GetDataID(void)         const   { return m_DataID; }
    00054     DWORD               GetDataSize(void)       const   { return m_DataSize; }
    00055     deNetDataGroup *    GetGroup(void)          const   { return m_Group; }
    00056
    00057 protected:
    00058
    00059     virtual bool        DeadReckon( float fTime )       { return true; }
    00060
    00061     char                m_DataName[32];
    00062     unsigned char       m_DataID;
    00063     DWORD               m_DataSize;
    00064     void *              m_RawData;
    00065     deNetDataGroup *    m_Group;
    00066
    00067 } deNetDataItem, *pdeNetDataItem;
    00068
    00069 //---------------------------------------------------------------------------
    00070 // deNetDataGroup
    00071 //
    00072 // - simply a group of data objects grouped together for transfer
    00073 //---------------------------------------------------------------------------
    00074 typedef class DENET_API deNetDataGroup
    00075 {
    00076 public:
    00077
    00078     deNetDataGroup(void)    : m_DataItems(NULL) { }
    00079     ~deNetDataGroup(void)                       { SAFE_DELETE_ARRAY( m_DataItems ); }
    00080
    00081     deNetDataItem   *   GetItemAt( unsigned int iIndex )            { deASSERT( m_NumDataItems > iIndex ); return m_DataItems + iIndex; }
    00082     unsigned int        GetNumItems(void)                   const   { return m_NumDataItems; }
    00083     bool                IsDeadReckoned(void)                const   { return m_bDeadReckoning; }
    00084     float               GetAbsTime(void)                    const   { return m_fAbsTime; }
    00085     unsigned int        GetGroupID(void)                    const   { return m_GroupID; }
    00086
    00087 protected:
    00088
    00089     unsigned int        m_GroupID;
    00090     deNetDataItem   *   m_DataItems;
    00091     unsigned char       m_NumDataItems;
    00092     bool                m_bDeadReckoning;
    00093     float               m_fAbsTime;
    00094
    00095 } deNetDataGroup, *pdeNetDataGroup;
    00096
    00097 #endif