nidas  v1.2-1520
Public Member Functions | Static Public Member Functions | Protected Attributes | Private Attributes | List of all members
nidas::dynld::isff::GOESXmtr Class Referenceabstract

Support for a GOES transmitter, implemented as an IOChannel. More...

#include <GOESXmtr.h>

Inheritance diagram for nidas::dynld::isff::GOESXmtr:
Inheritance graph
[legend]

Public Member Functions

 GOESXmtr ()
 Constructor. More...
 
 GOESXmtr (const GOESXmtr &)
 Copy constructor. More...
 
virtual ~GOESXmtr ()
 Destructor. More...
 
const std::string & getName () const
 
void setName (const std::string &val)
 
void setId (unsigned long val)
 
unsigned long getId () const
 
void setChannel (int val)
 
int getChannel () const
 
void setXmitInterval (long val)
 Set the transmission interval. More...
 
int getXmitInterval () const
 
void setXmitOffset (long val)
 Set the transmission offset. More...
 
int getXmitOffset () const
 
virtual void setRFBaud (long val)=0 throw (nidas::util::InvalidParameterException)
 Set the RF baud rate. More...
 
virtual int getRFBaud () const =0
 
void requestConnection (IOChannelRequester *rqstr) throw (nidas::util::IOException)
 Request a connection. More...
 
IOChannelconnect () throw (nidas::util::IOException)
 Establish a connection. More...
 
void setNonBlocking (bool val __attribute__((unused))) throw (nidas::util::IOException)
 
bool isNonBlocking () const throw (nidas::util::IOException)
 
virtual void open () throw (nidas::util::IOException)
 
virtual void init ()=0 throw (nidas::util::IOException)
 Initialize tranmitter. More...
 
virtual void transmitData (const nidas::util::UTime &at, int configid, const Sample *)=0 throw (nidas::util::IOException)
 Queue a sample for writing to a GOES transmitter. More...
 
virtual unsigned long checkId ()=0 throw (nidas::util::IOException)
 
virtual int checkClock ()=0 throw (nidas::util::IOException)
 Check transmitter clock, and correct it if necessary. More...
 
virtual void reset ()=0 throw (nidas::util::IOException)
 
virtual void printStatus ()=0 throw ()
 Request that transmitter status be printed to an output stream. More...
 
void flush () throw (nidas::util::IOException)
 Default flush implementation does nothing. More...
 
void close () throw (nidas::util::IOException)
 
int getFd () const
 
void setStatusFile (const std::string &val)
 
const std::string & getStatusFile () const
 
void fromDOMElement (const xercesc::DOMElement *node) throw (nidas::util::InvalidParameterException)
 Initialize myself from a xercesc::DOMElement. More...
 
virtual IOChannelclone () const =0
 Derived classes must provide clone. More...
 
virtual void setRequestType (enum McSocketRequest)
 
virtual enum McSocketRequest getRequestType () const
 
virtual bool isNewInput () const
 Some IOChannels, namely FileSet, which opens successive files, need to indicate when a read is from the start of a new file. More...
 
virtual int getReconnectDelaySecs () const
 
virtual void setNonBlocking (bool val)=0 throw (nidas::util::IOException)
 
virtual const ConnectionInfogetConnectionInfo () const
 What is the IP address of the host at the other end of the connection. More...
 
virtual void setConnectionInfo (const ConnectionInfo &val)
 
virtual size_t getBufferSize () const throw ()
 Return suggested buffer length. More...
 
virtual size_t read (void *buf, size_t len)=0 throw (nidas::util::IOException)
 Physical read method which must be implemented in derived classes. More...
 
virtual size_t write (const void *buf, size_t len)=0 throw (nidas::util::IOException)
 Physical write method which must be implemented in derived classes. More...
 
virtual size_t write (const struct iovec *iov, int iovcnt)=0 throw (nidas::util::IOException)
 Physical write method which must be implemented in derived classes. More...
 
