00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00024 #ifndef SHSTREAM_HPP
00025 #define SHSTREAM_HPP
00026
00027 #include <list>
00028 #include "ShDllExport.hpp"
00029 #include "ShChannel.hpp"
00030 #include "ShChannelNode.hpp"
00031
00032 namespace SH {
00033
00039 class
00040 SH_DLLEXPORT ShStream {
00041 public:
00042 typedef std::list<ShChannelNodePtr> NodeList;
00043 typedef NodeList::iterator iterator;
00044 typedef NodeList::const_iterator const_iterator;
00045
00046 ShStream();
00047 ShStream(const ShChannelNodePtr& node);
00048
00049 template<typename T>
00050 ShStream(const ShChannel<T>& channel);
00051
00052 const_iterator begin() const;
00053 const_iterator end() const;
00054 iterator begin();
00055 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
00066 ShStream& operator=(const ShProgram& program);
00067
00068 private:
00069 NodeList 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