Overview   Class List   Class Hierarchy   Class Members   Functions & Constants   Defines   Header Files  

uima::SofaDataStream Class Reference

Inherited by uima::LocalSofaDataStream, and uima::RemoteSofaDataStream.

List of all members.


Detailed Description

The SofaDataStream class provides stream access to Sofa data in a Sofa feature strucure in the CAS.

The Sofa data may be local in the CAS or remote from the CAS and reference by a URI conformant string set in the SofaURI feature.

Handlers for the various URI schemes both standard and user-defined schemes may be registered by setting the environment variable UIMACPP_STREAMHANDLERS as follows:

UIMACPP_STREAMHANDLERS=file:SofaStreamHandlerFile aScheme:aLibrary ...
The APIs deliver data in native byte order and expect the data read from the source to be in the network byte order.


Public Member Functions

virtual int open (size_t minbufsize=0)=0
 open the stream for reading
virtual INT64 getTotalStreamSizeInBytes ()=0
 Gets the total size of the stream in number of bytes if known.
virtual INT64 howManyBytesAvailable ()=0
 Gets the number of bytes available.
virtual int read (void *pbuffer, int elementSize, size_t numElements)=0
 This call reads at most the number of elements into specified buffer.
virtual int seek (INT64 offset, int origin)=0
virtual void close ()=0
virtual const TySofaDataPointer getDataPointer ()=0
virtual ~SofaDataStream ()


Constructor & Destructor Documentation

virtual uima::SofaDataStream::~SofaDataStream  )  [inline, virtual]
 


Member Function Documentation

virtual int uima::SofaDataStream::open size_t  minbufsize = 0  )  [pure virtual]
 

open the stream for reading

Parameters:
minbufsize optional specifies the minimum size of the internal buffer the stream handler should use. defaults to the value of BUFSIZE

Implemented in uima::LocalSofaDataStream, and uima::RemoteSofaDataStream.

virtual INT64 uima::SofaDataStream::getTotalStreamSizeInBytes  )  [pure virtual]
 

Gets the total size of the stream in number of bytes if known.

Returns:
- size in bytes -1 if size cannot be determined as with an openended stream,

Implemented in uima::LocalSofaDataStream, and uima::RemoteSofaDataStream.

virtual INT64 uima::SofaDataStream::howManyBytesAvailable  )  [pure virtual]
 

Gets the number of bytes available.

Returns:
- size in bytes -1 if size cannot be determined,

Implemented in uima::LocalSofaDataStream, and uima::RemoteSofaDataStream.

virtual int uima::SofaDataStream::read void *  pbuffer,
int  elementSize,
size_t  numElements
[pure virtual]
 

This call reads at most the number of elements into specified buffer.

The call blocks until the number of required element are read or EOF. This will return elements in the native byte order for the current platform

The buffer is allocated and owned by the caller and must be at least elementSize*numElements in size.

Parameters:
pbuffer 
elementSize e.g., 1, 2, 4, 8
numElements 
Returns:
number of elements read -1 indicates EOF and no elements read -2 indicates elementSize is not compatible with elementSize of the data source. This would be the case for a LocalSofA where the Sofa data is in a typed array FS.

Implemented in uima::LocalSofaDataStream, and uima::RemoteSofaDataStream.

virtual int uima::SofaDataStream::seek INT64  offset,
int  origin
[pure virtual]
 

Implemented in uima::LocalSofaDataStream, and uima::RemoteSofaDataStream.

virtual void uima::SofaDataStream::close  )  [pure virtual]
 

Implemented in uima::LocalSofaDataStream, and uima::RemoteSofaDataStream.

virtual const TySofaDataPointer uima::SofaDataStream::getDataPointer  )  [pure virtual]
 

Implemented in uima::LocalSofaDataStream, and uima::RemoteSofaDataStream.


The documentation for this class was generated from the following file:
Generated on Mon Oct 1 16:04:13 2012 for UIMACPP API by  doxygen 1.3.9.1