Om
1.0.0
A universal framework for multimedia simulation
|
A class that reads and writes resource sets. More...
#include <omResourceSetTranscoder.h>
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... | |
ResourceSetTranscoder & | operator= (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 ResourceFormat & | getResourceFormat () 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 ResourceSet * | decode (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 ResourceType & | getResourceType () 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... | |
A class that reads and writes resource sets.
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 |
Destroy this resource transcoder and release all associated resources.
ResourceSetTranscoder& om::resources::ResourceSetTranscoder::operator= | ( | const ResourceSetTranscoder & | other | ) |
Copy the state of another resource transcoder to this one.
|
inline |
Return the number of resource types that this transcoder can handle.
|
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.
|
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 |
Return an object that represents the resource format that this transcoder can read and write.
Implements om::resources::ResourceTranscoder.
|
virtual |
Return whether or not this resource transcoder is able to encode the specified resource.
Implements om::resources::ResourceTypeTranscoder< ResourceSet >.
|
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 |
Return whether or not the specified identifier refers to a valid resource file for this transcoder.
Implements om::resources::ResourceTranscoder.
|
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.
|
static |
The resource format that this resource set transcoder is encoding.