NX Open C++ 参考指南 2406 v1.1
载入中...
搜索中...
未找到
NXException.hxx
1/*******************************************************************************
2 Copyright (c) 2003 Unigraphics Solutions Inc.
3 Unpublished - All Rights Reserved
4*******************************************************************************/
5#ifndef NXOpen_NXEXCEPTION_HXX_INCLUDED
6#define NXOpen_NXEXCEPTION_HXX_INCLUDED
7#ifdef _MSC_VER
8#pragma once
9#endif
10#include <exception>
11#include <string>
12#include <NXOpen/libnxopencpp_exports.hxx>
13#ifdef _MSC_VER
14#pragma warning(push)
15#pragma warning(disable:4251)
16#endif
17namespace NXOpen
18{
19 class NXExceptionImpl;
21 class NXOPENCPPEXPORT NXException : public std::exception
22 {
23 public:
24 NXException() = delete;
25 NXException& operator=(const NXException&) = delete;
27 NXException(const NXException &other) noexcept;
29 virtual ~NXException() noexcept;
31 static NXException Create(int errorCode);
34 static NXException Create(const char* message);
36 static NXException Create(int errorCode, const char* message );
38 static void ThrowBadTagException();
39 static void ThrowUnexpectedSuccess();
41
42 const char* Message() const;
45 virtual const char * what () const throw () { return Message(); }
47 int ErrorCode() const;
49 void AssertErrorCode(int code) const;
50 private:
51 explicit NXException(int errorCode);
52 explicit NXException(const char *message);
53 explicit NXException(int errorCode, const char *message);
54 NXExceptionImpl* m_impl;
55 };
56}
57#ifdef _MSC_VER
58#pragma warning(pop)
59#endif
60#undef EXPORTLIBRARY
61#endif // NXEXCEPTION_HXX_INCLUDED