AOSharedServiceLibrary
factory_redis.h
1 /*
2 MIT License Block
3 
4 Copyright (c) 2016 Alex Barry
5 
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to deal
8 in the Software without restriction, including without limitation the rights
9 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12 
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 THE SOFTWARE.
23 */
24 
25 #ifndef AOSSL_REDIS_INCLUDE_FACTORY_REDIS_H_
26 #define AOSSL_REDIS_INCLUDE_FACTORY_REDIS_H_
27 
28 #include <string>
29 #include "redis_interface.h"
30 #include "redis_admin.h"
31 
33 
39  public:
42 
45 
47  inline RedisInterface* get_redis_interface(std::string hostname, int port, \
48  int timeout_seconds, int timeout_microseconds) {
49  return new RedisAdmin(hostname, port, \
50  timeout_seconds, timeout_microseconds);
51  }
52 
54  inline RedisInterface* get_redis_interface(std::string hostname, int port) {
55  return new RedisAdmin(hostname, port);
56  }
57 
59  inline RedisInterface* get_redis_interface(std::string hostname, \
60  int port, int pool_size) {
61  return new RedisAdmin(hostname, port, pool_size);
62  }
63 
65  inline RedisInterface* get_redis_interface(std::string hostname, int port, \
66  int timeout_seconds, int timeout_microseconds, int pool_size) {
67  return new RedisAdmin(hostname, port, \
68  timeout_seconds, timeout_microseconds, pool_size);
69  }
70 
72  inline RedisInterface* get_redis_interface(std::string hostname, int port, \
73  int timeout_seconds, int timeout_microseconds, int pool_size, \
74  int pstart_size, int pbatch) {
75  return new RedisAdmin(hostname, port, \
76  timeout_seconds, timeout_microseconds, pool_size, pstart_size, pbatch);
77  }
78 
81  return new RedisAdmin(connection_list);
82  }
83 
86  int pool_size) {
87  return new RedisAdmin(connection_list, pool_size);
88  }
89 
92  int pool_size, int pstart_size, int pbatch) {
93  return new RedisAdmin(connection_list, pool_size, pstart_size, pbatch);
94  }
95 };
96 
97 #endif // AOSSL_REDIS_INCLUDE_FACTORY_REDIS_H_
The Redis Service Component Factory.
Definition: factory_redis.h:38
A Structure for storing Redis Connection Information.
Definition: redis_interface.h:90
The Redis Admin.
Definition: redis_interface.h:117
~RedisComponentFactory()
Delete a Service Component Factory.
Definition: factory_redis.h:44
RedisInterface * get_redis_interface(RedisConnChain connection_list, int pool_size, int pstart_size, int pbatch)
Get a Redis Interface Instance.
Definition: factory_redis.h:91
RedisInterface * get_redis_interface(RedisConnChain connection_list)
Get a Redis Interface Instance.
Definition: factory_redis.h:80
RedisInterface * get_redis_interface(std::string hostname, int port, int pool_size)
Get a Redis Interface Instance.
Definition: factory_redis.h:59
RedisInterface * get_redis_interface(std::string hostname, int port, int timeout_seconds, int timeout_microseconds, int pool_size)
Get a Redis Interface Instance.
Definition: factory_redis.h:65
RedisComponentFactory()
Create a new Service Component Factory.
Definition: factory_redis.h:41
RedisInterface * get_redis_interface(std::string hostname, int port, int timeout_seconds, int timeout_microseconds)
Get a Redis Interface Instance.
Definition: factory_redis.h:47
RedisInterface * get_redis_interface(RedisConnChain connection_list, int pool_size)
Get a Redis Interface Instance.
Definition: factory_redis.h:85
RedisInterface * get_redis_interface(std::string hostname, int port)
Get a Redis Interface Instance.
Definition: factory_redis.h:54
RedisInterface * get_redis_interface(std::string hostname, int port, int timeout_seconds, int timeout_microseconds, int pool_size, int pstart_size, int pbatch)
Get a Redis Interface Instance.
Definition: factory_redis.h:72