LeiaSR SDK 720218b2 v1.32.7.6322 2025-02-13T14:55:38Z
Stable
exception.h
Go to the documentation of this file.
1
5#pragma once
6
7#include <vector>
8#include <string>
9#include <exception>
10
11#ifdef WIN32
12# ifdef COMPILING_DLL_SimulatedRealityCore
13# define DIMENCOSR_API __declspec(dllexport)
14# else
15# define DIMENCOSR_API __declspec(dllimport)
16# endif
17#else
18# define DIMENCOSR_API
19#endif
20
21namespace SR {
22
23
29#pragma warning(push)
30#pragma warning(disable: 4275)
31
35class DIMENCOSR_API Exception : public std::exception {
36
37public:
41 explicit Exception(const char* message) :
42 errorMessage(message)
43 {
44 }
45
49 explicit Exception(const std::string& message) :
50 errorMessage(message)
51 {}
52
56 virtual ~Exception() throw () {}
57
61 virtual const char* what() const throw () {
62 return errorMessage.c_str();
63 }
64
65protected:
73#pragma warning(suppress: 4251)
74 std::string errorMessage;
75};
76#pragma warning(pop)
77
78
82
83public:
87 DeviceNotAvailableException(std::string deviceIdentifier);
88
92};
93
97
98public:
102};
103}
104
105#undef DIMENCOSR_API
Class of exception which indicates that a hardware device was not available for use in the SR system.
Definition: exception.h:81
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:35
std::string errorMessage
Error message.
Definition: exception.h:74
virtual ~Exception()
Destructor. Virtual to allow for subclassing.
Definition: exception.h:56
virtual const char * what() const
Returns a pointer to the (constant) error description.
Definition: exception.h:61
Exception(const char *message)
Constructor (C strings).
Definition: exception.h:41
Exception(const std::string &message)
Constructor (C++ STL strings).
Definition: exception.h:49
Class of Exception which indicates that a SR Service was not available to connect with.
Definition: exception.h:96
ServerNotAvailableException()
Constructs an instance of ServerNotAvailableException.
#define DIMENCOSR_API
Definition: exception.h:18
Namespace containing all C++ Simulated Reality classes.
Definition: srconfiguration.h:20