Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages | Examples

pendingack.h

00001 /***************************************************************************
00002  * The contents of this file are subject to the Mozilla Public             *
00003  * License Version 1.1 (the "License"); you may not use this file          *
00004  * except in compliance with the License. You may obtain a copy of         *
00005  * the License at http://www.mozilla.org/MPL/                              *
00006  *                                                                         *
00007  * Software distributed under the License is distributed on an "AS         *
00008  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or              *
00009  * implied. See the License for the specific language governing            *
00010  * rights and limitations under the License.                               *
00011  *                                                                         *
00012  * The Original Code is Game Network Framework (GaNeF).                    *
00013  *                                                                         *
00014  * The Initial Developers of the Original Code are                         *
00015  * Lars Langer and Emanuel Greisen                                         *
00016  * Copyright (C) 2005. Lars Langer & Emanuel Greisen                       *
00017  * All Rights Reserved.                                                    *
00018  *                                                                         *
00019  * Contributor(s):                                                         *
00020  *   none yet....                                                          *
00021  *                                                                         *
00022  ***************************************************************************/
00023 #ifndef PENDINGACK_H
00024 #define PENDINGACK_H
00025 
00026 /**
00027  * @ingroup Common
00028  * @brief An object of this class represents a reliable package sent, and how long there is before it times out.
00029  * @author Lars Langer & Emanuel Greisen
00030 */
00031 template<class PacketType, class SocketType>
00032 class PendingAck
00033 {
00034 public:
00035    unsigned int seq;
00036    unsigned char pri;
00037    unsigned int user_id;
00038 
00039    unsigned int timeout;
00040    bool acked;
00041    unsigned int queue_time;
00042    unsigned int sent_time;
00043    PacketType *packet;
00044 
00045 public:
00046    PendingAck(unsigned int seq, unsigned char pri, unsigned int uid, unsigned int timeout, PacketType *packet);
00047    ~PendingAck();
00048 
00049 public:
00050    inline void setQueueTime(unsigned int t) { queue_time = t; };
00051    inline void setSentTime(unsigned int t) { sent_time = t; };
00052 
00053 };
00054 
00055 
00056 
00057 template<class PacketType, class SocketType>
00058 PendingAck<PacketType, SocketType>::PendingAck(
00059    unsigned int seq,
00060    unsigned char pri,
00061    unsigned int uid,
00062    unsigned int timeout,
00063    PacketType * packet )
00064    : seq(seq),
00065       pri(pri),
00066       user_id(uid),
00067       timeout(timeout),
00068       acked(false),
00069       packet(packet)
00070 {
00071 }
00072 
00073 template<class PacketType, class SocketType>
00074 PendingAck<PacketType, SocketType>::~PendingAck()
00075 {
00076 }
00077 
00078 #endif

Generated on Mon Feb 6 12:24:50 2006 for Ganef by  doxygen 1.4.4