Simulated Reality SDK 7500c78d v1.30.2.51085 2024-04-26T11:23:03Z
Stable
exception.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <vector>
13#include <string>
14#include <exception>
15
16#ifdef WIN32
17# ifdef COMPILING_DLL_SimulatedRealityCore
18# define DIMENCOSR_API __declspec(dllexport)
19# else
20# define DIMENCOSR_API __declspec(dllimport)
21# endif
22#else
23# define DIMENCOSR_API
24#endif
25
26namespace SR {
27
28
34#pragma warning(push)
35#pragma warning(disable: 4275)
36
40class DIMENCOSR_API Exception : public std::exception {
41
42public:
46 explicit Exception(const char* message) :
47 errorMessage(message)
48 {
49 }
50
54 explicit Exception(const std::string& message) :
55 errorMessage(message)
56 {}
57
61 virtual ~Exception() throw () {}
62
66 virtual const char* what() const throw () {
67 return errorMessage.c_str();
68 }
69
70protected:
78#pragma warning(suppress: 4251)
79 std::string errorMessage;
80};
81#pragma warning(pop)
82
83
87
88public:
92 DeviceNotAvailableException(std::string deviceIdentifier);
93
97};
98
102
103public:
107};
108}
109
110#undef DIMENCOSR_API
Class of exception which indicates that a hardware device was not available for use in the SR system.
Definition: exception.h:86
DeviceNotAvailableException(std::string deviceIdentifier)
Constructs an instance of DeviceNotAvailableException for a specific device identifier.
DeviceNotAvailableException()
Constructs an instance of DeviceNotAvailableException.
Class of exception which indicates a general SR logic error.
Definition: exception.h:40
std::string errorMessage
Error message.
Definition: exception.h:79
virtual ~Exception()
Destructor. Virtual to allow for subclassing.
Definition: exception.h:61
virtual const char * what() const
Returns a pointer to the (constant) error description.
Definition: exception.h:66
Exception(const char *message)
Constructor (C strings).
Definition: exception.h:46
Exception(const std::string &message)
Constructor (C++ STL strings).
Definition: exception.h:54
Class of Exception which indicates that a SR Service was not available to connect with.
Definition: exception.h:101
ServerNotAvailableException()
Constructs an instance of ServerNotAvailableException.
#define DIMENCOSR_API
Definition: exception.h:23
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:25