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

MNFileSourceSH.h

Go to the documentation of this file.
00001 /* Copyright (C) 2000 KOM/Darmstadt University of Technology 00002 * 00003 * You are allowed to use all other parts of the code under the following terms: 00004 * 00005 * For non-commercial use, code may be used in unmodified form provided 00006 * that this copyright notice and this permission notice appear in 00007 * supporting documentation. 00008 * 00009 * This software is provided "as is" and without any express or implied 00010 * warranties, including, without limitation, the implied warranty of 00011 * fitness for a particular purpose. 00012 * 00013 * The code may be subjected to the GNU General Public License, Version 2, 00014 * and re-distributed under the terms of this license. 00015 * As a special exception, permission is granted to link this code 00016 * with the Qt library and distribute executables, as long as you 00017 * follow the requirements of the GNU GPL in regard to all of the 00018 * software in the executable aside from Qt. 00019 * 00020 * Commercial use other than under the terms of the GNU General Public 00021 * License is allowed only after express negotiation of conditions 00022 * with the authors. 00023 */ 00024 #ifndef MN_FILE_SOURCE_STREAM_HANDLER_H 00025 #define MN_FILE_SOURCE_STREAM_HANDLER_H 00026 00027 #include <sys/types.h> 00028 #include <stdio.h> 00029 00030 #include "SH.h" 00031 #include "SHEndpoint.h" 00032 #include "SHEndpointSpec.h" 00033 #include "var_type.h" 00034 00035 class MNRope; 00036 00037 namespace SH 00038 { 00039 00040 class FileSourceSH; 00041 00046 /**********************************************************************/ 00047 /* FileSourceEndpoint */ 00048 /**********************************************************************/ 00049 00050 class FileSourceEndpoint 00051 : public SourceEndpoint 00052 { 00053 public: 00054 FileSourceEndpoint( FileSourceSH* mySH ); 00055 virtual ~FileSourceEndpoint( ); 00056 00057 virtual SH_RC pull( DataPtr& item, 00058 SourceUnit su, 00059 size_t amount ); 00060 00061 FileSourceSH* fsh(); 00062 }; 00063 00064 /**********************************************************************/ 00065 /* FileSourceSH */ 00066 /**********************************************************************/ 00067 00068 class FileSourceSH 00069 : public Base 00070 { 00071 public: 00072 FileSourceSH( SHGraphManager* mgr, 00073 u_int32_t runtimeId, 00074 MNSelector& sel ); 00075 00076 virtual ~FileSourceSH(); 00077 00078 private: 00079 00084 FileSourceSH( const FileSourceSH& ); 00085 00090 FileSourceSH& operator=( const FileSourceSH& ); 00091 00092 public: 00095 virtual SH_RC initSH(); 00098 virtual SH_RC uninitSH(); 00099 00102 virtual SH_RC startStreaming(); 00103 00104 SH_RC changePos ( u_int64 pos ); 00105 00106 long getPos( ); 00107 SH_RC getPos ( long &pos ); 00108 00109 SH_RC pull_from_file( DataPtr& item, 00110 SourceUnit su, 00111 size_t amount ); 00112 00113 /******************************************************************/ 00114 /* additional attributes for the set() functions */ 00115 /******************************************************************/ 00116 public: 00117 SA_FILE_NAME _filename; 00118 private: 00119 int _file_handle; 00120 FILE* _file_stream; 00121 00122 SA_FILESRC_DEFAULT_UNIT _default_unit; 00123 public: 00124 SA_FILESRC_START_POS _start_pos; 00125 SA_FILESRC_STOP_POS _stop_pos; 00126 00127 private: 00128 long _actual_position; 00129 00130 // Attributes haved been moved to SH.h 00131 00132 /******************************************************************/ 00133 /* functions required for SH::Spec */ 00134 /******************************************************************/ 00135 protected: 00136 friend class FileSourceEndpoint; 00137 00138 SourceEndpoint* _out_ep_a[1]; 00139 FileSourceEndpoint _outEP; 00140 00141 public: 00142 virtual SinkEndpoint** getSinkSpecs(); 00143 virtual SourceEndpoint** getSourceSpecs(); 00144 00145 /******************************************************************/ 00146 /* functions required for SHStatus */ 00147 /******************************************************************/ 00157 virtual bool isConnected() const; 00158 }; 00159 00161 00162 }; // namespace SH 00163 00164 #endif /* MN_FILE_SOURCE_STREAM_HANDLER_H */ 00165

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