XLE  v0.02.0
Public Member Functions | List of all members
Assets::DependencyValidation Class Reference

Handles resource invalidation events More...

#include <Assets.h>

Inheritance diagram for Assets::DependencyValidation:
Inheritance graph
[legend]

Public Member Functions

virtual void OnChange ()
 
unsigned GetValidationIndex () const
 
void RegisterDependency (const std::shared_ptr< Utility::OnChangeCallback > &dependency)
 
 DependencyValidation (DependencyValidation &&) never_throws
 
DependencyValidationoperator= (DependencyValidation &&) never_throws
 
 DependencyValidation (const DependencyValidation &)=delete
 
DependencyValidationoperator= (const DependencyValidation &)=delete
 

Detailed Description

Handles resource invalidation events

Utility class used for detecting resource invalidation events (for example, if a shader source file changes on disk). Resources that can receive invalidation events should use this class to declare that dependency.

For example:

@code
class SomeResource
{
public:
SomeResource(const char constructorString[]);
private:
std::shared_ptr<DependencyValidation> _validator;
};
SomeResource::SomeResource(const char constructorString[])
{
// Load some data from a file named "constructorString
auto validator = std::make_shared<DependencyValidation>();
RegisterFileDependency(validator, constructorString);
_validator = std::move(validator);
}
\endcode
See also
RegisterFileDependency, RegisterResourceDependency

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