/inc/vgs/project/error.h
C Header | 102 lines | 68 code | 17 blank | 17 comment | 0 complexity | 89d849a76bb22a279ba657e34a14cebb MD5 | raw file
- /*
- * error.h --
- *
- * Copyright (C) 1997-2010 by Volume Graphics GmbH. All Rights Reserved.
- *
- * This is unpublished proprietary source code of Volume Graphics
- * GmbH. The contents of this file may not be disclosed to third
- * parties, copied or duplicated in any form, in whole or in part,
- * without the prior written permission of Volume Graphics GmbH.
- * For further regulations see the file "license.rtf".
- *
- * Creator: Jens Frederich <frederich@volumegraphics.com>
- *
- * @(#) $Id: error.h 39119 2010-03-01 09:58:19Z frederich $
- */
- #ifndef _VGS_PROJECT_ERROR_H_
- #define _VGS_PROJECT_ERROR_H_
- // stdc++
- #include <string>
- // Component
- #include <vgs/project/common.h>
- namespace VGS { namespace Project
- {
- class VGS_PROJECT_EXPORT Error
- {
- public:
- enum ErrorCode
- {
- NoError = __ERROR_FIRST_ENUM,
- GenericError,
- OutOfMemory,
- InvalidArgument,
- InvalidEnum,
- FileNotFound,
- PermissionDenied,
- UnableToCreateFolder,
- UnableToDeleteFolder,
- UnableToFindProjectConverter,
- UnableToSaveProject,
- UnableToLoadProject,
- InvalidResolution,
- InvalidVoxelSkip,
- InvalidFileFormat,
- InvalidFileName,
- InvalidSize,
- InvalidDataType,
- InvalidFileCount,
- InvalidPositions,
- GenericRemoteControlError,
- InvalidRemoteHandle,
- RemoteControlServiceIsNotAvailable,
- MaximumNumberOfApplicationInstancesIsReached,
- UnableToCreateApplication,
- UnableToTerminateApplication,
- ApplicationIsBusy,
- NoTaskToAbort,
- GenericLicenseError,
- ApplicationIsUnexpectedlyClosed,
- ApplicationHasNoMacroSupport
- };
- public:
- static bool emitError (ErrorCode e);
- static ErrorCode getLastError ();
- static bool resetLastError ();
- static std::string getErrorDescription (ErrorCode e);
- public:
- class Callback
- {
- public:
- virtual ~Callback () {}
- public:
- virtual bool callback (const ErrorCode& message) = 0;
- };
- static bool setErrorCallback (Error::Callback* callback);
- static Error::Callback* getErrorCallback ();
- private:
- Error ();
- Error (const Error&);
- Error& operator = (const Error&);
- ~Error ();
- private:
- VGL_PRIVATE_DATA;
- };
- } } // VGS::Project
- #endif // _VGS_PROJECT_ERROR_H_