Line data Source code
1 : /*
2 : *
3 : */
4 :
5 : #ifndef vnsw_agent_factory_hpp
6 : #define vnsw_agent_factory_hpp
7 :
8 : #include <type_traits>
9 : #include <boost/function.hpp>
10 : #include <base/factory.h>
11 : #include <cmn/agent_cmn.h>
12 :
13 : class Agent;
14 : class AgentUveBase;
15 : class KSync;
16 : class DB;
17 : class DBGraph;
18 : class IFMapDependencyManager;
19 : class InstanceManager;
20 : class FlowStatsCollector;
21 : class FlowStatsCollectorObject;
22 : class SessionStatsCollector;
23 : class SessionStatsCollectorObject;
24 : class NexthopManager;
25 : class FlowStatsManager;
26 : struct FlowAgingTableKey;
27 :
28 : struct AgentStaticObjectFactory : public StaticObjectFactory {
29 :
30 : // The overload for FlowStatsCollector (because of references)
31 : template <class Base, class T1, class T2, class T3, class T4, class T5>
32 : static typename FactoryTypes<Base, T1&, int, uint32_t, T2*, uint32_t, T3*, T4*, T5*>::BasePointer
33 6 : CreateRef(T1 &arg1, int arg2, uint32_t arg3, T2* arg4, uint32_t arg5, T3 *arg6, T4 *arg7, T5 *arg8) {
34 : return FactoryRecord<Base, T1&, int, uint32_t, T2*, uint32_t, T3*, T4*, T5*>::
35 6 : create_func_(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8);
36 : }
37 :
38 : // The overload for SessionStatsCollector (because of references)
39 : template <class Base, class T1, class T2, class T3, class T4>
40 : static typename FactoryTypes<Base, T1&, T2*, uint32_t, T3*, T4*>::BasePointer
41 3 : CreateRef(T1 &arg1, T2* arg2, uint32_t arg3, T3 *arg4, T4 *arg5) {
42 : return FactoryRecord<Base, T1&, T2*, uint32_t, T3*, T4*>::
43 3 : create_func_(arg1, arg2, arg3, arg4, arg5);
44 : }
45 :
46 : };
47 :
48 : using AgentSignalRec =
49 : AgentStaticObjectFactory::FactoryRecord<AgentSignal,
50 : EventManager*>;
51 : using IFMapDependencyManagerRec =
52 : AgentStaticObjectFactory::FactoryRecord<IFMapDependencyManager,
53 : DB *, DBGraph *>;
54 :
55 : using InstanceManagerRec =
56 : AgentStaticObjectFactory::FactoryRecord<InstanceManager,
57 : Agent*>;
58 : using NexthopManagerRec =
59 : AgentStaticObjectFactory::FactoryRecord<NexthopManager,
60 : EventManager *, std::string>;
61 : using KSyncRec =
62 : AgentStaticObjectFactory::FactoryRecord<KSync,
63 : Agent*>;
64 :
65 : using FlowStatsCollectorRec =
66 : AgentStaticObjectFactory::FactoryRecord<FlowStatsCollector,
67 : boost::asio::io_service &, int, uint32_t, AgentUveBase *, uint32_t, FlowAgingTableKey *, FlowStatsManager *, FlowStatsCollectorObject *>;
68 : using SessionStatsCollectorRec =
69 : AgentStaticObjectFactory::FactoryRecord<SessionStatsCollector,
70 : boost::asio::io_service&, AgentUveBase *, uint32_t, FlowStatsManager *, SessionStatsCollectorObject *>;
71 : using AgentUveBaseRec =
72 : AgentStaticObjectFactory::FactoryRecord<AgentUveBase,
73 : Agent *, uint64_t, uint32_t, uint32_t>;
74 :
75 : #endif // vnsw_agent_factory_hpp
|