WSF
WsfDisPduFactory.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing 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// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFDISPDUFACTORY_HPP
16#define WSFDISPDUFACTORY_HPP
17
18#include "wsf_export.h"
19
20#include "DisPduFactory.hpp"
21class WsfDisInterface;
22
23class WSF_EXPORT WsfDisPduFactory : public DisPduFactory
24{
25public:
26 WsfDisPduFactory(WsfDisInterface* aInterfacePtr);
27 ~WsfDisPduFactory() override;
28
29 // User overrides this method to create their own DIS classes
30 DisPdu* UserCreate(DisPdu& aDisPdu, GenI& aGenI) override;
31
33 {
34 public:
35 virtual ~CreateFunction() {}
36 virtual DisPdu* Create(DisPdu& aDisPdu, GenI& aGenI, WsfDisInterface* aInterfacePtr) = 0;
37 };
38
39
40 template<typename T>
42 {
43 public:
44 DisPdu* Create(DisPdu& aDisPdu, GenI& aGenI, WsfDisInterface* aInterfacePtr) override
45 {
46 return new T(aDisPdu, aGenI, aInterfacePtr);
47 }
48 };
49
50 void SetPduCreateFunction(int aPduType, CreateFunction* aFunctionPtr);
51
52protected:
54
55 std::vector<CreateFunction*> mCreateFunctions;
56};
57
58#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfDisInterface.hpp:83
Definition WsfDisPduFactory.hpp:42
DisPdu * Create(DisPdu &aDisPdu, GenI &aGenI, WsfDisInterface *aInterfacePtr) override
Definition WsfDisPduFactory.hpp:44
Definition WsfDisPduFactory.hpp:33
virtual DisPdu * Create(DisPdu &aDisPdu, GenI &aGenI, WsfDisInterface *aInterfacePtr)=0
virtual ~CreateFunction()
Definition WsfDisPduFactory.hpp:35
WsfDisInterface * mInterfacePtr
Definition WsfDisPduFactory.hpp:53
DisPdu * UserCreate(DisPdu &aDisPdu, GenI &aGenI) override
Definition WsfDisPduFactory.cpp:108
std::vector< CreateFunction * > mCreateFunctions
Definition WsfDisPduFactory.hpp:55
WsfDisPduFactory(WsfDisInterface *aInterfacePtr)
Definition WsfDisPduFactory.cpp:55
Copyrights Multiple, All Rights Reserved