virtual dsm_time_t createFile (dsm_time_t t, bool exact)
 Request that an IOChannel open a new file, with a name based on a time. More...
 
virtual bool writeNidasHeader () const
 Should the NIDAS header be written to this IOChannel? NIDAS headers are not written to DatagramSockets, because there is no guarantee they will get there. More...
 
virtual void setDSMConfig (const DSMConfig *val)
 What DSM is this IOChannel connected to? More...
 
virtual const DSMConfiggetDSMConfig () const
 What DSM is this IOChannel connected to? May be NULL. More...
 
virtual xercesc::DOMElement * toDOMParent (xercesc::DOMElement *parent, bool complete) const throw (xercesc::DOMException)
 Create a DOMElement and append it to the parent. More...
 
virtual xercesc::DOMElement * toDOMElement (xercesc::DOMElement *node, bool complete) const throw (xercesc::DOMException)
 Add my content into a DOMElement. More...
 

Static Public Member Functions

static IOChannelcreateIOChannel (const xercesc::DOMElement *node) throw (nidas::util::InvalidParameterException)
 
static const XMLCh * getNamespaceURI ()
 

Protected Attributes

nidas::util::SerialPort _port
 

Private Attributes

unsigned long _id
 
int _channel
 
int _xmitInterval
 
int _xmitOffset
 
std::string _statusFile
 

Detailed Description

Support for a GOES transmitter, implemented as an IOChannel.

Constructor & Destructor Documentation

GOESXmtr::GOESXmtr ( )

Constructor.

GOESXmtr::GOESXmtr ( const GOESXmtr x)

Copy constructor.

GOESXmtr::~GOESXmtr ( )
virtual

Destructor.

Member Function Documentation

virtual int nidas::dynld::isff::GOESXmtr::checkClock ( )
throw (nidas::util::IOException
)
pure virtual

Check transmitter clock, and correct it if necessary.

Returns
transmitter clock minus system clock, in milliseconds.

Implemented in nidas::dynld::isff::SE_GOESXmtr, and nidas::dynld::isff::SimGOESXmtr.

virtual unsigned long nidas::dynld::isff::GOESXmtr::checkId ( )
throw (nidas::util::IOException
)
pure virtual
virtual IOChannel* nidas::core::IOChannel::clone ( ) const
pure virtualinherited
void nidas::dynld::isff::GOESXmtr::close ( )
throw (nidas::util::IOException
)
inlinevirtual
IOChannel * GOESXmtr::connect ( )
throw (nidas::util::IOException
)
virtual

Establish a connection.

On return, the connection has been established. It may return a new instance of an IOChannel.

Implements nidas::core::IOChannel.

References open().

virtual dsm_time_t nidas::core::IOChannel::createFile ( dsm_time_t  t,
bool  exact 
)
inlinevirtualinherited

Request that an IOChannel open a new file, with a name based on a time.

This should be implemented by derived classes which write to disk files. Other derived classes (e.g. sockets) can just use this default implementation - basically ignoring the request.

Parameters
tTime to use when creating file name.
exactUse exact time when creating file name, else the time is adjusted to an even time interval.

Reimplemented in nidas::core::FileSet.

Referenced by nidas::core::IOStream::createFile().

IOChannel * IOChannel::createIOChannel ( const xercesc::DOMElement *  node)
throw (nidas::util::InvalidParameterException
)
staticinherited
void nidas::dynld::isff::GOESXmtr::flush ( )
throw (nidas::util::IOException
)
inlinevirtual

Default flush implementation does nothing.

Reimplemented from nidas::core::IOChannel.

Reimplemented in nidas::dynld::isff::SE_GOESXmtr.

