OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
ConstChannel.h
Go to the documentation of this file.
1 #ifndef CLASSIC_ConstChannel_HH
2 #define CLASSIC_ConstChannel_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: ConstChannel.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: ConstChannel
13 //
14 // ------------------------------------------------------------------------
15 // Class category: Channels
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:35 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
23 
24 // Class ConstChannel
25 // ------------------------------------------------------------------------
27 // Class ConstChannel allows access to an arbitrary [b]double[/b] value.
28 
29 class ConstChannel {
30 
31 public:
32 
33  ConstChannel();
34  virtual ~ConstChannel();
35 
37  virtual ConstChannel *clone() const = 0;
38 
40  // If the channel can be read, set [b]value[/b] and return true,
41  // otherwise return false.
42  virtual bool get(double &value) const = 0;
43 
45  // Return the value read from the channel.
46  operator double() const
47  { double value = 0.0; get(value); return value; }
48 
50  // Return false for this class (channel cannot be set).
51  virtual bool isSettable() const;
52 
53 private:
54 
55  // Not implemented.
56  ConstChannel(const ConstChannel &);
57  const ConstChannel &operator=(const ConstChannel &);
58 };
59 
60 #endif // CLASSIC_ConstChannel_HH
Abstract interface for read-only access to variable.
Definition: ConstChannel.h:29
virtual ~ConstChannel()
const ConstChannel & operator=(const ConstChannel &)
virtual ConstChannel * clone() const =0
Duplicate the channel.
virtual bool isSettable() const
Check if settable.