Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Examples

ioqueue.h

Go to the documentation of this file.
00001 // Copyright (C) 2001,2002,2004 Federico Montesino Pouzols <fedemp@altern.org>.
00002 // 
00003 // This program is free software; you can redistribute it and/or modify
00004 // it under the terms of the GNU General Public License as published by
00005 // the Free Software Foundation; either version 2 of the License, or
00006 // (at your option) any later version.
00007 // 
00008 // This program is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011 // GNU General Public License for more details.
00012 // 
00013 // You should have received a copy of the GNU General Public License
00014 // along with this program; if not, write to the Free Software 
00015 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00016 // 
00017 // As a special exception, you may use this file as part of a free software
00018 // library without restriction.  Specifically, if other files instantiate
00019 // templates or use macros or inline functions from this file, or you compile
00020 // this file and link it with other files to produce an executable, this
00021 // file does not by itself cause the resulting executable to be covered by
00022 // the GNU General Public License.  This exception does not however    
00023 // invalidate any other reasons why the executable file might be covered by
00024 // the GNU General Public License.    
00025 //
00026 // This exception applies only to the code released under the name GNU
00027 // ccRTP.  If you copy code from other releases into a copy of GNU
00028 // ccRTP, as the General Public License permits, the exception does
00029 // not apply to the code that you add in this way.  To avoid misleading
00030 // anyone as to the status of such modified files, you must delete
00031 // this exception notice from them.
00032 //
00033 // If you write modifications of your own for GNU ccRTP, it is your choice
00034 // whether to permit this exception to apply to your modifications.
00035 // If you do not wish that, delete this exception notice.
00036 //
00037 
00044 #ifndef CCXX_RTP_IOQUEUE_H_
00045 #define CCXX_RTP_IOQUEUE_H_
00046 
00047 #include <ccrtp/iqueue.h>
00048 #include <ccrtp/oqueue.h>
00049 
00050 #ifdef  CCXX_NAMESPACES
00051 namespace ost {
00052 #endif
00053 
00077 class __EXPORT RTPDataQueue : 
00078         public IncomingDataQueue,
00079         public OutgoingDataQueue
00080 {
00081 public:
00101         typedef enum {
00102                 tosBestEffort,      
00103                 tosEnhanced         
00104         }       Tos;
00105 
00118         inline void
00119         setTypeOfService(Tos tos)
00120         { typeOfService = tos; }
00121 
00126         inline void enableStack()
00127         { dataServiceActive = true; }
00128  
00134         inline bool 
00135         isActive() const
00136         { return dataServiceActive; }
00137 
00197         uint32 
00198         getCurrentTimestamp() const;
00199 
00207         void
00208         setSessionBandwidth(uint32 bw)
00209         { sessionBw = bw; }
00210 
00211         uint32
00212         getDefaultSessionBandwidth() const
00213         { return defaultSessionBw; }
00214 
00215         uint32
00216         getSessionBandwidth() const
00217         { return sessionBw; }
00218 
00222         inline void 
00223         setTimeclock()
00224         { timeclock.setTimer(); }
00225  
00231         inline timeout_t 
00232         getTimeclock() const
00233         { return timeclock.getElapsed(); }
00234         
00235 protected:
00236 
00244         RTPDataQueue(uint32 size = defaultMembersHashSize);
00245 
00261         RTPDataQueue(uint32* ssrc, uint32 size = defaultMembersHashSize);
00262         
00267         inline virtual 
00268         ~RTPDataQueue()
00269         { endQueue(); }
00270 
00274         inline virtual void 
00275         timerTick()
00276         { return; }
00277 
00278         void renewLocalSSRC()
00279                 {IncomingDataQueue::renewLocalSSRC();};
00280 
00281 private:
00282         RTPDataQueue(const RTPDataQueue &o);
00283         
00284         RTPDataQueue&
00285         operator=(const RTPDataQueue &o);
00286 
00292         void
00293         initQueue();
00294 
00298         void
00299         endQueue();
00300 
00308         virtual bool
00309         isPendingData(microtimeout_t timeout) = 0;
00310 
00311         // true if connection "active"
00312         volatile bool dataServiceActive;
00313         Tos typeOfService;
00314         TimerPort timeclock;
00315         /* RTP session bandwidth control */
00316         static const uint32 defaultSessionBw;
00317         uint32 sessionBw;
00318 
00319 
00320 };
00321  // ioqueue
00323 
00324 #ifdef  CCXX_NAMESPACES
00325 }
00326 #endif
00327 
00328 #endif  //CCXX_RTP_IOQUEUE_H_
00329 

Generated on Tue Jun 7 17:18:46 2005 for ccRTP by  doxygen 1.4.2