#include <archon/x3d/server/network.H>
Inheritance diagram for Archon::X3D::UrlObject:
Public Member Functions | |
Ref< const Loader::Contents > | getContents () const |
Returns the currently loaded URI contents if any. | |
Static Public Attributes | |
static const NodeType * | type = 0 |
Protected Member Functions | |
UrlObject () | |
virtual | ~UrlObject () |
void | addUri (string, Time stamp) |
virtual void | clear () |
Override this method if you want a chance to clean up any data produced from old URI contents such as OpenGL textures and script engines when the URI is reassigned. | |
virtual void | onLoaded () |
Override this method to get a notification of when the URI contents is loaded. | |
virtual bool | mayStartLoading () const |
This method is called whenever a new value is assigned to the 'url' filed to determine if the loading should start immediatly. | |
void | startLoading () |
If loading of the contents corresponding to the current value of the 'url' field is not yet startet, then start it now. | |
Friends | |
void | initializeNetworkComponent () |
Classes | |
struct | LoaderJob |
Apart from being a Loader::Job this class is responsible for communicating with the UrlObject which created it. |
The base class for all X3D nodes with a single URI field such as ImageTexture and Inline.
Asynchronious download of URI contents is automatically initiated (and aborted) as a result of assignment to the URI field. Descendants of this class may choose to override the 'clear' method to get a notification of when the URI contents is deleted as a consequence of assignment to the URI field.
Definition at line 56 of file network.H.
|
Contents loading is dealt with though. Definition at line 113 of file network.C. References Archon::X3D::NodeBase::context, Archon::X3D::NodeBase::isRealizedNoLock(), Archon::X3D::NodeType::lookupField(), Archon::X3D::NodeBase::mutex, Archon::X3D::FieldBase::set(), and Archon::X3D::MFString::type. |
|
Override this method if you want a chance to clean up any data produced from old URI contents such as OpenGL textures and script engines when the URI is reassigned. Will be called with a scenegraph write lock or a Node lock. |
|
Returns the currently loaded URI contents if any. This method will return the null reference if either the URI field is empty or the download is not yet complete or the download has failed. Definition at line 102 of file network.C. Referenced by Archon::Raytracer::SceneLoader::doShape(), and Archon::X3D::Viewer::ShapeCache::updateTexture(). |
|
This method is called whenever a new value is assigned to the 'url' filed to determine if the loading should start immediatly. The default is that loading will start immediately. You may override this method if you want to change the default.
|
|
Override this method to get a notification of when the URI contents is loaded. BEWARE though, that this method is called asynchroniously by the loader thread. this means that you generally cannot access anything which is changed by other threads without locking a mutex. This includes everything which may be updated during an event cascade (all X3D fields). You should not do too much work from this method since the UrlObject may get orphaned at any time, meaning that the only reference to it will be the one held by the loader thread. This means that the performed work will be in vain. You may try to detect the orphaned condition with 'RefObjectBaseuse_count() == 1'.
|
|
If loading of the contents corresponding to the current value of the 'url' field is not yet startet, then start it now.
Definition at line 228 of file network.C. References Archon::X3D::NodeBase::context, and Archon::Utilities::BackRef< T >::getRef(). |
|
If so, this should be prevented. Well, does it even need to be defined as a type here? And, could it not be moved to X3D::SAI?. Reimplemented in Archon::X3D::Inline. |