This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BaseLayer.h
42 lines (34 loc) · 1.41 KB
/
BaseLayer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// BaseLayer.h: interface for the CBaseLayer class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BASELAYER_H__041C5A07_23A9_4CBC_970B_8743460A7DA9__INCLUDED_)
#define AFX_BASELAYER_H__041C5A07_23A9_4CBC_970B_8743460A7DA9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CBaseLayer
{
public:
char* GetLayerName( );
CBaseLayer* GetUnderLayer( );
CBaseLayer* GetUpperLayer( int nindex );
void SetUnderUpperLayer( CBaseLayer* pUULayer = NULL );
void SetUpperUnderLayer( CBaseLayer* pUULayer = NULL );
void SetUnderLayer( CBaseLayer* pUnderLayer = NULL ) ;
void SetUpperLayer( CBaseLayer* pUpperLayer = NULL ) ;
CBaseLayer( char* pName = NULL );
virtual ~CBaseLayer();
// param : u_char* - the data of the upperlayer
// int - the length of data
virtual BOOL Send( u_char*, int ) { return FALSE ; }
// param : u_char* - the data of the underlayer
virtual BOOL Receive( u_char* ppayload ) { return FALSE ; }
virtual BOOL Receive( u_char* ppayload, int len ) { return FALSE ; }
virtual BOOL Receive( ) { return FALSE ; }
protected:
char* m_pLayerName;
CBaseLayer* mp_UnderLayer; // UnderLayer pointer
CBaseLayer* mp_aUpperLayer[ MAX_LAYER_NUMBER ]; // UpperLayer pointer
int m_nUpperLayerCount; // UpperLayer Count
};
#endif // !defined(AFX_BASELAYER_H__041C5A07_23A9_4CBC_970B_8743460A7DA9__INCLUDED_)