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

ShChannel.hpp

00001 // Sh: A GPU metaprogramming language. 00002 // 00003 // Copyright (c) 2003 University of Waterloo Computer Graphics Laboratory 00004 // Project administrator: Michael D. McCool 00005 // Authors: Zheng Qin, Stefanus Du Toit, Kevin Moule, Tiberiu S. Popa, 00006 // Michael D. McCool 00007 // 00008 // This software is provided 'as-is', without any express or implied 00009 // warranty. In no event will the authors be held liable for any damages 00010 // arising from the use of this software. 00011 // 00012 // Permission is granted to anyone to use this software for any purpose, 00013 // including commercial applications, and to alter it and redistribute it 00014 // freely, subject to the following restrictions: 00015 // 00016 // 1. The origin of this software must not be misrepresented; you must 00017 // not claim that you wrote the original software. If you use this 00018 // software in a product, an acknowledgment in the product documentation 00019 // would be appreciated but is not required. 00020 // 00021 // 2. Altered source versions must be plainly marked as such, and must 00022 // not be misrepresented as being the original software. 00023 // 00024 // 3. This notice may not be removed or altered from any source 00025 // distribution. 00027 #ifndef SHCHANNEL_HPP 00028 #define SHCHANNEL_HPP 00029 00030 #include "ShChannelNode.hpp" 00031 #include "ShProgram.hpp" 00032 00033 namespace SH { 00034 00040 template<typename T> 00041 class ShChannel : public ShMetaForwarder { 00042 public: 00043 typedef typename T::ValueType ValueType; 00045 ShChannel(); 00047 ShChannel(const ShMemoryPtr& memory, int count); 00048 00050 void memory(const ShMemoryPtr& memory, int count); 00051 00053 int count() const; 00055 ShPointer<const ShMemory> memory() const; 00057 ShMemoryPtr memory(); 00058 00061 T operator()(); 00064 const T operator()() const; 00065 00067 ShChannelNodePtr node(); 00069 const ShChannelNodePtr node() const; 00070 00072 ShChannel& operator=(const ShProgram& program); 00073 00074 private: 00076 ShChannelNodePtr m_node; 00077 }; 00078 00083 template<typename T> 00084 ShProgram connect(const ShChannel<T>& channel, const ShProgram& program); 00085 00090 template<typename T> 00091 ShProgram operator<<(const ShProgram& program, const ShChannel<T>& channel); 00092 00093 } 00094 00095 #include "ShChannelImpl.hpp" 00096 00097 #endif

Generated on Mon Oct 18 14:17:38 2004 for Sh by doxygen 1.3.7