openvrml::stream_listener Class Reference

An interface to simplify asynchronously reading a resource_istream. More...

#include <openvrml/browser.h>

List of all members.


Public Member Functions

virtual ~stream_listener ()=0 throw ()
 Destroy.
void stream_available (const std::string &uri, const std::string &media_type)
 Called once the stream is available for use.
void data_available (const std::vector< unsigned char > &data)
 Called when data is available.

Private Member Functions

virtual void do_stream_available (const std::string &uri, const std::string &media_type)=0
 Called by stream_available.
virtual void do_data_available (const std::vector< unsigned char > &data)=0
 Called by data_available.

Detailed Description

An interface to simplify asynchronously reading a resource_istream.

Constructor & Destructor Documentation

openvrml::stream_listener::~stream_listener (  )  throw () [pure virtual]

Destroy.


Member Function Documentation

void openvrml::stream_listener::stream_available ( const std::string &  uri,
const std::string &  media_type 
)

Called once the stream is available for use.

This function calls do_stream_available.

Parameters:
[in] uri the URI associated with the stream.
[in] media_type the MIME media type for the stream.

void openvrml::stream_listener::data_available ( const std::vector< unsigned char > &  data  ) 

Called when data is available.

This function calls do_data_available.

Parameters:
[in] data the data.

void openvrml::stream_listener::do_stream_available ( const std::string &  uri,
const std::string &  media_type 
) [private, pure virtual]

Called by stream_available.

Concrete stream_listeners must override this function.

Parameters:
[in] uri the URI associated with the stream.
[in] media_type the MIME media type for the stream.

void openvrml::stream_listener::do_data_available ( const std::vector< unsigned char > &  data  )  [private, pure virtual]

Called by data_available.

Parameters:
[in] data the data.