void GOESXmtr::fromDOMElement ( const xercesc::DOMElement *  )
throw (nidas::util::InvalidParameterException
)
virtual
virtual size_t nidas::core::IOChannel::getBufferSize ( ) const
throw (
)
inlinevirtualinherited
int nidas::dynld::isff::GOESXmtr::getChannel ( ) const
inline
virtual const ConnectionInfo& nidas::core::IOChannel::getConnectionInfo ( ) const
inlinevirtualinherited

What is the IP address of the host at the other end of the connection.

If this IOChannel is not a socket then return INADDR_ANY, using the default constructor of an Inet4Address. Socket subclasses should override this.

Referenced by nidas::dynld::SampleInputStream::setIOChannel().

virtual const DSMConfig* nidas::core::IOChannel::getDSMConfig ( ) const
inlinevirtualinherited

What DSM is this IOChannel connected to? May be NULL.

Referenced by nidas::core::FileSet::setDir(), and nidas::core::FileSet::setFileName().

int nidas::dynld::isff::GOESXmtr::getFd ( ) const
inlinevirtual
unsigned long nidas::dynld::isff::GOESXmtr::getId ( ) const
inline
const std::string& nidas::dynld::isff::GOESXmtr::getName ( ) const
inlinevirtual
static const XMLCh* nidas::core::DOMable::getNamespaceURI ( )
inlinestaticinherited
virtual int nidas::core::IOChannel::getReconnectDelaySecs ( ) const
inlinevirtualinherited
virtual enum McSocketRequest nidas::core::IOChannel::getRequestType ( ) const
inlinevirtualinherited
virtual int nidas::dynld::isff::GOESXmtr::getRFBaud ( ) const
pure virtual
const std::string& nidas::dynld::isff::GOESXmtr::getStatusFile ( ) const
inline
int nidas::dynld::isff::GOESXmtr::getXmitInterval ( ) const
inline
int nidas::dynld::isff::GOESXmtr::getXmitOffset ( ) const
inline
virtual void nidas::dynld::isff::GOESXmtr::init ( )
throw (nidas::util::IOException
)
pure virtual
virtual bool nidas::core::IOChannel::isNewInput ( ) const
inlinevirtualinherited

Some IOChannels, namely FileSet, which opens successive files, need to indicate when a read is from the start of a new file.

This method is used by code which may need to do special things at the beginning of a file, like read a SampleInputHeader.

Reimplemented in nidas::core::UnixIOChannel, nidas::core::McSocketUDP, nidas::core::McSocket, nidas::core::Socket, nidas::core::DatagramSocket, and nidas::core::FileSet.

Referenced by nidas::core::IOStream::read().

bool nidas::dynld::isff::GOESXmtr::isNonBlocking ( ) const
throw (nidas::util::IOException
)
inlinevirtual
void GOESXmtr::open ( )
throw (nidas::util::IOException
)
virtual
virtual void nidas::dynld::isff::GOESXmtr::printStatus ( )
throw (
)
pure virtual

Request that transmitter status be printed to an output stream.

Implemented in nidas::dynld::isff::SE_GOESXmtr, and nidas::dynld::isff::SimGOESXmtr.

Referenced by nidas::dynld::isff::GOESOutput::run().

virtual size_t nidas::core::IOChannel::read ( void *  buf,
size_t  len 
)
throw (nidas::util::IOException
)
pure virtualinherited
void GOESXmtr::requestConnection ( IOChannelRequester rqstr)
throw (nidas::util::IOException
)
virtual

Request a connection.

Implements nidas::core::IOChannel.

virtual void nidas::dynld::isff::GOESXmtr::reset ( )
throw (nidas::util::IOException
)
pure virtual
void nidas::dynld::isff::GOESXmtr::setChannel ( int  val)
inline

Referenced by main().

virtual void nidas::core::IOChannel::setConnectionInfo ( const ConnectionInfo val)
inlinevirtualinherited
virtual void nidas::core::IOChannel::setDSMConfig ( const DSMConfig val)
inlinevirtualinherited
void nidas::dynld::isff::GOESXmtr::setId ( unsigned long  val)
inline

