Ocular Engine
Ocular::Core::Resource Class Reference
Inheritance diagram for Ocular::Core::Resource:
Ocular::Core::MultiResource Ocular::Graphics::Material Ocular::Graphics::Mesh Ocular::Graphics::Shader Ocular::Graphics::ShaderProgram Ocular::Graphics::Texture Ocular::Graphics::D3D11Material Ocular::Graphics::MaterialEmpty Ocular::Graphics::MaterialMissing Ocular::Graphics::MeshEmpty Ocular::Graphics::MeshMissing Ocular::Graphics::FragmentShader Ocular::Graphics::GeometryShader Ocular::Graphics::PostTessellationShader Ocular::Graphics::PreTessellationShader Ocular::Graphics::VertexShader Ocular::Graphics::Texture2D

Public Member Functions

 Resource (File const &source)
 
virtual void unload ()
 
virtual void forceLoad ()
 
File getSourceFile () const
 
void setSourceFile (File const &file)
 
void setIsInMemory (bool inMemory)
 
bool isInMemory () const
 
void setSize (uint64_t size)
 
uint64_t getSize () const
 
ResourceType getResourceType () const
 
void setName (std::string const &name)
 
std::string const & getName () const
 
std::string const & getMappingName () const
 
void setMappingName (std::string const &name)
 
ResourceMetadatagetMetadata () const
 
void setMetadata (ResourceMetadata *metadata)
 

Protected Attributes

ResourceType m_Type
 
ResourceMetadatam_Metadata
 
File m_SourceFile
 
bool m_IsInMemory
 
uint64_t m_SizeInMemory
 
std::string m_Name
 
std::string m_MappingName
 

Constructor & Destructor Documentation

Ocular::Core::Resource::Resource ( File const &  source)
Parameters
[in]fileThe source file for the resource.

Member Function Documentation

void Ocular::Core::Resource::forceLoad ( )
virtual

Forces this Resource to be loaded into memory.

Todo:
Resources forceLoad
std::string const & Ocular::Core::Resource::getMappingName ( ) const
Returns
The mapping name used to find the resource. This is typically the relative local path without the file extension.
ResourceMetadata * Ocular::Core::Resource::getMetadata ( ) const
Returns
Optional metadata that was set for this Resource. Returns NULL if no metadata set.
ResourceType Ocular::Core::Resource::getResourceType ( ) const
Returns
The type of resource.
uint64_t Ocular::Core::Resource::getSize ( ) const
Returns
The size, in bytes, of the Resource
File Ocular::Core::Resource::getSourceFile ( ) const
Returns
The source file for the resource.
bool Ocular::Core::Resource::isInMemory ( ) const
Returns
TRUE if the Resource is loaded in memory.
void Ocular::Core::Resource::setIsInMemory ( bool  inMemory)
Parameters
[in]inMemory
Note
This method should generally not be used unless by internal mechanisms.
void Ocular::Core::Resource::setMappingName ( std::string const &  name)
Note
For internal use only
void Ocular::Core::Resource::setMetadata ( ResourceMetadata metadata)

Sets the optional metadata for this Resource.

The Resource assumes ownership of the metadata and will delete it either at the end of it's lifetime, or during subsequent calls to this methods.

Parameters
[in]metadata
void Ocular::Core::Resource::setSize ( uint64_t  size)

Sets the size in bytes that this resource occupies when loaded.

Parameters
[in]size
void Ocular::Core::Resource::setSourceFile ( File const &  file)
Parameters
[in]file
Note
This method should generally not be used unless by internal mechanisms.

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