1 | // |
---|---|
2 | // Type.h |
3 | // |
4 | // Library: Redis |
5 | // Package: Redis |
6 | // Module: Type |
7 | // |
8 | // Implementation of the Type class. |
9 | // |
10 | // Copyright (c) 2015, Applied Informatics Software Engineering GmbH. |
11 | // and Contributors. |
12 | // |
13 | // SPDX-License-Identifier: BSL-1.0 |
14 | // |
15 | |
16 | |
17 | #include "Poco/Redis/Type.h" |
18 | #include "Poco/Redis/Error.h" |
19 | #include "Poco/Redis/Array.h" |
20 | |
21 | |
22 | namespace Poco { |
23 | namespace Redis { |
24 | |
25 | |
26 | RedisType::RedisType() |
27 | { |
28 | } |
29 | |
30 | |
31 | RedisType::~RedisType() |
32 | { |
33 | } |
34 | |
35 | |
36 | RedisType::Ptr RedisType::createRedisType(char marker) |
37 | { |
38 | RedisType::Ptr result; |
39 | |
40 | switch(marker) |
41 | { |
42 | case RedisTypeTraits<Int64>::marker : |
43 | result = new Type<Int64>(); |
44 | break; |
45 | case RedisTypeTraits<std::string>::marker : |
46 | result = new Type<std::string>(); |
47 | break; |
48 | case RedisTypeTraits<BulkString>::marker : |
49 | result = new Type<BulkString>(); |
50 | break; |
51 | case RedisTypeTraits<Array>::marker : |
52 | result = new Type<Array>(); |
53 | break; |
54 | case RedisTypeTraits<Error>::marker : |
55 | result = new Type<Error>(); |
56 | break; |
57 | } |
58 | return result; |
59 | } |
60 | |
61 | |
62 | } } // namespace Poco::Redis |
63 |