XLE  v0.02.0
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Assets::ConfigFileContainer< Type, Formatter > Class Template Reference

Container file with with one child that is initialized via InputStreamFormatter More...

#include <ConfigFileContainer.h>

Public Member Functions

 ConfigFileContainer (const ResChar initializer[])
 
const std::shared_ptr< DependencyValidation > & GetDependencyValidation () const
 

Public Attributes

Type _asset
 

Protected Attributes

std::shared_ptr< DependencyValidation_validationCallback
 

Detailed Description

template<typename Type, typename Formatter = InputStreamFormatter<utf8>>
class Assets::ConfigFileContainer< Type, Formatter >

Container file with with one child that is initialized via InputStreamFormatter

Represents a file that contains a single serialized item. That item must be a type that can be deserialized with InputStreamFormatter.

Consider a configuration object like:

@code
class Config
{
public:
Config( InputStreamFormatter<utf8>& formatter,
const ::Assets::DirectorySearchRules&);
~Config();
};
\endcode

This might contain some configuration options, maybe some simple members or maybe even some complex members.

Sometimes we might want to store a configuration settings like this in it's own individual file. Other times, we might want to store it within a larger file, just as part of heirarchy of serialized objects.

Because the object is deserialized directly from the formatter, we have the flexibility to do that.

When we want that object to exist on it's own, in an individual file, we can use ConfigFileContainer<Config>. With a ConfigFileContainer, it can be considered a fully functional asset, with a dependency validation, relative path rules and reporting correctly to the InvalidAssetManager.


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