Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | Related Pages

LoadableEntity Class Reference

#include <loadableentity.h>

Inheritance diagram for LoadableEntity:

Inheritance graph
[legend]
Collaboration diagram for LoadableEntity:

Collaboration graph
[legend]
List of all members.

Detailed Description

Interface for object which can be loaded A loadable entity can load its data from a file. Derived classes only needs to implement the LoadNode method, file locating/opening/closing is handled automatically by the this base class Load methods.

If the derived class needs to keep the file open, it should set the m_bKeepFile flag to true before returning from the LoadNode method.

This base class also keeps track of redundant multiple calls to load and object that has already been loaded.

Author:
Mattias Jansson (mattias@realityrift.com)


Public Member Functions

 LoadableEntity (FileManager *pkFileManager=0)
virtual ~LoadableEntity ()
void SetFileManager (FileManager *pkManager)
bool Load (const std::string &rstrFilename, unsigned int uiFlags=0, bool bForceReload=false, bool bSearchFileSystem=false)
bool Load (File *pkFile, unsigned int uiFlags=0, bool bForceReload=false)

Protected Member Functions

virtual bool LoadNode (unsigned int uiFlags=0)=0

Protected Attributes

Filem_pkFile
bool m_bLoaded
bool m_bKeepFile
FileManagerm_pkFileManager


Constructor & Destructor Documentation

LoadableEntity FileManager pkFileManager = 0  ) 
 

Parameters:
pkFileManager Ptr to file manager, will use core file manager if null (default)

virtual ~LoadableEntity  )  [virtual]
 


Member Function Documentation

virtual bool LoadNode unsigned int  uiFlags = 0  )  [protected, pure virtual]
 

Main loader method. Called by LoadableEntity to load object if file was opened successfully

Parameters:
uiFlags Flags passed by caller to Load() method
Returns:
true if load was successful, false otherwise

Implemented in Config, Font, Package, and Program.

void SetFileManager FileManager pkManager  ) 
 

Set new file manager object

Parameters:
pkManager Ptr to file manager object

bool Load const std::string &  rstrFilename,
unsigned int  uiFlags = 0,
bool  bForceReload = false,
bool  bSearchFileSystem = false
 

Load resource

Parameters:
rstrFilename Filename
uiFlags Flags to pass to loader
bForceReload Force reload if already loaded (default false)
bSearchFileSystem Look in normal file system for file if not found in file manager (default false)
Returns:
true if successful (or already loaded and not force flag set), false otherwise (load/reload failed)

bool Load File pkFile,
unsigned int  uiFlags = 0,
bool  bForceReload = false
 

Load resource

Parameters:
pkFile File object
uiFlags Flags to pass to loader
bForceReload Force reload if already loaded
Returns:
true if successful (or already loaded and not force flag set), false otherwise (load/reload failed)


Member Data Documentation

File* m_pkFile [protected]
 

File

bool m_bLoaded [protected]
 

Flag indicating node is loaded

bool m_bKeepFile [protected]
 

Flag to block file deletion on load completion

FileManager* m_pkFileManager [protected]
 

File manager


The documentation for this class was generated from the following file:
Generated on Wed Jan 21 14:21:11 2004 for NeoEngine by doxygen 1.3.5