KrisLibrary  1.0.0
Public Member Functions | Public Attributes | List of all members
BasicResource< T > Class Template Reference

A basic data type. More...

#include <ResourceLibrary.h>

Inheritance diagram for BasicResource< T >:
ResourceBase

Public Member Functions

 BasicResource (const T &val)
 
 BasicResource (const T &val, const std::string &name)
 
 BasicResource (const T &val, const std::string &name, const std::string &fileName)
 
virtual bool Load (std::istream &in)
 
virtual bool Save (std::ostream &out)
 
virtual bool Load (const std::string &fn)
 
virtual bool Load ()
 
virtual bool Save (const std::string &fn)
 
virtual bool Save ()
 
virtual const char * Type () const
 
virtual ResourceBaseMake ()
 
virtual ResourceBaseCopy ()
 
- Public Member Functions inherited from ResourceBase
 ResourceBase (const std::string &name)
 
 ResourceBase (const std::string &name, const std::string &fn)
 
virtual bool Load (TiXmlElement *in)
 
virtual bool Save (TiXmlElement *out)
 
virtual bool Load (AnyCollection &c)
 
virtual bool Save (AnyCollection &c)
 

Public Attributes

data
 
- Public Attributes inherited from ResourceBase
std::string name
 
std::string fileName
 

Detailed Description

template<class T>
class BasicResource< T >

A basic data type.

Assumes the data type has std::ostream << and std::istream >> overloads.

The type T is by default represented by the string returned to by typeid(T).name(). This is typically a mangled string that is compiler-dependent.

To override this, you must override the template function BasicResourceTypeName<T>().

Member Function Documentation

template<class T>
virtual ResourceBase* BasicResource< T >::Copy ( )
inlinevirtual

Make a ResourceBase that copies all the contents of this. (Copying the name and fileName are optional)

Reimplemented from ResourceBase.

template<class T>
virtual ResourceBase* BasicResource< T >::Make ( )
inlinevirtual

Make a ResourceBase of the same dynamic type as this. ResourceBase instances are their own factories.

Reimplemented from ResourceBase.

template<class T>
virtual const char* BasicResource< T >::Type ( ) const
inlinevirtual

A unique type string used for type indexing and xml output, only alphanumeric characters allowed.

Reimplemented from ResourceBase.


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