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

# deConnectionProvider.hpp

Go to the documentation of this file.

    00001 ///////////////////////////////////////////////////////////////////////////////
    00002 /// @file deConnectionProvider.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 _DECONNECTIONPROVIDER_HPP
    00029 #define _DECONNECTIONPROVIDER_HPP
    00030
    00031 #include    <WINDOWS.H>
    00032
    00033 #ifndef     _DENET_HPP
    00034  #include   "deNet.hpp"
    00035 #endif
    00036
    00037 #ifndef     _DESYNCHOBJECT_HPP
    00038  #include   "deSynchObject.hpp"
    00039 #endif
    00040
    00041 class deConnection;
    00042 class deConnectionBin;
    00043
    00044 typedef class DENET_API deConnectionProvider
    00045 {
    00046 public:
    00047
    00048     deConnectionProvider(void);
    00049     virtual ~deConnectionProvider(void);
    00050
    00051     eNetError           AddConnectionToBins( deConnection * pConn );
    00052     eNetError           Init( DWORD dwFlags = NULL);
    00053     eNetError           Shutdown( DWORD dwFlags = NULL );
    00054     eNetError           CreateConnection( deConnection ** pOut, void * pProviderInfo = NULL, DWORD dwFlags = NULL );
    00055     eNetError           CloseConnection ( deConnection ** pConn, DWORD dwFlags = NULL );
    00056
    00057     WORD                GetNumTotalConnectionBins(void);
    00058     WORD                GetNumProvidedConnectionBins(void);
    00059     DWORD               GetNumTotalConnections(void)    const   { return m_iNumTotalConnections; }
    00060     DWORD               GetNumProvidedConnections(void) const   { return m_iNumConnections; }
    00061     bool                IsReady(void)                   const   { return m_bReady; }
    00062     deSynchObject *     GetSynchObject(void)              { return &m_SynchObject; }
    00063
    00064     virtual deConnection *      GetConnectionAt( DWORD pIndex )                             = 0;
    00065
    00066 protected:
    00067
    00068     virtual eNetError   OnInit( DWORD dwFlags = NULL )                                      = 0;
    00069     virtual eNetError   OnShutdown( DWORD dwFlags = NULL )                                  = 0;
    00070     virtual eNetError   OnCreateConnection( deConnection ** pOut, void * pProviderInfo = NULL, DWORD dwFlags = NULL )   = 0;
    00071     virtual eNetError   OnCloseConnection ( deConnection ** pConn, DWORD dwFlags = NULL )       = 0;
    00072
    00073     virtual deConnectionBin *   GetAvailableBin(void)               = 0;
    00074     virtual deConnection *      GetUnusedConnection(void)           = 0;
    00075
    00076     deConnectionBin *   m_aConnectionBins;
    00077     deConnection *      m_aConnections;
    00078     deSynchObject       m_SynchObject;
    00079
    00080 private:
    00081
    00082     static DWORD        m_iNumTotalConnections;
    00083     DWORD               m_iNumConnections;
    00084     static WORD         m_iNumTotalConnectionBins;
    00085     WORD                m_iNumConnectionBins;
    00086     bool                m_bReady;
    00087
    00088 } deConnectionProvider, *pdeConnectionProvider;
    00089
    00090 #endif