Om  1.0.0
A universal framework for multimedia simulation
Classes | Public Member Functions | Static Public Attributes | List of all members
om::resources::ResourceSetTranscoder Class Reference

A class that reads and writes resource sets. More...

#include <omResourceSetTranscoder.h>

Inheritance diagram for om::resources::ResourceSetTranscoder:
om::resources::ResourceTypeTranscoder< ResourceSet > om::resources::ResourceTranscoder

Public Member Functions

 ResourceSetTranscoder ()
 Create a new resource transcoder that has no types it can handle. More...
 
 ResourceSetTranscoder (const ResourceSetTranscoder &other)
 Create a new resource transcoder that is a copy of another resource transcoder. More...
 
virtual ~ResourceSetTranscoder ()
 Destroy this resource transcoder and release all associated resources. More...
 
ResourceSetTranscoderoperator= (const ResourceSetTranscoder &other)
 Copy the state of another resource transcoder to this one. More...
 
Size getTypeCount () const
 Return the number of resource types that this transcoder can handle. More...
 
template<typename DataType >
ResourceSetTypeTranscoder< DataType > * getType () const
 Return a pointer to the transcoder used for the template resource data type. More...
 
void addModule (ResourceModule &module)
 Add all of the resource type transcoders from the specified module to this resource set transcoder. More...
 
template<typename DataType >
Bool addType (ResourceSetTypeTranscoder< DataType > *transcoder)
 Add a new type to this resource transcoder that is can decode and encode. More...
 
Bool removeType (const ResourceType &type)
 Remove the specified resource type from this resource transcoder. More...
 
void clearTypes ()
 Remove all resource types from this resource transcoder. More...
 
virtual const ResourceFormatgetResourceFormat () const
 Return an object that represents the resource format that this transcoder can read and write. More...
 
virtual Bool canEncode (const ResourceSet &resources) const
 Return whether or not this resource transcoder is able to encode the specified resource. More...
 
virtual Bool encode (const ResourceID &identifier, const ResourceSet &resources, const ResourceSet *resourceSet=((void *) 0), ResourceManager *manager=((void *) 0))
 Encode the specified generic scene to the file at the specified path. More...
 
virtual Bool canDecode (const ResourceID &identifier) const
 Return whether or not the specified identifier refers to a valid resource file for this transcoder. More...
 
virtual ResourceSetdecode (ResourceID &identifier, ResourceSet *resourceSet=((void *) 0), ResourceManager *manager=((void *) 0))
 Decode the resource file at the specified path and return a pointer to the decoded scene. More...
 
OpaqueResource instance (const OpaqueResource &resource, ResourceSet &storage) const
 Create a copy of an opaque resource and store the copy in a resource set. More...
 
OpaqueResource instance (const void *data, const ResourceType &type, ResourceSet &storage) const
 Create a copy of an opaque resource and store the copy in a resource set. More...
 
void replaceInstances (void *data, const ResourceType &type, const Prototype &prototype, const Prototype &instance, ResourceSet &storage) const
 Replace child object instances with the new prototype data. More...
 
Bool findInstances (void *data, const ResourceType &type, const Prototype &prototype, const Prototype &instance) const
 Return whether or not there are any child object instances with new prototype data. More...
 
- Public Member Functions inherited from om::resources::ResourceTypeTranscoder< ResourceSet >
virtual const ResourceTypegetResourceType () const
 Return an object that represents the resource type that this transcoder can read and write. More...
 
- Public Member Functions inherited from om::resources::ResourceTranscoder
virtual ~ResourceTranscoder ()
 Destroy a resource transcoder and release all of its resources. More...
 

Static Public Attributes

static const ResourceFormat FORMAT
 The resource format that this resource set transcoder is encoding. More...
 

Detailed Description

A class that reads and writes resource sets.

Constructor & Destructor Documentation

om::resources::ResourceSetTranscoder::ResourceSetTranscoder ( )

Create a new resource transcoder that has no types it can handle.

om::resources::ResourceSetTranscoder::ResourceSetTranscoder ( const ResourceSetTranscoder other)

