Gnash  0.8.11dev
Public Types | Public Member Functions | List of all members
gnash::LoadVariablesThread Class Reference

A manager for loadVariable requests. More...

#include <LoadVariablesThread.h>

Public Types

typedef std::map< std::string,
std::string > 
ValuesMap
 

Public Member Functions

 LoadVariablesThread (const StreamProvider &sp, const URL &url)
 Construct a LoadVariablesThread opening a stream for the given URL. More...
 
 LoadVariablesThread (const StreamProvider &sp, const URL &url, const std::string &postdata)
 Construct a LoadVariablesThread opening a stream for the given URL, posting the given url-encoded data if using HTTP. More...
 
 ~LoadVariablesThread ()
 Destroy the LoadVariablesThread, joining the thread if spawned. More...
 
ValuesMap & getValues ()
 Return the name,value map parsed out of the loaded stream. More...
 
void process ()
 Start the load and parse thread. More...
 
void cancel ()
 Cancel a download in progress. More...
 
bool inProgress ()
 Return true if loading/parsing is in progress. More...
 
bool completed ()
 Mutex-protected inspector for thread completion. More...
 
size_t getBytesLoaded () const
 
size_t getBytesTotal () const
 

Detailed Description

A manager for loadVariable requests.

Provides services for starting a "load and parse" thread, checking its status and getting a parsed variables structure back when done.

Member Typedef Documentation

typedef std::map<std::string, std::string> gnash::LoadVariablesThread::ValuesMap

Constructor & Destructor Documentation

gnash::LoadVariablesThread::LoadVariablesThread ( const StreamProvider &  sp,
const URL &  url 
)

Construct a LoadVariablesThread opening a stream for the given URL.

Throws a NetworkException if unable.

Parameters
urlURL to post to and fetch from
gnash::LoadVariablesThread::LoadVariablesThread ( const StreamProvider &  sp,
const URL &  url,
const std::string &  postdata 
)

Construct a LoadVariablesThread opening a stream for the given URL, posting the given url-encoded data if using HTTP.

Throws a NetworkException if unable.

Parameters
urlURL to post to and fetch from
postdataUrl-encoded post data.
gnash::LoadVariablesThread::~LoadVariablesThread ( )

Destroy the LoadVariablesThread, joining the thread if spawned.

References cancel().

Member Function Documentation

void gnash::LoadVariablesThread::cancel ( )

Cancel a download in progress.

Locks _mutex

Referenced by ~LoadVariablesThread().

bool gnash::LoadVariablesThread::completed ( )
inline

Mutex-protected inspector for thread completion.

Only call this method from the same thread that also called process(), as the thread will be joined if it completed.

size_t gnash::LoadVariablesThread::getBytesLoaded ( ) const
inline
size_t gnash::LoadVariablesThread::getBytesTotal ( ) const
inline
ValuesMap& gnash::LoadVariablesThread::getValues ( )
inline

Return the name,value map parsed out of the loaded stream.

bool gnash::LoadVariablesThread::inProgress ( )
inline

Return true if loading/parsing is in progress.

void gnash::LoadVariablesThread::process ( )
inline

Start the load and parse thread.


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