EPICS ARCHIVER V4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups
ScanList.h
1 #ifndef __SCANLIST_H__
2 #define __SCANLIST_H__
3 
4 // epics
5 #include <epicsTime.h>
6 
7 // tools
8 #include "tools/ConcurrentList.h"
9 
10 // engine
11 #include "engine/Named.h"
12 
22 class Scannable : public virtual Named {
23 
24 public:
31  virtual void scan(const epicsTime &now) = 0;
32 };
33 
43 class ScanList
44 {
45 public:
46  ScanList();
47  ~ScanList();
48 
53  void add(Scannable *item, double period);
54 
56  bool isDueAtAll()
57  { return ! lists.isEmpty(); }
58 
60  const epicsTime &getDueTime();
61 
63  void remove(Scannable *item);
64 
66  void scan(const epicsTime &deadline);
67 
69  void dump();
70 
71 private:
73  epicsTime next_list_scan;
74 };
75 
76 #endif //__SCANLIST_H__
void add(Scannable *item, double period)
Add an item to the scan list.
virtual void scan(const epicsTime &now)=0
Invoked whenever a scan is due.
const epicsTime & getDueTime()
When should scan() be called ?
Abstract base for a named thingy, does not actually contain the name.
Definition: Named.h:15
void scan(const epicsTime &deadline)
Scan all channels that are due at/before deadline.
bool isDueAtAll()
Does the scan list contain anyting?
Definition: ScanList.h:56
bool isEmpty()
Definition: ConcurrentList.h:150
Interface for something that can be placed on a ScanList.
Definition: ScanList.h:22
void dump()
Dump.
A ScanList keeps track of Scannable items.
Definition: ScanList.h:43