-
Notifications
You must be signed in to change notification settings - Fork 1
/
INetPacket.h
57 lines (52 loc) · 1.62 KB
/
INetPacket.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/* Copyright (C) 2015 Willi Menapace <[email protected]>, Simone Lorengo - All Rights Reserved
* Unauthorized copying of this file, via any medium is strictly prohibited
* Proprietary and confidential
* Written by Willi Menapace <[email protected]>
*/
#ifndef INET_PACKET_INCLUDED
#define INET_PACKET_INCLUDED
#include "GlobalDefines.h"
#include "INetPacketType.cpp"
/**
* Pacchetto a livello applicativo utilizzato nella rete interna
*/
class INetPacket {
private:
unsigned char length; //Lunghezza dei dati del pacchetto
protected:
unsigned char *data; //Dati contenuti dal pacchetto
/**
* Costruttore di copia. Il pacchetto copiato condivide lo stesso buffer di dati
*
* @param packet il pacchetto da copiare
*/
INetPacket(INetPacket *packet);
public:
/**
* Ottiene il tipo di pacchetto
*
* @return il tipo di pacchetto
*/
INetPacketType getType();
/**
* Ottiene la lunghezza in byte del pacchetto
*
* @return la lunghezza in byte del pacchetto
*/
unsigned char getLength();
/**
* Ottiene i dati contenuti dal pacchetto
*
* @return i dati contenuti dal pacchetto
*/
unsigned char *getData();
/**
* Costruisce un pacchetto contenente i dati specificati
*
* @param _data i dati che dovra' contenere il pacchetto.
* Rimane comune a tutti i pacchetti costruiti a partire da quello corrente
* @param _length la lunghezza in byte dei dati
*/
INetPacket(unsigned char *_data, unsigned char _length);
};
#endif // INET_PACKET_INCLUDED