00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
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
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