#include <archon/x3d/server/load.H>
Inheritance diagram for Archon::X3D::Loader:
Public Types | |
enum | UriType { uriType_X3D, uriType_Image, uriType_Movie, uriType_Script } |
A 'UriType' value is used to indicate what type of contents object that we want. More... | |
Public Member Functions | |
~Loader () | |
Loader (Ref< Server >, Ref< Web::Client >) | |
void | submitJob (Ref< Job >) |
Submit a new download job. | |
Ref< Web::Client > | getWebClient () const |
Public Attributes | |
const BackRef< Server > | server |
Classes | |
struct | Contents |
Base class for all types of contents objects. More... | |
struct | ImageContents |
struct | Job |
This class represents one request for a set of alternative URIs. More... | |
struct | MovieContents |
struct | ScriptContents |
struct | X3DContents |
This class is responsible for loading URI contents for those X3D nodes that have URI fields. The loading is done asynchroniously with respect to the code that utilizes the Loader. That is, each submitted load job is executed in an independant loader thread. For some URI types such as 'image' the loaded contents is streamed directly into the appropriate parser which runs in the context of the associated loader thread. In X3D a URI field often contains multiple alternative URIs. All the URIs are passed to a single loader thread which then attemps to load them one at a time untill success. Loaded contents is represented by a polymorphic contents object type 'Contents' regardless of the real type of contents.
Caching: The loader also maintains a memory cache. For each URI that is about to be loaded, the loader first consults the cache. If ther is a 'hit' (based on absolute URI), then the cached contents object is used, and the job of loading is complete. If there it no hit, then the URI is requested, and when it is loaded and possibly parsed, the resulting contents object is added to the cache.
Notification: The loader job supports notification upon completion through the virtual method 'onCompletion' (this includes the unsuccessfull jobs too).
Definition at line 71 of file load.H.
|
A 'UriType' value is used to indicate what type of contents object that we want. This is also a choise of which kind of parser to stream the loaded data into. |
|
Submit a new download job. You must instantiate the jobs your self. Do not submit a specific job object more than once.
Definition at line 377 of file load.C. References Archon::Utilities::Job::Queue::add(), and Archon::Utilities::Ref< T >::get(). |