Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | List of all members
om::resources::ResourceTypeTranscoder< DataType > Class Template Referenceabstract

A class that defines the interface for other classes that load and save resource data of the templated type. More...

#include <omResourceTypeTranscoder.h>

Inheritance diagram for om::resources::ResourceTypeTranscoder< DataType >:
om::resources::ResourceTranscoder om::graphics::io::MeshworkTranscoder om::graphics::io::OBJTranscoder om::graphics::io::PLYTranscoder om::graphics::io::TextureTranscoder om::sound::io::HRTFTranscoder om::sound::io::MIDITranscoder om::sound::io::SoundTranscoder om::sound::io::AIFFTranscoder om::sound::io::FLACTranscoder om::sound::io::OggTranscoder om::sound::io::WaveTranscoder

Public Member Functions

virtual const ResourceTypegetResourceType () const
 Return an object that represents the resource type that this transcoder can read and write. More...
 
virtual Bool canEncode (const DataType &resource) const =0
 Return whether or not this transcoder is able to encode the specified resource. More...
 
virtual Bool encode (const ResourceID &identifier, const DataType &resource, const ResourceSet *resourceSet=((void *) 0), ResourceManager *manager=((void *) 0))=0
 Save the specified resource object at the specified ID location. More...
 
virtual DataType * decode (ResourceID &identifier, ResourceSet *resourceSet=((void *) 0), ResourceManager *manager=((void *) 0))=0
 Load the resource pointed to by the specified identifier. More...
 
- Public Member Functions inherited from om::resources::ResourceTranscoder
virtual ~ResourceTranscoder ()
 Destroy a resource transcoder and release all of its resources. More...
 
virtual const ResourceFormatgetResourceFormat () const =0
 Return an object that represents the resource format that this transcoder can read and write. More...
 
virtual Bool canDecode (const ResourceID &identifier) const =0
 Return whether or not the specified identifier refers to a valid resource for this transcoder. More...
 

Detailed Description

template<typename DataType>
class om::resources::ResourceTypeTranscoder< DataType >

A class that defines the interface for other classes that load and save resource data of the templated type.

Member Function Documentation

template<typename DataType>
virtual const ResourceType& om::resources::ResourceTypeTranscoder< DataType >::getResourceType ( ) const
inlinevirtual

Return an object that represents the resource type that this transcoder can read and write.

Implements om::resources::ResourceTranscoder.

template<typename DataType>
virtual Bool om::resources::ResourceTypeTranscoder< DataType >::canEncode ( const DataType &  resource) const
pure virtual

Return whether or not this transcoder is able to encode the specified resource.

Implemented in om::resources::ResourceSetTranscoder.

template<typename DataType>
virtual Bool om::resources::ResourceTypeTranscoder< DataType >::encode ( const ResourceID identifier,
const DataType &  resource,
const ResourceSet resourceSet = ((void *) 0),
ResourceManager manager = ((void *) 0) 
)
pure virtual

Save the specified resource object at the specified ID location.

The method returns whether or not the resource was successfully written.

Implemented in om::resources::ResourceSetTranscoder.

template<typename DataType>
virtual DataType* om::resources::ResourceTypeTranscoder< DataType >::decode ( ResourceID identifier,
ResourceSet resourceSet = ((void *) 0),
ResourceManager manager = ((void *) 0) 
)
pure virtual

Load the resource pointed to by the specified identifier.

The caller can supply a pointer to a resource manager which can be used to load child resources. A resource set is provided as a place to store child resources. The caller is responsible for destructing the returned object.

If the method fails, the return value will be NULL.

Implemented in om::resources::ResourceSetTranscoder, om::images::io::ImageTranscoder, om::sound::io::HRTFTranscoder, om::graphics::io::MeshworkTranscoder, om::graphics::io::OBJTranscoder, om::graphics::io::PLYTranscoder, om::graphics::io::TextureTranscoder, om::sound::io::MIDITranscoder, om::graphics::gui::resources::FontTranscoder, and om::sound::io::SoundTranscoder.


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