mrfioc2  2.3.0
mrmtimesrc.h
Go to the documentation of this file.
1 /*************************************************************************\
2 * Copyright (c) 2016 Michael Davidsaver
3 * mrfioc2 is distributed subject to a Software License Agreement found
4 * in file LICENSE that is included with this distribution.
5 \*************************************************************************/
6 #ifndef MRMTIMESRC_H
7 #define MRMTIMESRC_H
8 
9 #include <string>
10 
11 #include <shareLib.h>
12 #include <epicsTypes.h>
13 
14 /* Handles sending shirt 0/1 events after the start of each second.
15  */
16 class epicsShareClass TimeStampSource
17 {
18  struct Impl;
19  Impl * const impl;
20 public:
21  explicit TimeStampSource(double period);
22  virtual ~TimeStampSource();
23 
25  void resyncSecond();
26 
28  void tickSecond();
29 
31  bool validSeconds() const;
32 
34  double deltaSeconds() const;
35 
37  void softSecondsSrc(bool enable);
38  bool isSoftSeconds() const;
39 
40  std::string nextSecond() const;
41 
42 protected:
43  virtual void setEvtCode(epicsUInt32 evtCode) =0;
44 
45  virtual void postSoftSecondsSrc() {tickSecond();}
46 
47 private:
49  TimeStampSource& operator=(const TimeStampSource&);
50 };
51 
52 #endif // MRMTIMESRC_H
virtual void postSoftSecondsSrc()
Definition: mrmtimesrc.h:45