Infinispan HotRod C++ Client  8.3.1.Final
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ServerConfiguration.h
Go to the documentation of this file.
1 /*
2  * ServerConfiguration.h
3  *
4  * Created on: Jul 10, 2013
5  * Author: samuele
6  */
7 
8 #ifndef SERVERCONFIGURATION_H_
9 #define SERVERCONFIGURATION_H_
10 
11 #include <string>
12 #include "infinispan/hotrod/defs.h"
14 
15 namespace infinispan {
16 namespace hotrod {
17 
24 {
25 public:
26  ServerConfiguration(): host(""), port(0) {} // for use just in collections
27  ServerConfiguration(const std::string &_host, int _port): host(_host), port(_port) {}
28 
29  const std::string &getHost() const
30  {
31  return host;
32  }
38  const char *getHostCString() const
39  {
40  return host.data();
41  }
42 
48  const int& getPort() const
49  {
50  return port;
51  }
52 
53 private:
54  std::string host;
55  __pragma(warning(suppress:4251))
56  int port;
57 
58  static void deleteString(std::string *str) { delete str; }
59 };
60 
61 }
62 }
63 #endif /* SERVERCONFIGURATION_H_ */
const std::string & getHost() const
Definition: ServerConfiguration.h:29
ServerConfiguration(const std::string &_host, int _port)
Definition: ServerConfiguration.h:27
#define HR_EXTERN
Definition: ImportExport.h:35
const int & getPort() const
Definition: ServerConfiguration.h:48
const char * getHostCString() const
Definition: ServerConfiguration.h:38
#define __pragma(...)
Definition: defs.h:106
Definition: ServerConfiguration.h:23
ServerConfiguration()
Definition: ServerConfiguration.h:26