GLIP-Lib
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Component.hpp
Go to the documentation of this file.
1 /* ************************************************************************************************************* */
2 /* */
3 /* GLIP-LIB */
4 /* OpenGL Image Processing LIBrary */
5 /* */
6 /* Author : R. Kerviche */
7 /* LICENSE : MIT License */
8 /* Website : glip-lib.net */
9 /* */
10 /* File : Component.hpp */
11 /* Original Date : August 15th 2011 */
12 /* */
13 /* Description : Components of pipelines */
14 /* */
15 /* ************************************************************************************************************* */
16 
24 #ifndef __GLIP_COMPONENT_HPP__
25 #define __GLIP_COMPONENT_HPP__
26 
27  // Includes
28  #include <string>
29  #include <vector>
30  #include "Core/LibTools.hpp"
31 
32  namespace Glip
33  {
34  namespace CoreGL
35  {
36  class HdlTexture;
37  }
38 
39  using namespace CoreGL;
40 
41  namespace CorePipeline
42  {
43  // Prototypes
44  class ComponentLayout;
45 
46  // Objects
51  class GLIP_API AbstractComponentLayout
52  {
53  private :
54  // Data
55  std::string layoutName;
56  std::vector<std::string> inputPorts;
57  std::vector<std::string> outputPorts;
58 
59  friend class ComponentLayout;
60 
61  protected :
62  // Tools
63  AbstractComponentLayout(const std::string& _layoutName);
64  AbstractComponentLayout(const std::string& _layoutName, const std::vector<std::string>& _inputPorts, const std::vector<std::string>& _outputPorts);
65 
66  public :
67  // Tools
69  virtual ~AbstractComponentLayout(void);
70 
71  void checkInputPort(int i) const;
72  void checkOutputPort(int i) const;
73  virtual std::string getFullName(void) const;
74  const std::string& getLayoutName(void) const;
75  int getNumInputPort(void) const;
76  const std::string& getInputPortName(int i) const;
77  int getInputPortID(const std::string& name) const;
78  bool doesInputPortExist(const std::string& name) const;
79  int getNumOutputPort(void) const;
80  const std::string& getOutputPortName(int i) const;
81  int getOutputPortID(const std::string& name) const;
82  bool doesOutputPortExist(const std::string& name) const;
83  };
84 
89  class GLIP_API ComponentLayout : virtual public AbstractComponentLayout
90  {
91  protected :
92  // Tools
93  int addOutputPort(const std::string& name);
94  int addInputPort(const std::string& name);
95 
96  public :
97  // Tools
98  ComponentLayout(const std::string& _layoutName);
100  virtual ~ComponentLayout(void);
101 
102  void setInputPortName(int i, const std::string& newName);
103  void setOutputPortName(int i, const std::string& newName);
104  };
105 
110  class GLIP_API Component : virtual public AbstractComponentLayout
111  {
112  private :
113  std::string instanceName;
114 
115  protected :
116  // Tools
117  Component(const std::string& _layoutName, const std::vector<std::string>& _inputPorts, const std::vector<std::string>& _outputPorts, const std::string& _instanceName);
118  Component(const AbstractComponentLayout&, const std::string& _instanceName);
119 
120  public :
121  virtual ~Component(void);
122 
123  std::string getFullName(void) const;
124  const std::string& getName(void) const;
125  };
126  }
127  }
128 
129 #endif
Layout of a component template.
Definition: Component.hpp:89
Specific defines for the API structure.
Definition: Component.hpp:32
Element of a pipeline.
Definition: Component.hpp:110
Layout of a component template (Read Only)
Definition: Component.hpp:51