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

DummyListFile.h

Go to the documentation of this file.
00001 /* Copyright (C) 2002 Carsten Griwodz 00002 * 00003 * You are allowed to use all other parts of the code under the following terms: 00004 * 00005 * For non-commercial use, this code may be used in unmodified form 00006 * provided that this copyright notice and this permission notice appear 00007 * in supporting documentation. 00008 * 00009 * The code may be made subject to the terms of the GNU General Public 00010 * License, Version 2, and re-distributed under the terms of this license. 00011 * 00012 * Commercial use other than under the terms of the GNU General Public 00013 * License is allowed only after negotiation of conditions with the authors. 00014 */ 00015 #ifndef DUMMY_LIST_FILE_H 00016 #define DUMMY_LIST_FILE_H 00017 00018 #include <sys/types.h> 00019 #include <list> 00020 00021 #include "DummyList.h" 00022 00023 using std::list; 00024 00025 namespace SH 00026 { 00027 00032 class DummyListFile : public DummyListBase 00033 { 00034 list<entry> l; 00035 bool _autofill; 00036 Timeval _start_time; 00037 Timeval _run_time; 00038 Timeval _start_timecode; 00039 u_int32_t _seq_no; 00040 u_int32_t _max_seq_no; 00041 fstream* _file; 00042 u_int32_t _blocksize; 00043 u_int32_t _initial_fill; 00044 u_int32_t _q_len; 00045 u_int32_t _packets_pulled; 00046 public: 00047 DummyListFile( const char* filename, bool autofill ); 00048 ~DummyListFile( ); 00049 00050 bool bad( ) const; 00051 00052 void init( u_int32_t initial_fill, 00053 u_int32_t blocksize, 00054 u_int32_t bandwidth ); 00055 u_int32_t runtimeSec( ); 00056 void setPri( const char* pri ); 00057 void setSeqno( u_int32_t ); 00058 void setMaxSeqno( u_int32_t ); 00059 void compress_queue( u_int32_t q_len ); 00060 00061 void fill( ); 00062 00063 u_int32_t get( DataPtr& item ); 00064 void put( DataPtr item ); 00065 00066 inline u_int32_t getBlocksize() const { 00067 return _blocksize; 00068 } 00069 00070 inline u_int32_t size() const { 00071 return l.size(); 00072 } 00073 00074 inline bool eof() const { 00075 return ( _seq_no >= _max_seq_no ); 00076 } 00077 private: 00078 int32_t pull_dummy( Timeval& timecode, 00079 u_int32_t& seqno, 00080 u_int32_t& pri ); 00081 00082 DummyListFile( ); 00083 DummyListFile( const DummyListFile& ); 00084 DummyListFile& operator=( const DummyListFile& ); 00085 }; 00086 00088 00089 }; // namespace SH 00090 00091 #endif /* DUMMY_LIST_FILE_H */ 00092

Generated on Sun Mar 6 13:35:49 2005 for Komssys by doxygen 1.3.8