Create a new resource transcoder that is a copy of another resource transcoder.

virtual om::resources::ResourceSetTranscoder::~ResourceSetTranscoder ( )
virtual

Destroy this resource transcoder and release all associated resources.

Member Function Documentation

ResourceSetTranscoder& om::resources::ResourceSetTranscoder::operator= ( const ResourceSetTranscoder other)

Copy the state of another resource transcoder to this one.

Size om::resources::ResourceSetTranscoder::getTypeCount ( ) const
inline

Return the number of resource types that this transcoder can handle.

template<typename DataType >
ResourceSetTypeTranscoder<DataType>* om::resources::ResourceSetTranscoder::getType ( ) const
inline

Return a pointer to the transcoder used for the template resource data type.

void om::resources::ResourceSetTranscoder::addModule ( ResourceModule module)

Add all of the resource type transcoders from the specified module to this resource set transcoder.

template<typename DataType >
Bool om::resources::ResourceSetTranscoder::addType ( ResourceSetTypeTranscoder< DataType > *  transcoder)
inline

Add a new type to this resource transcoder that is can decode and encode.

The method returns whether or not the new type was able to be added. If the resource type already exists in this transcoder, the method fails and returns FALSE. Otherwise it is added to the transcoder.

Bool om::resources::ResourceSetTranscoder::removeType ( const ResourceType type)

Remove the specified resource type from this resource transcoder.

The method returns whether or not the type was able to be removed.

void om::resources::ResourceSetTranscoder::clearTypes ( )

Remove all resource types from this resource transcoder.

virtual const ResourceFormat& om::resources::ResourceSetTranscoder::getResourceFormat ( ) const
virtual

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

Implements om::resources::ResourceTranscoder.

virtual Bool om::resources::ResourceSetTranscoder::canEncode ( const ResourceSet resources) const
virtual

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

Implements om::resources::ResourceTypeTranscoder< ResourceSet >.

virtual Bool om::resources::ResourceSetTranscoder::encode ( const ResourceID identifier,
const ResourceSet resources,
const ResourceSet resourceSet = ((void *) 0),
ResourceManager manager = ((void *) 0) 
)
virtual

Encode the specified generic scene to the file at the specified path.

If the method fails, FALSE is returned.

Implements om::resources::ResourceTypeTranscoder< ResourceSet >.

virtual Bool om::resources::ResourceSetTranscoder::canDecode ( const ResourceID identifier) const
virtual

Return whether or not the specified identifier refers to a valid resource file for this transcoder.

Implements om::resources::ResourceTranscoder.

virtual ResourceSet* om::resources::ResourceSetTranscoder::decode ( ResourceID identifier,
ResourceSet resourceSet = ((void *) 0),
ResourceManager manager = ((void *) 0) 
)
virtual

Decode the resource file at the specified path and return a pointer to the decoded scene.

If the method fails, a NULL pointer is returned.

Implements om::resources::ResourceTypeTranscoder< ResourceSet >.

OpaqueResource om::resources::ResourceSetTranscoder::instance ( const OpaqueResource resource,
ResourceSet storage 
) const

Create a copy of an opaque resource and store the copy in a resource set.

A pointer to the new resource copy is returned, or NULL if the method fails.

OpaqueResource om::resources::ResourceSetTranscoder::instance ( const void *  data,
const ResourceType type,
ResourceSet storage 
) const

Create a copy of an opaque resource and store the copy in a resource set.

A pointer to the new resource copy is returned, or NULL if the method fails.

void om::resources::ResourceSetTranscoder::replaceInstances ( void *  data,
const ResourceType type,
const Prototype prototype,
const Prototype instance,
ResourceSet storage 
) const

Replace child object instances with the new prototype data.

Bool om::resources::ResourceSetTranscoder::findInstances ( void *  data,
const ResourceType type,
const Prototype prototype,
const Prototype instance 
) const

Return whether or not there are any child object instances with new prototype data.

Member Data Documentation

const ResourceFormat om::resources::ResourceSetTranscoder::FORMAT
static

The resource format that this resource set transcoder is encoding.


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