rllib  1
rlplc.h
Go to the documentation of this file.
1 /***************************************************************************
2  rlplc.h - description
3  -------------------
4  begin : Tue Dec 11 2008
5  copyright : (C) 2008 by R. Lehrig
6  email : lehrig@t-online.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
13  * published by the Free Software Foundation *
14  * *
15  ***************************************************************************/
16 #ifndef _RL_PLC_H_
17 #define _RL_PLC_H_
18 
19 #include "rldefine.h"
20 #include "rlsharedmemory.h"
21 
23 {
24  public:
25  rlPlcState(int numInt=100, int numFloat=100, int numDouble=0, const char *shared_memory=NULL);
26  virtual ~rlPlcState();
27  int *i, *i_old;
28  float *f, *f_old;
29  double *d, *d_old;
30  void clear();
31  void rememberState();
32  int intChanged(int index);
33  int floatChanged(int index);
34  int doubleChanged(int index);
35  int intHasIncreased(int index);
36  int floatHasIncreased(int index);
37  int doubleHasIncreased(int index);
38  int intHasDecreased(int index);
39  int floatHasDecreased(int index);
40  int doubleHasDecreased(int index);
41  int deltaInt(int index);
42  float deltaFloat(int index);
43  double deltaDouble(int index);
44  void set(int index, int bit);
45  void clear(int index, int bit);
46  int isSet(int index, int bit);
47  int isClear(int index, int bit);
48  int hasBeenSet(int index, int bit);
49  int hasBeenCleared(int index, int bit);
50  int maxInt();
51  int maxFloat();
52  int maxDouble();
53  int getInt(int index);
54  float getFloat(int index);
55  double getDouble(int index);
56  int getOldInt(int index);
57  float getOldFloat(int index);
58  double getOldDouble(int index);
60 
61  private:
63 };
64 
65 class rlPlcMem
66 {
67  public:
68  rlPlcMem();
69  virtual ~rlPlcMem();
70  int i, i_old;
71  float f, f_old;
72  double d, d_old;
73  void rememberState();
74  int intChanged();
75  int floatChanged();
76  int doubleChanged();
77  int intHasIncreased();
78  int floatHasIncreased();
79  int doubleHasIncreased();
80  int intHasDecreased();
81  int floatHasDecreased();
82  int doubleHasDecreased();
83  int deltaInt();
84  float deltaFloat();
85  double deltaDouble();
86  void set(int bit);
87  void clear(int bit);
88  int isSet(int bit);
89  int isClear(int bit);
90  int hasBeenSet(int bit);
91  int hasBeenCleared(int bit);
92 };
93 
94 #endif
95 
int doubleHasDecreased()
Definition: rlplc.cpp:347
rlPlcState(int numInt=100, int numFloat=100, int numDouble=0, const char *shared_memory=NULL)
Definition: rlplc.cpp:19
int getOldInt(int index)
Definition: rlplc.cpp:258
int i
Definition: rlplc.h:70
double deltaDouble()
Definition: rlplc.cpp:363
int doubleHasIncreased()
Definition: rlplc.cpp:329
double * d
Definition: rlplc.h:29
int maxFloat()
Definition: rlplc.cpp:230
virtual ~rlPlcState()
Definition: rlplc.cpp:62
double d
Definition: rlplc.h:72
int intChanged()
Definition: rlplc.cpp:299
int intChanged(int index)
Definition: rlplc.cpp:96
float deltaFloat(int index)
Definition: rlplc.cpp:165
int floatChanged(int index)
Definition: rlplc.cpp:103
float * f
Definition: rlplc.h:28
int doubleChanged(int index)
Definition: rlplc.cpp:110
float getFloat(int index)
Definition: rlplc.cpp:246
rlPlcMem()
Definition: rlplc.cpp:278
int doubleHasDecreased(int index)
Definition: rlplc.cpp:152
int i_old
Definition: rlplc.h:70
float getOldFloat(int index)
Definition: rlplc.cpp:264
int isSet(int index, int bit)
Definition: rlplc.cpp:189
int intHasIncreased()
Definition: rlplc.cpp:317
int max_int
Definition: rlplc.h:62
int hasBeenSet(int index, int bit)
Definition: rlplc.cpp:203
int floatChanged()
Definition: rlplc.cpp:305
int hasBeenSet(int bit)
Definition: rlplc.cpp:390
int floatHasDecreased(int index)
Definition: rlplc.cpp:145
int intHasDecreased(int index)
Definition: rlplc.cpp:138
int deltaInt()
Definition: rlplc.cpp:353
int intHasDecreased()
Definition: rlplc.cpp:335
void rememberState()
Definition: rlplc.cpp:89
int * i
Definition: rlplc.h:27
int maxInt()
Definition: rlplc.cpp:225
double getOldDouble(int index)
Definition: rlplc.cpp:270
void clear(int bit)
Definition: rlplc.cpp:373
int doubleHasIncreased(int index)
Definition: rlplc.cpp:131
void rememberState()
Definition: rlplc.cpp:292
double d_old
Definition: rlplc.h:72
void clear()
Definition: rlplc.cpp:79
int floatHasDecreased()
Definition: rlplc.cpp:341
double getDouble(int index)
Definition: rlplc.cpp:252
int maxDouble()
Definition: rlplc.cpp:235
rlSharedMemory * shm
Definition: rlplc.h:59
int max_double
Definition: rlplc.h:62
double deltaDouble(int index)
Definition: rlplc.cpp:171
int hasBeenCleared(int index, int bit)
Definition: rlplc.cpp:214
int floatHasIncreased()
Definition: rlplc.cpp:323
int max_float
Definition: rlplc.h:62
int floatHasIncreased(int index)
Definition: rlplc.cpp:124
int isClear(int index, int bit)
Definition: rlplc.cpp:196
int isSet(int bit)
Definition: rlplc.cpp:378
Definition: rlplc.h:65
int getInt(int index)
Definition: rlplc.cpp:240
int * i_old
Definition: rlplc.h:27
int intHasIncreased(int index)
Definition: rlplc.cpp:117
int isClear(int bit)
Definition: rlplc.cpp:384
int hasBeenCleared(int bit)
Definition: rlplc.cpp:400
int doubleChanged()
Definition: rlplc.cpp:311
double * d_old
Definition: rlplc.h:29
float f_old
Definition: rlplc.h:71
virtual ~rlPlcMem()
Definition: rlplc.cpp:288
float deltaFloat()
Definition: rlplc.cpp:358
float * f_old
Definition: rlplc.h:28
int deltaInt(int index)
Definition: rlplc.cpp:159
float f
Definition: rlplc.h:71