MeVisLabToolboxReference
ml::olSpecializedLoader Class Reference

Base class for all loader-plugins. More...

#include <ObjLoader/mlObjLoaderFrame.h>

List of all members.

Public Member Functions

virtual ~olSpecializedLoader ()
 Destructor.
bool suppressErrorLog () const
 Suppress error messages to console if 'true'.
void setSuppressErrorLog (bool trueOrFalse)
 Suppress error messages to console if 'true'.
bool sawErrors () const
 Returns 'true' if an error occured.
void resetErrors ()
 Reset error flag.
virtual bool isValidHeader (const char *header, const size_t length)=0
 This member is called with a pointer (header) to the first length bytes of the file to be loaded.
virtual void readDoc (const std::string &infoFile, omObjectContainer &oc, bool accumulate)
 readDoc() is called with the filename of the file to be loaded and a reference to the object container.
virtual const std::string getName () const =0
 Returns a string with the name of the loader (e.g. ObjDump)
virtual const std::string miscInfo ()
 Returns loader-specific information that has been stored in the _miscInfo class member.

Protected Member Functions

 olSpecializedLoader ()
 Constructor.

Protected Attributes

bool _suppressErrorLog
 Error messages to console should be suppressed if _suppressErrorLog is 'true'.
bool _sawErrors
 _sawErrors is set if any errors occured, and is queryable via the sawErrors() method.
std::string _infoFileDirectory
 Stores the info file directory which is used by olFullPath to construct paths to files that are located beneath the infofiles directory in the directory structure.
std::string _miscInfo
 Loader-specific misc.

Friends

class olFullPath

Detailed Description

Base class for all loader-plugins.

Definition at line 37 of file mlObjLoaderFrame.h.


Constructor & Destructor Documentation

ml::olSpecializedLoader::olSpecializedLoader ( ) [protected]

Constructor.

virtual ml::olSpecializedLoader::~olSpecializedLoader ( ) [virtual]

Destructor.


Member Function Documentation

virtual const std::string ml::olSpecializedLoader::getName ( ) const [pure virtual]

Returns a string with the name of the loader (e.g. ObjDump)

virtual bool ml::olSpecializedLoader::isValidHeader ( const char *  header,
const size_t  length 
) [pure virtual]

This member is called with a pointer (header) to the first length bytes of the file to be loaded.

It returns true if the file type is known an can be interpreted by the loader. Otherwise false is returned and the next loader is called.

virtual const std::string ml::olSpecializedLoader::miscInfo ( ) [inline, virtual]

Returns loader-specific information that has been stored in the _miscInfo class member.

Definition at line 102 of file mlObjLoaderFrame.h.

virtual void ml::olSpecializedLoader::readDoc ( const std::string &  infoFile,
omObjectContainer oc,
bool  accumulate 
) [virtual]

readDoc() is called with the filename of the file to be loaded and a reference to the object container.

The member is responsible for the object container. If it fails for whatever reason, the object container must be left in a consistent state. If the accumulate parameter is true, the main loader has not cleared the object container. Inherited classes must call its parent implementation of readDoc() in front.

void ml::olSpecializedLoader::resetErrors ( ) [inline]

Reset error flag.

Definition at line 83 of file mlObjLoaderFrame.h.

bool ml::olSpecializedLoader::sawErrors ( ) const [inline]

Returns 'true' if an error occured.

Definition at line 81 of file mlObjLoaderFrame.h.

void ml::olSpecializedLoader::setSuppressErrorLog ( bool  trueOrFalse) [inline]

Suppress error messages to console if 'true'.

Definition at line 78 of file mlObjLoaderFrame.h.

bool ml::olSpecializedLoader::suppressErrorLog ( ) const [inline]

Suppress error messages to console if 'true'.

Definition at line 76 of file mlObjLoaderFrame.h.


Friends And Related Function Documentation

friend class olFullPath [friend]

Definition at line 41 of file mlObjLoaderFrame.h.


Member Data Documentation

Stores the info file directory which is used by olFullPath to construct paths to files that are located beneath the infofiles directory in the directory structure.

Definition at line 61 of file mlObjLoaderFrame.h.

Referenced by ml::olFullPath::olFullPath().

std::string ml::olSpecializedLoader::_miscInfo [protected]

Loader-specific misc.

information (e.g. the name of the application that wrote the info file) This information must be provided by the specialized loader.

Definition at line 65 of file mlObjLoaderFrame.h.

_sawErrors is set if any errors occured, and is queryable via the sawErrors() method.

Definition at line 56 of file mlObjLoaderFrame.h.

Error messages to console should be suppressed if _suppressErrorLog is 'true'.

_suppressErrorLog can be set via setSuppressErrorLog() and queried via the suppressErrorLog() method.

Definition at line 52 of file mlObjLoaderFrame.h.


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