rllib  1
Public Member Functions | Public Attributes | List of all members
rlPlcMem Class Reference

#include <rlplc.h>

Public Member Functions

 rlPlcMem ()
 
virtual ~rlPlcMem ()
 
void rememberState ()
 
int intChanged ()
 
int floatChanged ()
 
int doubleChanged ()
 
int intHasIncreased ()
 
int floatHasIncreased ()
 
int doubleHasIncreased ()
 
int intHasDecreased ()
 
int floatHasDecreased ()
 
int doubleHasDecreased ()
 
int deltaInt ()
 
float deltaFloat ()
 
double deltaDouble ()
 
void set (int bit)
 
void clear (int bit)
 
int isSet (int bit)
 
int isClear (int bit)
 
int hasBeenSet (int bit)
 
int hasBeenCleared (int bit)
 

Public Attributes

int i
 
int i_old
 
float f
 
float f_old
 
double d
 
double d_old
 

Detailed Description

Definition at line 65 of file rlplc.h.

Constructor & Destructor Documentation

◆ rlPlcMem()

rlPlcMem::rlPlcMem ( )

Definition at line 278 of file rlplc.cpp.

279 {
280  i = 0;
281  i_old = 0;
282  f = 0.0f;
283  f_old = 0.0f;
284  d = 0.0;
285  d_old = 0.0;
286 }
int i
Definition: rlplc.h:70
double d
Definition: rlplc.h:72
int i_old
Definition: rlplc.h:70
double d_old
Definition: rlplc.h:72
float f_old
Definition: rlplc.h:71
float f
Definition: rlplc.h:71

◆ ~rlPlcMem()

rlPlcMem::~rlPlcMem ( )
virtual

Definition at line 288 of file rlplc.cpp.

289 {
290 }

Member Function Documentation

◆ clear()

void rlPlcMem::clear ( int  bit)

Definition at line 373 of file rlplc.cpp.

374 {
375  i = i & ~bit;
376 }
int i
Definition: rlplc.h:70

◆ deltaDouble()

double rlPlcMem::deltaDouble ( )

Definition at line 363 of file rlplc.cpp.

364 {
365  return d - d_old;
366 }
double d
Definition: rlplc.h:72
double d_old
Definition: rlplc.h:72

◆ deltaFloat()

float rlPlcMem::deltaFloat ( )

Definition at line 358 of file rlplc.cpp.

359 {
360  return f - f_old;
361 }
float f_old
Definition: rlplc.h:71
float f
Definition: rlplc.h:71

◆ deltaInt()

int rlPlcMem::deltaInt ( )

Definition at line 353 of file rlplc.cpp.

354 {
355  return i - i_old;
356 }
int i
Definition: rlplc.h:70
int i_old
Definition: rlplc.h:70

◆ doubleChanged()

int rlPlcMem::doubleChanged ( )

Definition at line 311 of file rlplc.cpp.

312 {
313  if(d == d_old) return 0;
314  else return 1;
315 }
double d
Definition: rlplc.h:72
double d_old
Definition: rlplc.h:72

◆ doubleHasDecreased()

int rlPlcMem::doubleHasDecreased ( )

Definition at line 347 of file rlplc.cpp.

348 {
349  if(d < d_old) return 1;
350  else return 0;
351 }
double d
Definition: rlplc.h:72
double d_old
Definition: rlplc.h:72

◆ doubleHasIncreased()

int rlPlcMem::doubleHasIncreased ( )

Definition at line 329 of file rlplc.cpp.

330 {
331  if(d > d_old) return 1;
332  else return 0;
333 }
double d
Definition: rlplc.h:72
double d_old
Definition: rlplc.h:72

◆ floatChanged()

int rlPlcMem::floatChanged ( )

Definition at line 305 of file rlplc.cpp.

306 {
307  if(f == f_old) return 0;
308  else return 1;
309 }
float f_old
Definition: rlplc.h:71
float f
Definition: rlplc.h:71

◆ floatHasDecreased()

