WSF
WsfUCI_FactoryService.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI//REL TO USA ONLY
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2019 Infoscitex, a DCS Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFUCI_FACTORYSERVICE_HPP
13#define WSFUCI_FACTORYSERVICE_HPP
14
16
17#include "uci/base/AbstractServiceBusConnection.h"
18
19namespace wsf
20{
22 template< class MessageType,
23 class FactoryType >
25 {
26 public:
27 explicit UCI_FactoryService(uci::base::AbstractServiceBusConnection* aAsbPtr)
29 mFactoryPtr(FactoryType::getFactory(aAsbPtr))
30 {
31 }
33 {
34 }
37 const UCI_FactoryService& operator=(const UCI_FactoryService& aRhs) = delete;
38
39 FactoryType& GetFactory() const { return *mFactoryPtr; }
40 void Shutdown()
41 {
42 FactoryType::destroyFactory(mFactoryPtr);
43 }
44
45 protected:
46
47 FactoryType* mFactoryPtr = nullptr;
48 };
49
50}
51
52#endif
FactoryType & GetFactory() const
Definition WsfUCI_FactoryService.hpp:39
FactoryType * mFactoryPtr
Definition WsfUCI_FactoryService.hpp:47
void Shutdown()
Definition WsfUCI_FactoryService.hpp:40
const UCI_FactoryService & operator=(const UCI_FactoryService &aRhs)=delete
UCI_FactoryService(uci::base::AbstractServiceBusConnection *aAsbPtr)
Definition WsfUCI_FactoryService.hpp:27
virtual ~UCI_FactoryService()
Definition WsfUCI_FactoryService.hpp:32
UCI_FactoryService(const UCI_FactoryService &aSrc)=delete
UCI_ServiceBase()=default
Function definitions for those who need run-time access to the version.
Definition WsfComm.cpp:32
Copyrights Multiple, All Rights Reserved