Planeshift
netinfos.h
Go to the documentation of this file.
1 /*
2  * netinfos.h by Marc Haisenk <axl@cu-muc.de>
3  *
4  * Copyright (C) 2001 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  * This serves as a layer for getting informations about the network
19  */
20 #ifndef __NETINFOS_H__
21 #define __NETINFOS_H__
22 
23 #include <cstypes.h>
24 
29 #define NETINFOS_TICKARRAYSIZE 10
31 
32 
33 
36 {
37 public:
39  psNetInfos() { SetupTickArray(); }
41  ~psNetInfos();
42 
44  void AddPingTicks(csTicks t);
46  csTicks GetAveragePingTicks();
47 
49 
50 private:
52  void SetupTickArray();
54  csTicks tickArray[NETINFOS_TICKARRAYSIZE];
56  int tickArrayLoc;
57 };
58 
61 #endif
Gives informations about the network connection.
Definition: netinfos.h:35
psNetInfos()
Constructor.
Definition: netinfos.h:39
void AddPingTicks(csTicks t)
Add a tick value to the global queue.
int droppedPackets
Definition: netinfos.h:48
csTicks GetAveragePingTicks()
Compute the average ticks a ping uses.
~psNetInfos()
Destructor.
#define NETINFOS_TICKARRAYSIZE
Number of entries in the ticks queue for calculating the average.
Definition: netinfos.h:30