27#ifndef NIDAS_CORE_IOCHANNEL_H
28#define NIDAS_CORE_IOCHANNEL_H
44namespace nidas {
namespace core {
89 virtual void setName(
const std::string& val) = 0;
91 virtual const std::string&
getName()
const = 0;
176 virtual size_t read(
void* buf,
size_t len) = 0;
185 virtual size_t write(
const void* buf,
size_t len) = 0;
194 virtual size_t write(
const struct iovec* iov,
int iovcnt) = 0;
Extra information associated with an IOChannel concerning the connection.
Definition ConnectionInfo.h:39
Interface of an object that can be instantiated from a DOM element, via the fromDOMElement method,...
Definition DOMable.h:51
Class that should include all that is configurable about a DSM.
Definition DSMConfig.h:55
Interface for an object that requests connections to Inputs or Outputs.
Definition IOChannel.h:56
virtual IOChannelRequester * connected(IOChannel *)=0
virtual ~IOChannelRequester()
Definition IOChannel.h:58
A channel for Input or Output of data.
Definition IOChannel.h:65
virtual bool writeNidasHeader() const
Should the NIDAS header be written to this IOChannel? NIDAS headers are not written to DatagramSocket...
Definition IOChannel.h:242
static IOChannel * createIOChannel(const xercesc::DOMElement *node)
Definition IOChannel.cc:44
virtual size_t getBufferSize() const
Return suggested buffer length.
Definition IOChannel.h:167
virtual IOChannel * clone() const =0
Derived classes must provide clone.
IOChannel(const IOChannel &x)
Definition IOChannel.h:71
virtual enum McSocketRequest getRequestType() const
Definition IOChannel.h:99
virtual const std::string & getName() const =0
virtual void setConnectionInfo(const ConnectionInfo &val)
Definition IOChannel.h:159
virtual void requestConnection(IOChannelRequester *)=0
After the IOChannel is configured, a user of IOChannel calls requestConnection to get things started.
virtual void flush()
Default flush implementation does nothing.
Definition IOChannel.h:201
virtual const ConnectionInfo & getConnectionInfo() const
What is the IP address of the host at the other end of the connection.
Definition IOChannel.h:154
virtual void setRequestType(enum McSocketRequest)
Definition IOChannel.h:97
virtual int getReconnectDelaySecs() const
Definition IOChannel.h:123
virtual size_t read(void *buf, size_t len)=0
Physical read method which must be implemented in derived classes.
virtual size_t write(const struct iovec *iov, int iovcnt)=0
Physical write method which must be implemented in derived classes.
virtual bool isNonBlocking() const =0
virtual void addSampleTag(const nidas::core::SampleTag *)
The special NetcdfRPCChannel subclass needs a way to add a SampleTag to the IOChannel through a virtu...
Definition IOChannel.cc:81
ConnectionInfo _conInfo
Definition IOChannel.h:271
virtual void setName(const std::string &val)=0
virtual ~IOChannel()
Definition IOChannel.h:82
IOChannel()
Definition IOChannel.cc:39
virtual const DSMConfig * getDSMConfig() const
What DSM is this IOChannel connected to? May be NULL.
Definition IOChannel.h:255
virtual int getFd() const =0
virtual void setNonBlocking(bool val)=0
const DSMConfig * _dsm
Definition IOChannel.h:269
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.
Definition IOChannel.h:229
IOChannel & operator=(const IOChannel &rhs)
Definition IOChannel.h:73
virtual void setDSMConfig(const DSMConfig *val)
What DSM is this IOChannel connected to?
Definition IOChannel.h:247
virtual bool isNewInput() const
Some IOChannels, namely FileSet, which opens successive files, need to indicate when a read is from t...
Definition IOChannel.h:107
virtual size_t write(const void *buf, size_t len)=0
Physical write method which must be implemented in derived classes.
virtual IOChannel * connect()=0
Establish a connection.
Class describing a group of variables that are sampled and handled together.
Definition SampleTag.h:88
Sample * getSample(sampleType type, unsigned int len)
A convienence method for getting a sample of an enumerated type from a pool.
Definition Sample.cc:70
McSocketRequest
Definition Datagrams.h:34
long long dsm_time_t
Posix time in microseconds, the number of non-leap microseconds since 1970 Jan 1 00:00 UTC.
Definition Sample.h:62
Root namespace for the NCAR In-Situ Data Acquisition Software.
Definition A2DConverter.h:31
int len
Definition sing.cc:948