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

ShStream.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 SHSTREAM_HPP
00028 #define SHSTREAM_HPP
00029 
00030 #include <list>
00031 #include "ShDllExport.hpp"
00032 #include "ShChannel.hpp"
00033 #include "ShChannelNode.hpp"
00034 
00035 namespace SH {
00036 
00042 class
00043 SH_DLLEXPORT ShStream {
00044 public:
00045   ShStream(const ShChannelNodePtr& node);
00046   
00047   template<typename T>
00048   ShStream(const ShChannel<T>& channel);
00049 
00050   typedef std::list<ShChannelNodePtr> NodeList;
00051 
00052   NodeList::const_iterator begin() const;
00053   NodeList::const_iterator end() const;
00054   NodeList::iterator begin();
00055   NodeList::iterator end();
00056   int size() const;
00057 
00058   template<typename T>
00059   void append(const ShChannel<T>& channel);
00060   template<typename T>
00061   void prepend(const ShChannel<T>& channel);
00062 
00063   void append(const ShChannelNodePtr& node);
00064   void prepend(const ShChannelNodePtr& node);
00065   // Execute fully bound stream program and place results in stream.
00066   ShStream& operator=(const ShProgram& program);
00067   
00068 private:
00069   std::list<ShChannelNodePtr> m_nodes;
00070 };
00071 
00075 template<typename T1, typename T2>
00076 ShStream combine(const ShChannel<T1>& left, const ShChannel<T2>& right);
00077 
00082 template<typename T2>
00083 ShStream combine(const ShStream& left, const ShChannel<T2>& right);
00084 
00089 template<typename T1>
00090 ShStream combine(const ShChannel<T1>& left, const ShStream& right);
00091 
00092 SH_DLLEXPORT
00093 ShStream combine(const ShStream& left, const ShStream& right);
00094 
00097 template<typename T1, typename T2>
00098 ShStream operator&(const ShChannel<T1>& left, const ShChannel<T2>& right);
00099 
00102 template<typename T2>
00103 ShStream operator&(const ShStream& left, const ShChannel<T2>& right);
00104 
00107 template<typename T1>
00108 ShStream operator&(const ShChannel<T1>& left, const ShStream& right);
00109 
00112 SH_DLLEXPORT
00113 ShStream operator&(const ShStream& left, const ShStream& right);
00114 
00119 SH_DLLEXPORT
00120 ShProgram connect(const ShStream& stream, const ShProgram& program);
00121 
00124 SH_DLLEXPORT
00125 ShProgram operator<<(const ShProgram& program, const ShStream& stream);
00126 
00127 
00128 }
00129 
00130 #include "ShStreamImpl.hpp"
00131 
00132 #endif

Generated on Mon Jan 24 18:36:35 2005 for Sh by  doxygen 1.4.1