PixelLightAPI  .
Public Member Functions | Protected Member Functions | Protected Attributes
PLCore::Loadable Class Reference

Abstract loadable (serialization) base class, derive your loadable classes from this class. More...

#include <Loadable.h>

Inheritance diagram for PLCore::Loadable:
Inheritance graph
[legend]

List of all members.

Public Member Functions

String GetFilename () const
 Returns the filename this loadable was given to loaded from.
String GetUrl () const
 Returns the absolute filename this loadable was loaded from.
virtual PLCORE_API bool LoadByFilename (const String &sFilename, const String &sParams="", const String &sMethod="")
 Loads the loadable from a file given by filename.
virtual PLCORE_API bool LoadByFile (File &cFile, const String &sParams="", const String &sMethod="")
 Loads the loadable from a file given by a reference.
virtual PLCORE_API bool SaveByFilename (const String &sFilename, const String &sParams="", const String &sMethod="")
 Saves the loadable to a file given by filename.
virtual PLCORE_API bool SaveByFile (File &cFile, const String &sParams="", const String &sMethod="")
 Saves the loadable to a file given by reference.
virtual PLCORE_API bool Reload ()
 Reloads the loadable.
virtual PLCORE_API bool Unload ()
 Unloads the loadable.
virtual PLCORE_API String GetLoadableTypeName () const
 Returns the loadable type name.

Protected Member Functions

PLCORE_API Loadable ()
 Constructor.
virtual PLCORE_API ~Loadable ()
 Destructor.
virtual PLCORE_API bool CallLoadable (File &cFile, Loader &cLoader, const String &sMethod, const String &sParams)
 Calls the loadable in order to load or save.

Protected Attributes

String m_sFilename
String m_sUrl

Detailed Description

Abstract loadable (serialization) base class, derive your loadable classes from this class.

Note:
  • If your loadable has special parameters for loading/saving don't forget to document it within your class!

Constructor & Destructor Documentation

PLCORE_API PLCore::Loadable::Loadable ( ) [protected]
virtual PLCORE_API PLCore::Loadable::~Loadable ( ) [protected, virtual]

Destructor.


Member Function Documentation

Returns the filename this loadable was given to loaded from.

Returns:
The filename this loadable was given to loaded from
String PLCore::Loadable::GetUrl ( ) const [inline]

Returns the absolute filename this loadable was loaded from.

Returns:
The absolute filename this loadable was loaded from
virtual PLCORE_API bool PLCore::Loadable::LoadByFilename ( const String sFilename,
const String sParams = "",
const String sMethod = "" 
) [virtual]

Loads the loadable from a file given by filename.

Parameters:
[in]sFilenameLoadable filename
[in]sParamsOptional load method parameters, can be an empty string
[in]sMethodOptional name of the load method to use, can be an empty string
Returns:
'true' if all went fine, else 'false'
Note:
  • If no method name was provided, 'Load' if sParams is empty, or 'LoadParams' if sParams is not empty is used automatically

Reimplemented in PLScene::SceneContainer, PLRenderer::Material, PLRenderer::Texture, PLRenderer::TextureAni, and PLPhysics::SCPhysicsWorld.

virtual PLCORE_API bool PLCore::Loadable::LoadByFile ( File cFile,
const String sParams = "",
const String sMethod = "" 
) [virtual]

Loads the loadable from a file given by a reference.

Parameters:
[in]cFileFile to load from, must be opened and readable
[in]sParamsOptional load method parameters, can be an empty string
[in]sMethodOptional name of the load method to use, can be an empty string
Returns:
'true' if all went fine, else 'false'
Note:
  • If no method name was provided, 'Load' if sParams is empty, or 'LoadParams' if sParams is not empty is used automatically

Reimplemented in PLScene::SceneContainer, and PLPhysics::SCPhysicsWorld.

virtual PLCORE_API bool PLCore::Loadable::SaveByFilename ( const String sFilename,
const String sParams = "",
const String sMethod = "" 
) [virtual]

Saves the loadable to a file given by filename.

Parameters:
[in]sFilenameLoadable filename
[in]sParamsOptional save method parameters, can be an empty string
[in]sMethodOptional name of the save method to use, can be an empty string
Returns:
'true' if all went fine, else 'false'
Note:
  • If no method name was provided, 'Save' if sParams is empty, or 'SaveParams' if sParams is not empty is used automatically

Reimplemented in PLRenderer::Texture, and PLRenderer::TextureAni.

virtual PLCORE_API bool PLCore::Loadable::SaveByFile ( File cFile,
const String sParams = "",
const String sMethod = "" 
) [virtual]

Saves the loadable to a file given by reference.

Parameters:
[in]cFileFile to save into, must be opened and writable
[in]sParamsOptional save method parameters, can be an empty string
[in]sMethodOptional name of the save method to use, can be an empty string
Returns:
'true' if all went fine, else 'false'
Note:
  • If no method name was provided, 'Save' if sParams is empty, or 'SaveParams' if sParams is not empty is used automatically

Reimplemented in PLRenderer::Texture, and PLRenderer::TextureAni.

virtual PLCORE_API bool PLCore::Loadable::Reload ( ) [virtual]

Reloads the loadable.

Returns:
'true' if all went fine, else 'false' (maybe there's nothing loaded?)
Note:
  • Same as pLoadable->Load(pLoadable->GetAbsFilename())

Reimplemented in PLRenderer::Material, and PLRenderer::Effect.

virtual PLCORE_API bool PLCore::Loadable::Unload ( ) [virtual]
virtual PLCORE_API String PLCore::Loadable::GetLoadableTypeName ( ) const [virtual]
virtual PLCORE_API bool PLCore::Loadable::CallLoadable ( File cFile,
Loader cLoader,
const String sMethod,
const String sParams 
) [protected, virtual]

Calls the loadable in order to load or save.

Parameters:
[in]cFileFile to load from, MUST be opened
[in]cLoaderLoader to use
[in]sMethodName of the method to use
[in]sParamsMethod parameters
Returns:
'true' if all went fine, else 'false'
Note:
  • The default implementation is empty and will return always 'false'

Reimplemented in PLPhysics::SNRagdoll, PLScene::SceneContainer, and PLEngine::Camcorder.


Member Data Documentation

The filename this loadable was given to loaded from

The absolute filename this loadable was loaded from


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


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:16
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported