Infinispan HotRod C++ Client  8.2.1.Final
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
exceptions.h
Go to the documentation of this file.
1 #ifndef ISPN_HOTROD_EXCEPTIONS_H
2 #define ISPN_HOTROD_EXCEPTIONS_H
3 
4 #include <exception>
5 #include <string>
6 #include <stdint.h>
9 
10 namespace infinispan {
11 namespace hotrod {
12 
13 class HR_EXTERN Exception : public std::exception
14 {
15  public:
16  explicit Exception(const std::string& message=std::string()) throw();
17  virtual ~Exception() throw();
18  virtual const char* what() const throw();
19 
20  protected:
21  std::string message;
22 };
23 
28 class HR_EXTERN HotRodClientException : public Exception
29 {
30  public:
31  explicit HotRodClientException(const std::string&);
32  HotRodClientException(const std::string& message_, uint64_t message_id_, uint8_t status_);
33  virtual ~HotRodClientException() throw();
34  virtual const char* what() const throw();
35  private:
36  uint64_t message_id;
37  uint8_t status;
38 };
39 
46 {
47  public:
48  TransportException(const std::string& host, int port, const std::string&, int);
49  ~TransportException() throw();
50 
51  const std::string &getHost() const {
52  if (hostPtr.get() == NULL) {
53  const_cast<TransportException *>(this)->hostPtr.reset(new std::string(host.c_str()));
54  }
55  return *(hostPtr.get());
56  }
57  const char *getHostCString() const;
58  int getPort() const;
59  int getErrnum() const { return errnum; }
60  private:
61  const std::string host;
62  __pragma(warning(suppress:4251))
63  std::shared_ptr<std::string> hostPtr;
64  int port;
65 
66  int errnum;
67 };
68 
75 {
76  public:
77  InvalidResponseException(const std::string&);
78 };
79 
86 {
87  public:
88  RemoteNodeSuspectException(const std::string&, uint64_t message_id, uint8_t status);
89 };
90 
96 {
97  public:
98  InternalException(const std::string&);
99 };
100 
108 {
109  public:
110  RemoteCacheManagerNotStartedException(const std::string&);
111 };
112 
118 {
120 };
121 
122 }} // namespace
123 
124 #endif /* ISPN_HOTROD_EXCEPTIONS_H */
#define HR_EXTERN
Definition: ImportExport.h:35
Definition: exceptions.h:45
int getErrnum() const
Definition: exceptions.h:59
const std::string & getHost() const
Definition: exceptions.h:51
Definition: exceptions.h:95
#define __pragma(...)
Definition: defs.h:106