1 //******************************************************************
3 // Copyright 2014 Intel Corporation All Rights Reserved.
4 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
6 #ifndef _WRAPPER_FACTORY_H_
7 #define _WRAPPER_FACTORY_H_
11 #include "IClientWrapper.h"
12 #include "IServerWrapper.h"
13 #include <OutOfProcClientWrapper.h>
14 #include <InProcClientWrapper.h>
15 #include <OutOfProcServerWrapper.h>
16 #include <InProcServerWrapper.h>
20 // Interface to permit easier mocking/unit testing later
24 typedef std::shared_ptr<IWrapperFactory> Ptr;
26 virtual IClientWrapper::Ptr CreateClientWrapper(PlatformConfig cfg) =0;
27 virtual IServerWrapper::Ptr CreateServerWrapper(PlatformConfig cfg) =0;
28 virtual ~IWrapperFactory(){}
31 // Class to create the client/server object!
32 class WrapperFactory : public IWrapperFactory
37 virtual IClientWrapper::Ptr CreateClientWrapper(PlatformConfig cfg)
39 switch(cfg.serviceType)
41 case ServiceType::InProc:
42 return std::make_shared<InProcClientWrapper>(cfg);
44 case ServiceType::OutOfProc:
45 return std::make_shared<OutOfProcClientWrapper>(cfg);
51 virtual IServerWrapper::Ptr CreateServerWrapper(PlatformConfig cfg)
53 switch(cfg.serviceType)
55 case ServiceType::InProc:
56 return std::make_shared<InProcServerWrapper>(cfg);
58 case ServiceType::OutOfProc:
59 // return std::make_shared<OutOfProcServerWrapper>(cfg);
65 virtual ~WrapperFactory(){}