NAME
Oorb::TooNewFilter, Oorb::UnstuffFilter - Filter classes for the oorb library
SYNOPSIS
-loorb $(ORBLIBS)
#include "oorb.h"
namespace Oorb
class EndtimeFilter
class TooNewFilter
class TooOldFilter
class UnstuffFilter
DESCRIPTION
This man-page describes sub-classes of the
Oorb::Filter(3) class.
For details on each filter, see the constructor descriptions below.
CONSTRUCTORS
-
EndtimeFilter( double endtime, int lastPktidOnOrbAtStart, bool& acquiredLastPacket );
This constructor creates a filter which ends acquisition at a specified endtime. If endtime
is EPOCHTIME_NULL, the EndtimeFilter does nothing. If endtime is a standard Unix epoch time,
acquisition is stopped as soon as a packet is received with timestamp that is greater than or equal to the
specified endtime. The EndtimeFilter stops acquisition by setting the boolean reference
acquiredLastPacket to true, which the calling program should monitor (taking action to shut down
the thread when set to true). If endtime is set to EPOCHTIME_LAST, the EndtimeFilter
watches for a packet with packet-id equal to the given lastPktidOnOrbAtStart, which should be
set by the calling program.
-
TooNewFilter( double too_new, std::shared_ptr<StatusVector> statusVector );
This constructor creates a filter which accepts packets that are not too new, as judged by comparing the
input value too_new (specified in seconds) to the difference between the packet-timestamp and system clock.
Normally, too_new should be specified as a positive number. A negative value of too_new will place
the acquisition cutoff to a point older than the current system-clock. If too_new is EPOCHTIME_NULL,
the TooNewFilter lets all packets through. If the Oorb::Filter(3)'s m_statusVector
is non-null, the TooNewFilter updates the state vector's nrejects_new_24h variable.
-
TooOldFilter( double too_old, std::shared_ptr<StatusVector> statusVector );
This constructor creates a filter which accepts packets that are not too old, as judged by comparing the
input value too_old (specified in seconds) to the difference between the packet-timestamp and system clock.
The too_old value should be specified as a positive number. If too_old is EPOCHTIME_NULL,
the TooOldFilter lets all packets through. If the Oorb::Filter(3)'s m_statusVector
is non-null, the TooOldFilter updates the state vector's nrejects_old_24h variable.
-
UnstuffFilter( bool suppress_unstuff_errors, std::shared_ptr<StatusVector> statusVector );
This constructor creates a filter which accepts packets that properly unstuff via the unstuffPkt(3)
command, and rejects those which do not. If the boolean suppress_unstuff_errors is true,
error messages from unstuff failures are suppressed. If the Oorb::Filter(3)'s m_statusVector
is non-null, the UnstuffFilter updates the state vector's nrejects_unstuff_24h variable.
METHODS
-
std::shared_ptr<OrbPacket> filter( std::shared_ptr<OrbPacket> op );
The filter method for each of these classes should be called on every packet op of interest.
If a packet is rejected, filter will return a nullptr. Otherwise, filter will
return a std::shared_ptr to the accepted or possibly-transformed Oorb::OrbPacket(3).
LIBRARY
-loorb $(ORBLIBS)
ATTRIBUTES
MT-Safe
SEE ALSO
Oorb(3), OorbFilter(3)
BUGS AND CAVEATS
There is no prohibition on using negative numbers for the
too_old and
too_new. Setting these
values to negative numbers may be helpful in rare cases of diagnosing problems and/or supporting (very) uncommon
operational setups.
AUTHOR
Kent Lindquist