NAME
Oorb::OrbPacket - orb-packet class for the oorb library
SYNOPSIS
-loorb $(ORBLIBS)
#include "oorb.h"
namespace Oorb
class OrbPacket
DESCRIPTION
The
OrbPacket class represents
orbserver(1) packets
within the
Oorb(3) library. Internal to the object, the
underlying packet data may be either stuffed or unstuffed (per
stuffPkt(3) and
unstuffPkt(3)), depending on the
construction method and history of the object. In lazy-evaluation
style, the
OrbPacket class automatically attempts to stuff
and/or unstuff packets as necessary.
CONSTRUCTORS
-
OrbPacket( std::string source, int pktid, char* srcname, double pkttime, char* pkt, int nbytes );
This constructor creates an OrbPacket from a stuffed packet-buffer, usually
as returned by one of the orbget(3) and orbreap(3) family of functions.
-
OrbPacket( std::string srcname, Pf* pf );
This constructor creates an OrbPacket from an Antelope parameter-file.
METHODS
-
std::string describe( void );
This method returns a short string describing the OrbPacket.
-
bool isWf( void );
This method returns a boolean value indicating whether or not the OrbPacket
represents waveform data.
-
double nsec_max( void );
This method returns a double-precision value indicating the number of seconds of waveform data represented by
the packet-channel within the packet that has the longest time extent. If the OrbPacket does
not represent waveform data, the nsec_max method returns 0.
-
bool unstuffs( bool suppress_unstuff_errors = false );
This method returns true if the packet successfully unstuffs using the unstuffPkt(3) routine, or
false if it does not. The suppress_unstuff_errors argument controls whether errors are emitted
upon unstuffing failure. This defaults to false, i.e. unless specified otherwise, errors are
emitted.
-
char* getPktBufCopy( void );
This method returns a copy of the binary packet-buffer representing the OrbPacket
if one is available, otherwise a null pointer. The returned buffer must be freed by the
caller.
-
const Pf* getReadOnlyPf( void );
This method returns a read-only copy of the parameter-file pointer embedded within
the OrbPacket, or a null pointer if none is available. This pointer is part
of the internal structure of the OrbPacket and must not be freed by the caller.
It will be invalid after the OrbPacket is destroyed.
LIBRARY
-loorb $(ORBLIBS)
ATTRIBUTES
MT-Safe
SEE ALSO
Oorb(3), OorbBasics(3), Oorb::Configure(3), Oorb::Master(3)
BUGS AND CAVEATS
The
suppress_unstuff_errors argument to the
unstuffs method only applies during tests based
on that method. Other problems with the private internal unstuffing procedures in
OrbPacket, those
not arising from calls to
unstuffs(), may still produce message output.
AUTHOR
Kent Lindquist