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 2003-2005 Serious Hack Inc.
00004 // 
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00018 // MA  02110-1301, USA
00020 #ifndef SHSTREAM_HPP
00021 #define SHSTREAM_HPP
00022 
00023 #include <list>
00024 #include "ShDllExport.hpp"
00025 #include "ShChannel.hpp"
00026 #include "ShChannelNode.hpp"
00027 
00028 namespace SH {
00029 
00035 class
00036 SH_DLLEXPORT ShStream {
00037 public:
00038   typedef std::list<ShChannelNodePtr> NodeList;
00039   typedef NodeList::iterator iterator;
00040   typedef NodeList::const_iterator const_iterator;
00041 
00042   ShStream();
00043   ShStream(const ShChannelNodePtr& node);
00044   
00045   template<typename T>
00046   ShStream(const ShChannel<T>& channel);
00047 
00048   const_iterator begin() const;
00049   const_iterator end() const;
00050   iterator begin();
00051   iterator end();
00052   int size() const;
00053 
00054   template<typename T>
00055   void append(const ShChannel<T>& channel);
00056   template<typename T>
00057   void prepend(const ShChannel<T>& channel);
00058 
00059   void append(const ShChannelNodePtr& node);
00060   void prepend(const ShChannelNodePtr& node);
00061   // Execute fully bound stream program and place results in stream.
00062   ShStream& operator=(const ShProgram& program);
00063   
00064 private:
00065   NodeList m_nodes;
00066 };
00067 
00071 template<typename T1, typename T2>
00072 ShStream combine(const ShChannel<T1>& left, const ShChannel<T2>& right);
00073 
00078 template<typename T2>
00079 ShStream combine(const ShStream& left, const ShChannel<T2>& right);
00080 
00085 template<typename T1>
00086 ShStream combine(const ShChannel<T1>& left, const ShStream& right);
00087 
00088 SH_DLLEXPORT
00089 ShStream combine(const ShStream& left, const ShStream& right);
00090 
00093 template<typename T1, typename T2>
00094 ShStream operator&(const ShChannel<T1>& left, const ShChannel<T2>& right);
00095 
00098 template<typename T2>
00099 ShStream operator&(const ShStream& left, const ShChannel<T2>& right);
00100 
00103 template<typename T1>
00104 ShStream operator&(const ShChannel<T1>& left, const ShStream& right);
00105 
00108 SH_DLLEXPORT
00109 ShStream operator&(const ShStream& left, const ShStream& right);
00110 
00115 SH_DLLEXPORT
00116 ShProgram connect(const ShStream& stream, const ShProgram& program);
00117 
00120 SH_DLLEXPORT
00121 ShProgram operator<<(const ShProgram& program, const ShStream& stream);
00122 
00123 
00124 }
00125 
00126 #include "ShStreamImpl.hpp"
00127 
00128 #endif

Generated on Thu Jul 28 17:33:05 2005 for Sh by  doxygen 1.4.3-20050530