CLAM-Development  1.4.0
InControlPublisher.hxx
Go to the documentation of this file.
1 #ifndef _INCONTROL_PUBLISHER_HXX_
2 #define _INCONTROL_PUBLISHER_HXX_
3 
4 #include "InControl.hxx"
5 #include <string>
6 
7 // TODO: Refactoring...
8 // Extract common interface from InControlPublisher, InControl and create a common base class
9 namespace CLAM
10 {
12 {
13  FloatInControl* mPublished; //TODO should be a list, in the future
14 
15 public:
17  : FloatInControl( "InControlPublisher", 0 )
18  {
19  mPublished=NULL;
20  }
21 
22  InControlPublisher( const std::string& name, Processing* father )
23  : FloatInControl( name, father )
24  {
25  mPublished=NULL;
26  }
27 
29  {
30  mPublished = &in;
31  }
32  void DoControl(const TControlData & val)
33  {
34  if(mPublished)
35  mPublished->DoControl(val);
36  else
38  }
39  const TControlData& GetLastValue() const
40  {
41  if(mPublished)
42  return mPublished->GetLastValue();
43  return mLastValue;
44  }
45 
46 };
47 
48 } // namespace CLAM
49 
50 #endif
51