CARMA C++
sza::antenna::canbus::CanMonitorCondition Class Reference

A class for handling a condition for a monitor point. More...

#include <carma/antenna/sza/antenna/canbus/CanMonitorCondition.h>

Public Member Functions

 CanMonitorCondition (unsigned packetCount=defaultPacketCount_, unsigned stablePacketCount=defaultStablePacketCount_, unsigned giveUpPacketCount=defaultGiveUpPacketCount_)
 Constructor for no condition. More...
 
 CanMonitorCondition (sza::util::DataTypeTruthFn fn, sza::util::DataType op1, unsigned packetCount=defaultPacketCount_, unsigned stablePacketCount=defaultStablePacketCount_, unsigned giveUpPacketCount=defaultGiveUpPacketCount_)
 Constructor for a single-valued condition. More...
 
 CanMonitorCondition (sza::util::DataTypeTruthFn fn, sza::util::DataType op1, sza::util::DataType op2, unsigned packetCount=defaultPacketCount_, unsigned stablePacketCount=defaultStablePacketCount_, unsigned giveUpPacketCount=defaultGiveUpPacketCount_)
 Constructor for a dual-valued condition. More...
 
void checkPacketCount (unsigned packetCount, unsigned stablePacketCount, unsigned giveUpPacketCount)
 Check the packet count to see if it makes sense. More...
 
bool isSatisfiedBy (sza::util::DataType &dataType)
 
void operator= (const CanMonitorCondition &condition)
 
void setTo (unsigned packetCount=defaultPacketCount_, unsigned stablePacketCount=defaultStablePacketCount_, unsigned giveUpPacketCount=defaultGiveUpPacketCount_)
 
void setTo (sza::util::DataTypeTruthFn fn, sza::util::DataType op1, unsigned packetCount=defaultPacketCount_, unsigned stablePacketCount=defaultStablePacketCount_, unsigned giveUpPacketCount=defaultGiveUpPacketCount_)
 
void setTo (sza::util::DataTypeTruthFn fn, sza::util::DataType op1, sza::util::DataType op2, unsigned packetCount=defaultPacketCount_, unsigned stablePacketCount=defaultStablePacketCount_, unsigned giveUpPacketCount=defaultGiveUpPacketCount_)
 
virtual ~CanMonitorCondition ()
 Destructor. More...
 

Public Attributes

sza::util::DataTypeTruthFn fn_
 
unsigned giveUpPacketCount_
 
sza::util::DataType op1_
 
sza::util::DataType op2_
 
unsigned packetCount_
 
unsigned stablePacketCount_
 

Static Public Attributes

static const unsigned defaultGiveUpPacketCount_ = 20
 
static const unsigned defaultPacketCount_ = 1
 
static const unsigned defaultStablePacketCount_ = 0
 

Detailed Description

A class for handling a condition for a monitor point.

Definition at line 21 of file CanMonitorCondition.h.

Constructor & Destructor Documentation

sza::antenna::canbus::CanMonitorCondition::CanMonitorCondition ( unsigned  packetCount = defaultPacketCount_,
unsigned  stablePacketCount = defaultStablePacketCount_,
unsigned  giveUpPacketCount = defaultGiveUpPacketCount_ 
)

Constructor for no condition.

Matches any condition.

sza::antenna::canbus::CanMonitorCondition::CanMonitorCondition ( sza::util::DataTypeTruthFn  fn,
sza::util::DataType  op1,
unsigned  packetCount = defaultPacketCount_,
unsigned  stablePacketCount = defaultStablePacketCount_,
unsigned  giveUpPacketCount = defaultGiveUpPacketCount_ 
)

Constructor for a single-valued condition.

Parameters
opoperator to check with
valvalue to check
packetCountstart checking when the packet count after issuing this condition reaches this count.
stablePacketCountAfter we start checking, the condition must hold true for this many consecutive packets before we will report it as true
giveUpPacketCountIf the condition has not become true this many packets after we start checking, give up (0 == keep trying forever)
sza::antenna::canbus::CanMonitorCondition::CanMonitorCondition ( sza::util::DataTypeTruthFn  fn,
sza::util::DataType  op1,
sza::util::DataType  op2,
unsigned  packetCount = defaultPacketCount_,
unsigned  stablePacketCount = defaultStablePacketCount_,
unsigned  giveUpPacketCount = defaultGiveUpPacketCount_ 
)

Constructor for a dual-valued condition.

virtual sza::antenna::canbus::CanMonitorCondition::~CanMonitorCondition ( )
virtual

Destructor.

Member Function Documentation

void sza::antenna::canbus::CanMonitorCondition::checkPacketCount ( unsigned  packetCount,
unsigned  stablePacketCount,
unsigned  giveUpPacketCount 
)

Check the packet count to see if it makes sense.


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