Referenced by main().

void nidas::dynld::isff::GOESXmtr::setName ( const std::string &  val)
inlinevirtual

Implements nidas::core::IOChannel.

Referenced by main().

virtual void nidas::core::IOChannel::setNonBlocking ( bool  val)
throw (nidas::util::IOException
)
pure virtualinherited
void nidas::dynld::isff::GOESXmtr::setNonBlocking ( bool val   __attribute__(unused))
throw (nidas::util::IOException
)
inline
virtual void nidas::core::IOChannel::setRequestType ( enum McSocketRequest  )
inlinevirtualinherited
virtual void nidas::dynld::isff::GOESXmtr::setRFBaud ( long  val)
throw (nidas::util::InvalidParameterException
)
pure virtual

Set the RF baud rate.

Parameters
valRF baud, in bits/sec.

Implemented in nidas::dynld::isff::SE_GOESXmtr, and nidas::dynld::isff::SimGOESXmtr.

void nidas::dynld::isff::GOESXmtr::setStatusFile ( const std::string &  val)
inline
void nidas::dynld::isff::GOESXmtr::setXmitInterval ( long  val)
inline

Set the transmission interval.

Parameters
valInterval, in seconds.
void nidas::dynld::isff::GOESXmtr::setXmitOffset ( long  val)
inline

Set the transmission offset.

Parameters
valOffset, in seconds.
xercesc::DOMElement * DOMable::toDOMElement ( xercesc::DOMElement *  node,
bool  complete 
) const
throw (xercesc::DOMException
)
virtualinherited
xercesc::DOMElement * DOMable::toDOMParent ( xercesc::DOMElement *  parent,
bool  complete 
) const
throw (xercesc::DOMException
)
virtualinherited
virtual void nidas::dynld::isff::GOESXmtr::transmitData ( const nidas::util::UTime at,
int  configid,
const Sample  
)
throw (nidas::util::IOException
)
pure virtual

Queue a sample for writing to a GOES transmitter.

Implemented in nidas::dynld::isff::SimGOESXmtr, and nidas::dynld::isff::SE_GOESXmtr.

Referenced by nidas::dynld::isff::GOESOutput::run().

virtual size_t nidas::core::IOChannel::write ( const void *  buf,
size_t  len 
)
throw (nidas::util::IOException
)
pure virtualinherited
virtual size_t nidas::core::IOChannel::write ( const struct iovec *  iov,
int  iovcnt 
)
throw (nidas::util::IOException
)
pure virtualinherited

Physical write method which must be implemented in derived classes.

Returns the number of bytes written, which may be less than the number requested.

Implemented in nidas::dynld::isff::SE_GOESXmtr, nidas::core::ServerSocket, nidas::core::Socket, nidas::core::McSocket, nidas::core::McSocketUDP, nidas::core::FileSet, nidas::core::DatagramSocket, nidas::core::UnixIOChannel, nidas::dynld::isff::SimGOESXmtr, and nidas::core::MultipleUDPSockets.

virtual bool nidas::core::IOChannel::writeNidasHeader ( ) const
inlinevirtualinherited

Should the NIDAS header be written to this IOChannel? NIDAS headers are not written to DatagramSockets, because there is no guarantee they will get there.

Reimplemented in nidas::core::DatagramSocket.

Referenced by nidas::dynld::SampleInputStream::setIOChannel().

Member Data Documentation

int nidas::dynld::isff::GOESXmtr::_channel
private
unsigned long nidas::dynld::isff::GOESXmtr::_id
private
nidas::util::SerialPort nidas::dynld::isff::GOESXmtr::_port
protected
std::string nidas::dynld::isff::GOESXmtr::_statusFile
private
int nidas::dynld::isff::GOESXmtr::_xmitInterval
private
int nidas::dynld::isff::GOESXmtr::_xmitOffset
private

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