Public Types | Public Member Functions | Static Public Member Functions | List of all members
zorba::StreamResource Class Referenceabstract

Concrete Resource subclass representing access to an entity via a stream. More...

#include <zorba/uri_resolvers.h>

Inheritance diagram for zorba::StreamResource:
Inheritance graph
[legend]
Collaboration diagram for zorba::StreamResource:
Collaboration graph
[legend]

Public Types

typedef std::unique_ptr
< Resource,
internal::ztd::destroy_delete
< Resource > > 
ptr
 

Public Member Functions

virtual void destroy () const =0
 Destroy/clean up this Resource. More...
 
virtual std::istream * getStream ()=0
 Retrieve the istream associated with this Resource. More...
 
virtual StreamReleaser getStreamReleaser ()=0
 Retrieve the stream-releaser function. More...
 
virtual bool isStreamSeekable () const =0
 
virtual ~StreamResource ()=0
 

Static Public Member Functions

static StreamResourcecreate (std::istream *aStream, StreamReleaser aStreamReleaser, bool aIsStreamSeekable=false)
 Public factory method from istream. More...
 

Detailed Description

Concrete Resource subclass representing access to an entity via a stream.

Definition at line 73 of file uri_resolvers.h.

Member Typedef Documentation

Definition at line 54 of file uri_resolvers.h.

Constructor & Destructor Documentation

virtual zorba::StreamResource::~StreamResource ( )
pure virtual

Member Function Documentation

static StreamResource* zorba::StreamResource::create ( std::istream *  aStream,
StreamReleaser  aStreamReleaser,
bool  aIsStreamSeekable = false 
)
static

Public factory method from istream.

The Resource object will take memory ownership of the istream. Zorba will pass it to aStreamReleaser when it is no longer needed, so that the original client may delete it.

Parameters
aStreamAn istream whence to read the string's content.
aStreamReleaserA function pointer which is invoked once the StreamResource is destroyed. Normally this function will delete the std::istream object passed to it.
aIsStreamSeekableDetermines whether the given stream is arbitrarily seekable without throwing errors.
Examples:
context.cpp, and external_functions.cpp.
virtual void zorba::Resource::destroy ( ) const
pure virtualinherited

Destroy/clean up this Resource.

Zorba will call this method when it no longer needs the Resource. It is the responsibility of subclasses to clean up appropriate when this method is called, including calling "delete this" if the Resource was allocated with "new".

virtual std::istream* zorba::StreamResource::getStream ( )
pure virtual

Retrieve the istream associated with this Resource.

virtual StreamReleaser zorba::StreamResource::getStreamReleaser ( )
pure virtual

Retrieve the stream-releaser function.

virtual bool zorba::StreamResource::isStreamSeekable ( ) const
pure virtual

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