CARMA C++
sza::util::MonitorCondition Class Reference

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

#include <carma/szautil/MonitorCondition.h>

Public Member Functions

void checkPacketCount (unsigned packetCount, unsigned stablePacketCount, unsigned giveUpPacketCount)
 Check the packet count to see if it makes sense. More...
 
std::string format (std::string &reg)
 Format this condition. More...
 
bool isDelta ()
 
bool isSatisfiedBy (sza::util::DataType &dataType)
 
double max ()
 
double min ()
 
 MonitorCondition (unsigned packetCount=defaultPacketCount_, unsigned stablePacketCount=defaultStablePacketCount_, unsigned giveUpPacketCount=defaultGiveUpPacketCount_)
 Constructor for no condition. More...
 
 MonitorCondition (sza::util::DataTypeTruthFn fn, sza::util::DataType op1, bool delta=false, unsigned packetCount=defaultPacketCount_, unsigned stablePacketCount=defaultStablePacketCount_, unsigned giveUpPacketCount=defaultGiveUpPacketCount_)
 Constructor for a single-valued condition. More...
 
 MonitorCondition (sza::util::DataTypeTruthFn fn, sza::util::DataType op1, sza::util::DataType op2, bool delta=false, unsigned packetCount=defaultPacketCount_, unsigned stablePacketCount=defaultStablePacketCount_, unsigned giveUpPacketCount=defaultGiveUpPacketCount_)
 Constructor for a dual-valued condition. More...
 
unsigned nFrame ()
 
void operator= (const MonitorCondition &condition)
 
void setTo (unsigned packetCount=defaultPacketCount_, unsigned stablePacketCount=defaultStablePacketCount_, unsigned giveUpPacketCount=defaultGiveUpPacketCount_)
 
void setTo (sza::util::DataTypeTruthFn fn, sza::util::DataType op1, bool delta=false, unsigned packetCount=defaultPacketCount_, unsigned stablePacketCount=defaultStablePacketCount_, unsigned giveUpPacketCount=defaultGiveUpPacketCount_)
 
void setTo (sza::util::DataTypeTruthFn fn, sza::util::DataType op1, sza::util::DataType op2, bool delta=false, unsigned packetCount=defaultPacketCount_, unsigned stablePacketCount=defaultStablePacketCount_, unsigned giveUpPacketCount=defaultGiveUpPacketCount_)
 
virtual ~MonitorCondition ()
 Destructor. More...
 

Public Attributes

bool first_
 
sza::util::DataTypeTruthFn fn_
 
unsigned giveUpPacketCount_
 
bool isDeltaCondition_
 
sza::util::DataType last_
 
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 20 of file MonitorCondition.h.

Constructor & Destructor Documentation

sza::util::MonitorCondition::MonitorCondition ( unsigned  packetCount = defaultPacketCount_,
unsigned  stablePacketCount = defaultStablePacketCount_,
unsigned  giveUpPacketCount = defaultGiveUpPacketCount_ 
)

Constructor for no condition.

Matches any condition.

sza::util::MonitorCondition::MonitorCondition ( sza::util::DataTypeTruthFn  fn,
sza::util::DataType  op1,
bool  delta = false,
unsigned  packetCount = defaultPacketCount_,
unsigned  stablePacketCount = defaultStablePacketCount_,
unsigned  giveUpPacketCount = defaultGiveUpPacketCount_ 
)

Constructor for a single-valued condition.

Parameters
opoperator to check with
deltaIf true, check the delta of this value
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::util::MonitorCondition::MonitorCondition ( sza::util::DataTypeTruthFn  fn,
sza::util::DataType  op1,
sza::util::DataType  op2,
bool  delta = false,
unsigned  packetCount = defaultPacketCount_,
unsigned  stablePacketCount = defaultStablePacketCount_,
unsigned  giveUpPacketCount = defaultGiveUpPacketCount_ 
)

Constructor for a dual-valued condition.

virtual sza::util::MonitorCondition::~MonitorCondition ( )
virtual

Destructor.

Member Function Documentation

void sza::util::MonitorCondition::checkPacketCount ( unsigned  packetCount,
unsigned  stablePacketCount,
unsigned  giveUpPacketCount 
)

Check the packet count to see if it makes sense.

std::string sza::util::MonitorCondition::format ( std::string &  reg)

Format this condition.


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