| Visioscan Set SDK Libraries 1.0.28 Visioscan Set SDK Help documentation file for C++ and C++/CLI |

Loading...
Searching...
No Matches
CommunicationException.h
1#pragma once
2#include <string>
3#include "TranscribableException.h"
4#ifdef STARFLEETTOOLBOX_EXPORTS
5#define COMMEXCEPT __declspec(dllexport)
6#else
7#define COMMEXCEPT __declspec(dllimport)
8#endif
9 using namespace std;
10
14 class COMMEXCEPT CommunicationException : exception, public TranscribableException
15{
16 public:
21 explicit CommunicationException(const char* message, const char* translateCode)
22 : _msg(message) {
23 SetTranslateCode(string(translateCode));
24 }
30 explicit CommunicationException(int code, const string& message, string translateCode);
31
36 explicit CommunicationException(const string& message, string translateCode)
37 : _msg(message) {
38 SetTranslateCode(string(translateCode));
39 }
40
45 virtual ~CommunicationException() noexcept {}
46
51 virtual const char* what() const noexcept {
52 return _msg.c_str();
53 }
54
55 int GetErrorCode();
56 protected:
57 string _msg;
58 int _code = -1;
59};
60
CommunicationException
An Exception used when a communication error is detected.
Definition CommunicationException.h:15
CommunicationException::what
virtual const char * what() const noexcept
Overload of message retrie.
Definition CommunicationException.h:51
CommunicationException::CommunicationException
CommunicationException(const char *message, const char *translateCode)
Copy constructor.
Definition CommunicationException.h:21
CommunicationException::~CommunicationException
virtual ~CommunicationException() noexcept
Destructor.
Definition CommunicationException.h:45
CommunicationException::_msg
string _msg
Definition CommunicationException.h:57
CommunicationException::CommunicationException
CommunicationException(const string &message, string translateCode)
Copy constructor.
Definition CommunicationException.h:36