Archon::X3D::Loader Struct Reference

Manage URI content loading in an asynchronious manner. More...

#include <archon/x3d/server/load.H>

Inheritance diagram for Archon::X3D::Loader:

Inheritance graph
[legend]
Collaboration diagram for Archon::X3D::Loader:

Collaboration graph
[legend]
List of all members.

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::ClientgetWebClient () const

Public Attributes

const BackRef< Serverserver

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

Detailed Description

Manage URI content loading in an asynchronious manner.

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.


Member Enumeration Documentation

enum Archon::X3D::Loader::UriType
 

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.

Definition at line 78 of file load.H.


Member Function Documentation

void Archon::X3D::Loader::submitJob Ref< Job  ) 
 

Submit a new download job.

You must instantiate the jobs your self.

Do not submit a specific job object more than once.

See also:
Loader::Job

Definition at line 377 of file load.C.

References Archon::Utilities::Job::Queue::add(), and Archon::Utilities::Ref< T >::get().


The documentation for this struct was generated from the following files:
Generated on Sun Jul 30 23:00:26 2006 for Archon by  doxygen 1.4.4