int rlPlcMem::floatHasDecreased ( )

Definition at line 341 of file rlplc.cpp.

342 {
343  if(f < f_old) return 1;
344  else return 0;
345 }
float f_old
Definition: rlplc.h:71
float f
Definition: rlplc.h:71

◆ floatHasIncreased()

int rlPlcMem::floatHasIncreased ( )

Definition at line 323 of file rlplc.cpp.

324 {
325  if(f > f_old) return 1;
326  else return 0;
327 }
float f_old
Definition: rlplc.h:71
float f
Definition: rlplc.h:71

◆ hasBeenCleared()

int rlPlcMem::hasBeenCleared ( int  bit)

Definition at line 400 of file rlplc.cpp.

401 {
402  if((i & bit) == 0) // is bit clear ?
403  {
404  if((i_old & bit) == 0) return 0; // both are clear
405  else return 1; // old one was set
406  }
407  return 0;
408 }
int i
Definition: rlplc.h:70
int i_old
Definition: rlplc.h:70

◆ hasBeenSet()

int rlPlcMem::hasBeenSet ( int  bit)

Definition at line 390 of file rlplc.cpp.

391 {
392  if(i & bit) // is bit set ?
393  {
394  if(i_old & bit) return 0; // both are set
395  else return 1; // old one was not set
396  }
397  return 0;
398 }
int i
Definition: rlplc.h:70
int i_old
Definition: rlplc.h:70

◆ intChanged()

int rlPlcMem::intChanged ( )

Definition at line 299 of file rlplc.cpp.

300 {
301  if(i == i_old) return 0;
302  else return 1;
303 }
int i
Definition: rlplc.h:70
int i_old
Definition: rlplc.h:70

◆ intHasDecreased()

int rlPlcMem::intHasDecreased ( )

Definition at line 335 of file rlplc.cpp.

336 {
337  if(i < i_old) return 1;
338  else return 0;
339 }
int i
Definition: rlplc.h:70
int i_old
Definition: rlplc.h:70

◆ intHasIncreased()

int rlPlcMem::intHasIncreased ( )

Definition at line 317 of file rlplc.cpp.

318 {
319  if(i > i_old) return 1;
320  else return 0;
321 }
int i
Definition: rlplc.h:70
int i_old
Definition: rlplc.h:70

◆ isClear()

int rlPlcMem::isClear ( int  bit)

Definition at line 384 of file rlplc.cpp.

385 {
386  if(i & bit) return 0;
387  else return 1;
388 }
int i
Definition: rlplc.h:70

◆ isSet()

int rlPlcMem::isSet ( int  bit)

Definition at line 378 of file rlplc.cpp.

379 {
380  if(i & bit) return 1;
381  else return 0;
382 }
int i
Definition: rlplc.h:70

◆ rememberState()

void rlPlcMem::rememberState ( )

Definition at line 292 of file rlplc.cpp.

293 {
294  i_old = i;
295  f_old = f;
296  d_old = d;
297 }
int i
Definition: rlplc.h:70
double d
Definition: rlplc.h:72
int i_old
Definition: rlplc.h:70
double d_old
Definition: rlplc.h:72
float f_old
Definition: rlplc.h:71
float f
Definition: rlplc.h:71

◆ set()

void rlPlcMem::set ( int  bit)

Definition at line 368 of file rlplc.cpp.

369 {
370  i = i | bit;
371 }
int i
Definition: rlplc.h:70

Member Data Documentation

◆ d

double rlPlcMem::d

Definition at line 72 of file rlplc.h.

◆ d_old

double rlPlcMem::d_old

Definition at line 72 of file rlplc.h.

◆ f

float rlPlcMem::f

Definition at line 71 of file rlplc.h.

◆ f_old

float rlPlcMem::f_old

Definition at line 71 of file rlplc.h.

◆ i

int rlPlcMem::i

Definition at line 70 of file rlplc.h.

◆ i_old

int rlPlcMem::i_old

Definition at line 70 of file rlplc.h.


The documentation for this class was generated from the following files: