SIBCNetworkLayer.h

00001 //***************************************************************************************
00002 //
00003 // File supervisor: Crosswalk team
00004 //
00005 // Copyright 2008 Autodesk, Inc.  All rights reserved.  
00006 // Use of this software is subject to the terms of the Autodesk license agreement 
00007 // provided at the time of installation or download, or which otherwise accompanies 
00008 // this software in either electronic or hard copy form.
00009 //
00010 //***************************************************************************************
00011 
00012 #ifndef _SIBCNETWORKLAYER_H_
00013 #define _SIBCNETWORKLAYER_H_
00014 
00015 #include <SIBCUtil.h>
00016 #include <SIBCArray.h>
00017 #include "SINetworkMessages.h"
00018 
00019 typedef SI_Error (*NETMSGPROVIDER) ( SINetMsg* , SI_Void* );
00020 
00021 struct  SINetworkProviderInfo
00022 {
00023     NETMSGPROVIDER  m_pFnc;
00024     SI_Int          m_iMsg;
00025     SI_Void*        m_pUserData;
00026 };
00027 
00028 class SIBCNetworkLayer
00029 {
00030 public:
00031     SIBCNetworkLayer();
00032     virtual ~SIBCNetworkLayer();
00033 
00034     virtual SI_Error    Initialize  ( SI_Void * );
00035     virtual SI_Error    Shutdown    ( SI_Void * );
00036     
00037     virtual SI_Error    RecvCmd     ( SI_Void * );
00038     virtual SI_Error    PeekCmd     ( SI_Void * );
00039     virtual SI_Error    SendCmd     ( SI_Void * );
00040 
00041     virtual SI_Error    DispatchNetMessage  ( SINetMsg* in_pMsg );
00042 
00043     virtual SI_Error    RegisterProvider    ( SINetworkProviderInfo& );
00044 
00045     virtual SI_Error    NotifyCmdEnd        ();
00046 
00047 protected:
00048 
00049     CSIBCArray<SINetworkProviderInfo>       m_pProviderList;
00050 
00051     SI_Char             m_szHostName[128];
00052 
00053 };
00054 
00055 //
00056 // The following must be defined seperatly on each plateform
00057 //
00058 
00059 SIBCNetworkLayer*   InitializeNetworkLayer  ( SI_Void * );      
00060 SI_Error            ShutdownNetworkLayer    ( SIBCNetworkLayer* );
00061 
00062 #endif