WSF
WsfCallback.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#ifndef WSFCALLBACK_HPP
13#define WSFCALLBACK_HPP
14
15#include "wsf_export.h"
16
17#include "WsfComponent.hpp"
18#include "WsfObject.hpp"
19class WsfPlatform;
20
27{
28public:
30 ~WsfCallback() override;
31
33
34 WsfComponent* CloneComponent() const override { return Clone(); }
35 WsfStringId GetComponentName() const override { return GetNameId(); }
36 const int* GetComponentRoles() const override;
37 void* QueryInterface(int aRole) override;
39
40 WsfCallback* Clone() const override = 0;
41
42 virtual bool Execute(double aSimTime, WsfPlatform* aPlatformPtr) = 0;
43
44 // Needed to resolve ambiguity between WsfObject and WsfComponent.
45 bool ProcessInput(UtInput& aInput) override { return false; }
46
47 static bool ExecuteAndNotify(double aSimTime, WsfPlatform* aPlatformPtr, WsfStringId aCallbackName);
48
49protected:
50 WsfCallback(const WsfCallback& aSrc);
51
52private:
54 WsfCallback& operator=(const WsfCallback& aRhs) = delete;
55};
56
58
59#endif
#define WSF_DECLARE_COMPONENT_ROLE_TYPE(TYPE, ROLE)
Definition WsfComponentRoles.hpp:44
@ cWSF_COMPONENT_CALLBACK
A 'callback' component (WsfCallback).
Definition WsfComponentRoles.hpp:112
WsfComponentT< WsfPlatform > WsfPlatformComponent
A convenient typedef for a platform component.
Definition WsfComponent.hpp:171
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfCallback.hpp:27
WsfCallback()
Definition WsfCallback.cpp:21
WsfStringId GetComponentName() const override
Definition WsfCallback.hpp:35
virtual bool Execute(double aSimTime, WsfPlatform *aPlatformPtr)=0
WsfComponent * CloneComponent() const override
Definition WsfCallback.hpp:34
bool ProcessInput(UtInput &aInput) override
Definition WsfCallback.hpp:45
WsfCallback * Clone() const override=0
Definition WsfComponent.hpp:39
virtual const int * GetComponentRoles() const =0
virtual void * QueryInterface(int aRole)=0
WsfStringId GetNameId() const
Definition WsfObject.hpp:66
WsfObject()
This is the constructor for the WsfObject class.
Definition WsfObject.cpp:88
virtual WsfObject * Clone() const =0
WsfObject & operator=(const WsfObject &aRhs)
Assignment operator.
Definition WsfObject.cpp:258
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Copyrights Multiple, All Rights Reserved