JBoss Data Grid HotRod C++ Client  6.6.1
 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>
10 
11 namespace infinispan {
12 namespace hotrod {
13 
14 class HR_EXTERN Exception : public std::exception
15 {
16  public:
17  explicit Exception(const std::string& message=std::string()) throw();
18  virtual ~Exception() throw();
19  virtual const char* what() const throw();
20 
21  protected:
23 };
24 
30 {
31  public:
32  explicit HotRodClientException(const std::string&);
33  HotRodClientException(const std::string& message_, uint64_t message_id_, uint8_t status_);
34  virtual ~HotRodClientException() throw();
35  virtual const char* what() const throw();
36  private:
37  uint64_t message_id;
38  uint8_t status;
39 };
40 
47 {
48  public:
49  TransportException(const std::string& host, int port, const std::string&);
50  ~TransportException() throw();
51 
52  const std::string &getHost() const {
53  if (hostPtr.get() == NULL) {
54  const_cast<TransportException *>(this)->hostPtr.set(new std::string(host.c_string()), &deleteString);
55  }
56  return *(hostPtr.get());
57  }
58  const char *getHostCString() const;
59  int getPort() const;
60  private:
61  const portable::string host;
62  __pragma(warning(suppress:4251))
63  portable::local_ptr<std::string> hostPtr;
64  int port;
65 
66  static void deleteString(std::string *str) { delete str; }
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:46
portable::string message
Definition: exceptions.h:22
const std::string & getHost() const
Definition: exceptions.h:52
Definition: exceptions.h:95
#define __pragma(...)
Definition: defs.h:114
Definition: exceptions.h:14
Definition: portable.h:47