OpenSDN source code
config_factory.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017 Juniper Networks, Inc. All rights reserved.
3  * Copyright Contributors to the OpenSDN project
4  */
5 #ifndef __CONFIG__CONFIG_FACTORY_H__
6 #define __CONFIG__CONFIG_FACTORY_H__
7 
8 #include <string>
9 #include <vector>
10 
11 #include <boost/function.hpp>
12 #include "base/factory.h"
13 
14 namespace cass { namespace cql { class CqlIf; } }
15 using cass::cql::CqlIf;
16 
17 namespace etcd { namespace etcdql { class EtcdIf; } }
19 
20 class ConfigAmqpChannel;
23 class ConfigEtcdClient;
27 struct ConfigClientOptions;
28 class EventManager;
29 
31 
32 // The overload for ConfigCassandraClient (because of references)
33 template <class Base, class T1, class T2, class T3, class T4>
35 CreateRef(T1* arg1, T2* arg2, const T3& arg3, T4 arg4) {
37  create_func_(arg1, arg2, arg3, arg4);
38 }
39 
40 // The overload for CqlIf (because of references)
41 template <class Base, class T1, class T2, class T3>
43 CreateRef(T1 *arg1, const T2& arg2, int arg3, const T3& arg4, const T3& arg5, bool arg6, const T3&arg7, bool arg8) {
45  create_func_(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
46 }
47 
48 // The overload for CqlIf (because of references)
49 template <class Base, class T1, class T2, class T3>
51 CreateRef(T1 *arg1, const T2& arg2, int arg3, const T3& arg4, const T3& arg5, bool arg6, const T3&arg7) {
53  create_func_(arg1, arg2, arg3, arg4, arg5, arg6, arg7);
54 }
55 
56 };
57 
60 
63 
67  EventManager *,
68  const ConfigClientOptions &,
69  int>;
70 
74  size_t>;
75 
76 using CqlIfRec1 =
78  EventManager *,
79  const std::vector<std::string, std::allocator<std::string>>&,
80  int,
81  const std::string &,
82  const std::string &,
83  bool,
84  const std::string &,
85  bool>;
86 
87 using CqlIfRec2 =
89  EventManager *,
90  const std::vector<std::string, std::allocator<std::string>>&,
91  int,
92  const std::string &,
93  const std::string &,
94  bool,
95  const std::string &>;
96 
97 //template<> struct ConfigStaticObjectFactory::CastTo<ConfigAmqpChannel> {using BaseType = ConfigAmqpChannel;};
98 
99 //To be defined in a corresponding module
100 //template<> struct ConfigStaticObjectFactory::CastTo<ConfigJsonParser> {using BaseType = ConfigJsonParserBase;};
101 
102 //template<> struct ConfigStaticObjectFactory::CastTo<ConfigCassandraClient> {using BaseType = ConfigCassandraClient;};
103 
104 //template<> struct ConfigStaticObjectFactory::CastTo<ConfigCassandraPartition> {using BaseType = ConfigCassandraPartition;};
105 
106 //template<> struct ConfigStaticObjectFactory::CastTo<CqlIf> {using BaseType = CqlIf;};
107 
108 /*
109  Etcd client was disabled in SConscript
110 template<> struct ConfigStaticObjectFactory::CastTo<ConfigEtcdClient> {using BaseType = ConfigEtcdClient;};
111 
112 template<> struct ConfigStaticObjectFactory::CastTo<ConfigEtcdPartition> {using BaseType = ConfigEtcdPartition;};
113 
114 template<> struct ConfigStaticObjectFactory::CastTo<EtcdIf> {using BaseType = EtcdIf;};
115 */
116 
117 #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 FactoryTypes< Base, T1 *, T2 *, const T3 &, T4 >::BasePointer CreateRef(T1 *arg1, T2 *arg2, const T3 &arg3, T4 arg4)
static FunctionType create_func_
Definition: factory.h:64