Public Types | Public Member Functions

gnash::LoadVariablesThread Class Reference

A manager for loadVariable requests. More...

#include <LoadVariablesThread.h>

List of all members.

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.
 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.
 ~LoadVariablesThread ()
 Destroy the LoadVariablesThread, joining the thread if spawned.
ValuesMapgetValues ()
 Return the name,value map parsed out of the loaded stream.
void process ()
 Start the load and parse thread.
void cancel ()
 Cancel a download in progress.
bool inProgress ()
 Return true if loading/parsing is in progress.
bool completed ()
 Mutex-protected inspector for thread completion.
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:
url URL 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:
url URL to post to and fetch from
postdata Url-encoded post data.
gnash::LoadVariablesThread::~LoadVariablesThread (  ) 

Destroy the LoadVariablesThread, joining the thread if spawned.


Member Function Documentation

void gnash::LoadVariablesThread::cancel (  ) 

Cancel a download in progress.

Locks _mutex

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.

Referenced by gnash::MovieClip::removeMovieClip().

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: