OpenSDN source code
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
config_factory.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
3  */
4 #ifndef __CONFIG__CONFIG_FACTORY_H__
5 #define __CONFIG__CONFIG_FACTORY_H__
6 
7 #include <string>
8 #include <vector>
9 
10 #include <boost/function.hpp>
11 #include "base/factory.h"
12 
13 namespace cass { namespace cql { class CqlIf; } }
14 using cass::cql::CqlIf;
15 
16 namespace etcd { namespace etcdql { class EtcdIf; } }
18 
19 class ConfigAmqpChannel;
22 class ConfigEtcdClient;
26 struct ConfigClientOptions;
27 class EventManager;
28 
30 
31 // The overload for ConfigCassandraClient (because of references)
32 template <class Base, class T1, class T2, class T3, class T4>
34 CreateRef(T1* arg1, T2* arg2, const T3& arg3, T4 arg4) {
36  create_func_(arg1, arg2, arg3, arg4);
37 }
38 
39 // The overload for CqlIf (because of references)
40 template <class Base, class T1, class T2, class T3>
41 static typename FactoryTypes<Base, T1*, const T2&, int, const T3&, const T3&, bool, const T3&, bool>::BasePointer
42 CreateRef(T1 *arg1, const T2& arg2, int arg3, const T3& arg4, const T3& arg5, bool arg6, const T3&arg7, bool arg8) {
44  create_func_(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
45 }
46 
47 // The overload for CqlIf (because of references)
48 template <class Base, class T1, class T2, class T3>
49 static typename FactoryTypes<Base, T1*, const T2&, int, const T3&, const T3&, bool, const T3&>::BasePointer
50 CreateRef(T1 *arg1, const T2& arg2, int arg3, const T3& arg4, const T3& arg5, bool arg6, const T3&arg7) {
52  create_func_(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
53 }
54 
55 };
56 
57 using ConfigJsonParserRec =
59 
62 
66  EventManager *,
67  const ConfigClientOptions &,
68  int>;
69 
72  ConfigCassandraClient *,
73  size_t>;
74 
75 using CqlIfRec1 =
77  EventManager *,
78  const std::vector<std::string, std::allocator<std::string>>&,
79  int,
80  const std::string &,
81  const std::string &,
82  bool,
83  const std::string &,
84  bool>;
85 
86 using CqlIfRec2 =
88  EventManager *,
89  const std::vector<std::string, std::allocator<std::string>>&,
90  int,
91  const std::string &,
92  const std::string &,
93  bool,
94  const std::string &>;
95 
96 //template<> struct ConfigStaticObjectFactory::CastTo<ConfigAmqpChannel> {using BaseType = ConfigAmqpChannel;};
97 
98 //To be defined in a corresponding module
99 //template<> struct ConfigStaticObjectFactory::CastTo<ConfigJsonParser> {using BaseType = ConfigJsonParserBase;};
100 
101 //template<> struct ConfigStaticObjectFactory::CastTo<ConfigCassandraClient> {using BaseType = ConfigCassandraClient;};
102 
103 //template<> struct ConfigStaticObjectFactory::CastTo<ConfigCassandraPartition> {using BaseType = ConfigCassandraPartition;};
104 
105 //template<> struct ConfigStaticObjectFactory::CastTo<CqlIf> {using BaseType = CqlIf;};
106 
107 /*
108  Etcd client was disabled in SConscript
109 template<> struct ConfigStaticObjectFactory::CastTo<ConfigEtcdClient> {using BaseType = ConfigEtcdClient;};
110 
111 template<> struct ConfigStaticObjectFactory::CastTo<ConfigEtcdPartition> {using BaseType = ConfigEtcdPartition;};
112 
113 template<> struct ConfigStaticObjectFactory::CastTo<EtcdIf> {using BaseType = EtcdIf;};
114 */
115 
116 #endif // __CONFIG__CONFIG_FACTORY_H__
static FactoryTypes< Base, T1 *, const T2 &, int, const T3 &, const T3 &, bool, const T3 &, bool >::BasePointer CreateRef(T1 *arg1, const T2 &arg2, int arg3, const T3 &arg4, const T3 &arg5, bool arg6, const T3 &arg7, bool arg8)
static FactoryTypes< Base, T1 *, const T2 &, int, const T3 &, const T3 &, bool, const T3 & >::BasePointer CreateRef(T1 *arg1, const T2 &arg2, int arg3, const T3 &arg4, const T3 &arg5, bool arg6, const T3 &arg7)
static FunctionType create_func_
Definition: factory.h:63
static FactoryTypes< Base, T1 *, T2 *, const T3 &, T4 >::BasePointer CreateRef(T1 *arg1, T2 *arg2, const T3 &arg3, T4 arg4)