CLAM-Development  1.4.0
InControlBase.hxx
Go to the documentation of this file.
1 #ifndef InControlBase_hxx
2 #define InControlBase_hxx
3 
4 #include <string>
5 #include <list>
6 #include <typeinfo>
7 
8 namespace CLAM {
9  class Processing;
11 
13  typedef float TControlData;
14 
23  {
24  std::string mName;
25  protected:
27  typedef std::list<OutControlBase*> Peers;
33  bool mBounded;
35  mutable bool _hasBeenRead;
36  private:
38  InControlBase(const InControlBase & toBeCopied ) {}
39  public:
40  bool HasBeenRead() const { return _hasBeenRead; }
46  InControlBase(const std::string &name, Processing * processing = 0);
52  virtual ~InControlBase();
62  virtual const std::type_info& GetTypeId() const = 0;
64  const std::string& GetName() const { return mName; }
66  Processing * GetProcessing() const { return mProcessing; }
68  bool IsConnected() const { return not mLinks.empty(); }
70  bool IsConnectedTo(OutControlBase & out);
71 
75  //{@
76  bool IsBounded() const;
77  TControlData UpperBound() const;
78  TControlData LowerBound() const;
80  TControlData DefaultValue() const;
81  void SetDefaultValue(TControlData val);
82  void SetBounds(TControlData lower, TControlData upper);
84 
87  {
88  mLinks.push_back(&outControl);
89  }
92  {
93  mLinks.remove(&outControl);
94  }
95  virtual const std::string GetLastValueAsString ()
96  {
97  return "Non printable type";
98  }
99  };
100 } // End namespace CLAM
101 #endif // InControlBase_hxx