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 NOP_SINK_SH_H 00025 #define NOP_SINK_SH_H 00026 00027 #include <sys/types.h> 00028 00029 #include "SH.h" 00030 #include "SHEndpoint.h" 00031 #include "SHEndpointSpec.h" 00032 #include "MNPCList.h" 00033 #include "var_type.h" 00034 00035 namespace SH 00036 { 00037 00042 class NopSinkSH; 00043 class NopSinkSinkEndpoint; 00044 class NopSinkSourceEndpoint; 00045 00046 /**********************************************************************/ 00047 /* NopSinkSinkEndpoint */ 00048 /**********************************************************************/ 00049 00050 class NopSinkSinkEndpoint 00051 : public SinkEndpoint 00052 { 00053 public: 00054 NopSinkSinkEndpoint( NopSinkSH* mySH ); 00055 virtual ~NopSinkSinkEndpoint( ); 00056 00057 virtual SH_RC push( DataPtr item ); 00058 00059 NopSinkSH* dsh(); 00060 }; 00061 00062 /**********************************************************************/ 00063 /* NopSinkSH */ 00064 /**********************************************************************/ 00065 00066 class NopSinkSH 00067 : public Base 00068 { 00069 public: 00070 NopSinkSH( SHGraphManager* mgr, 00071 u_int32_t runtimeId, 00072 MNSelector& sel ); 00073 00074 private: 00075 00077 NopSinkSH( const NopSinkSH& ); 00078 00080 NopSinkSH& operator=( const NopSinkSH& ); 00081 00082 /******************************************************************/ 00083 /* functions required for SHStatus */ 00084 /******************************************************************/ 00085 protected: 00086 friend class NopSinkSinkEndpoint; 00087 00088 virtual void pushReport( ReportPtr report, Direction d ); 00089 SH_RC push( DataPtr ptr ); 00090 00091 friend class NopIntegratedSH; // for the fake "integrated" SH test case 00092 00093 SinkEndpoint* _in_ep_a[1]; 00094 NopSinkSinkEndpoint _inEP; 00095 00096 public: 00097 virtual SinkEndpoint** getSinkSpecs(); 00098 virtual SourceEndpoint** getSourceSpecs(); 00099 00112 virtual bool isConnected() const; 00113 00114 private: 00115 size_t _cnt; 00116 00120 void inc_cnt( ); 00121 }; 00122 00124 00125 }; // namespace SH 00126 00127 #endif /* NOP_SINK_SH_H */ 00128