00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00027 #ifndef SHFIXEDMANIPULATOR_HPP
00028 #define SHFIXEDMANIPULATOR_HPP
00029
00030 #include <vector>
00031 #include "ShDllExport.hpp"
00032 #include "ShProgram.hpp"
00033
00034 namespace SH {
00035
00036 typedef ShProgramNode::VarList::const_iterator ShManipVarIterator;
00037
00043 class
00044 SH_DLLEXPORT ShFixedManipulatorNode: public ShRefCountable {
00045 public:
00046 ShFixedManipulatorNode();
00047 virtual ~ShFixedManipulatorNode();
00048
00054 virtual ShProgram applyToInputs(ShManipVarIterator &finger, ShManipVarIterator end) const = 0;
00055
00061 virtual ShProgram applyToOutputs(ShManipVarIterator &finger, ShManipVarIterator end) const = 0;
00062 };
00063 typedef ShPointer<ShFixedManipulatorNode> ShFixedManipulator;
00064
00065 class
00066 SH_DLLEXPORT ShKeepNode: public ShFixedManipulatorNode {
00067 public:
00068 ShKeepNode(int numChannels);
00069 ShProgram applyToInputs(ShManipVarIterator &finger, ShManipVarIterator end) const;
00070 ShProgram applyToOutputs(ShManipVarIterator &finger, ShManipVarIterator end) const;
00071
00072 private:
00073 int m_numChannels;
00074 };
00075 SH_DLLEXPORT
00076 ShFixedManipulator shKeep(int numChannels = 1);
00077
00078 class
00079 SH_DLLEXPORT ShLoseNode: public ShFixedManipulatorNode {
00080 public:
00081 ShLoseNode(int numChannels);
00082 ShProgram applyToInputs(ShManipVarIterator &finger, ShManipVarIterator end) const;
00083 ShProgram applyToOutputs(ShManipVarIterator &finger, ShManipVarIterator end) const;
00084
00085 private:
00086 int m_numChannels;
00087 };
00088 SH_DLLEXPORT
00089 ShFixedManipulator shLose(int numChannels = 1);
00090
00091 class
00092 SH_DLLEXPORT ShDupNode: public ShFixedManipulatorNode {
00093 public:
00094 ShDupNode(int numDups);
00095 ShProgram applyToInputs(ShManipVarIterator &finger, ShManipVarIterator end) const;
00096 ShProgram applyToOutputs(ShManipVarIterator &finger, ShManipVarIterator end) const;
00097
00098 private:
00099 int m_numDups;
00100 };
00101 SH_DLLEXPORT
00102 ShFixedManipulator shDup(int numDups = 2);
00103
00104
00105
00106
00107
00108
00109
00110
00111 class
00112 SH_DLLEXPORT ShProgramManipNode: public ShFixedManipulatorNode {
00113 public:
00114 ShProgram applyToInputs(ShManipVarIterator &finger, ShManipVarIterator end) const;
00115 ShProgram applyToOutputs(ShManipVarIterator &finger, ShManipVarIterator end) const;
00116
00117 private:
00118 ShProgram p;
00119
00120 ShProgramManipNode(const ShProgram &p);
00121
00122 friend SH_DLLEXPORT
00123 ShFixedManipulator operator&(const ShFixedManipulator &m, const ShProgram &p );
00124 friend SH_DLLEXPORT
00125 ShFixedManipulator operator&( const ShProgram &p, const ShFixedManipulator &m);
00126 };
00127
00128
00129 class ShTreeManipNode: public ShFixedManipulatorNode {
00130 public:
00131 ShProgram applyToInputs(ShManipVarIterator &finger, ShManipVarIterator end) const;
00132 ShProgram applyToOutputs(ShManipVarIterator &finger, ShManipVarIterator end) const;
00133 private:
00134 ShFixedManipulator a, b;
00135
00136 ShTreeManipNode(const ShFixedManipulator &a, const ShFixedManipulator &b);
00137
00138 friend SH_DLLEXPORT
00139
00140 ShFixedManipulator operator&(const ShFixedManipulator &m, const ShFixedManipulator &n);
00141 };
00142
00143 SH_DLLEXPORT
00144 ShProgram operator<<(const ShProgram &p, const ShFixedManipulator &m);
00145 SH_DLLEXPORT
00146 ShProgram operator<<(const ShFixedManipulator &m, const ShProgram &p);
00147 SH_DLLEXPORT
00148 ShFixedManipulator operator&(const ShFixedManipulator &m,
00149 const ShFixedManipulator &n);
00150 SH_DLLEXPORT
00151 ShFixedManipulator operator&(const ShFixedManipulator &m,
00152 const ShProgram &p );
00153 SH_DLLEXPORT
00154 ShFixedManipulator operator&(const ShProgram &p,
00155 const ShFixedManipulator &m);
00156
00157 }
00158
00159 #endif