OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Channel.h
Go to the documentation of this file.
1#ifndef OPALX_Channel_HH
2#define OPALX_Channel_HH
3
4// ------------------------------------------------------------------------
5// $RCSfile: Channel.h,v $
6// ------------------------------------------------------------------------
7// $Revision: 1.1.1.1 $
8// ------------------------------------------------------------------------
9// Copyright: see Copyright.readme
10// ------------------------------------------------------------------------
11//
12// Class: Channel
13//
14// ------------------------------------------------------------------------
15// Class category: Channels
16// ------------------------------------------------------------------------
17//
18// $Date: 2000/03/27 09:32:35 $
19// $Author: fci $
20//
21// ------------------------------------------------------------------------
22
24
25// Class Channel
26// ------------------------------------------------------------------------
28// Class Channel allows access to an arbitrary [b]double[/b] value.
29
30class Channel : public ConstChannel {
31public:
32 Channel();
33 virtual ~Channel();
34
36 virtual Channel* clone() const = 0;
37
39 double operator=(double value) {
40 set(value);
41 return value;
42 }
43
45 double operator+=(double value) {
46 double temp;
47 get(temp);
48 temp += value;
49 set(temp);
50 return temp;
51 }
52
54 double operator-=(double value) {
55 double temp;
56 get(temp);
57 temp -= value;
58 set(temp);
59 return temp;
60 }
61
63 // If the channel can be written,
64 // store [b]value[/b] into it and return true,
65 // otherwise return false.
66 virtual bool set(double value) = 0;
67
69 // Return true, if the channel can receive values.
70 virtual bool isSettable() const;
71
72private:
73 // Not implemented.
75 const Channel& operator=(const Channel&);
76};
77
78#endif // OPALX_Channel_HH
Abstract interface for read/write access to variable.
Definition Channel.h:30
virtual Channel * clone() const =0
Duplicate the channel.
const Channel & operator=(const Channel &)
double operator=(double value)
Assign [b]value[/b] to channel.
Definition Channel.h:39
virtual ~Channel()
Definition Channel.cpp:28
virtual bool set(double value)=0
Store [b]value[/b] into channel.
virtual bool isSettable() const
Test if settable.
Definition Channel.cpp:30
double operator-=(double value)
Subtract and assign [b]value[/b] to channel.
Definition Channel.h:54
Channel(const Channel &)
Channel()
Definition Channel.cpp:26
double operator+=(double value)
Add and assign [b]value[/b] to channel.
Definition Channel.h:45
Abstract interface for read-only access to variable.
virtual bool get(double &value) const =0
Read channel.