WSF
WsfBMTrackScriptCallbackHandler.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// The use, dissemination or disclosure of data in this file is subject to
7// limitation or restriction. See accompanying README and LICENSE for details.
8// ****************************************************************************
9/*******************************************************************************
10*
11* File: WsfBMTrackScriptCallbackHandler.hpp
12*
13* Classification: UNCLASSIFIED
14*
15* Details:
16*
17* Contract Number:
18* Contractor Name: Radiance Technologies
19* Address: 350 Wynn Drive
20* Huntsville, AL 35805
21*
22* Abstract: This class is used for dispatching track handler callbacks from
23* an external source to a registered processor script function. This is to
24* get around a limitation where the WsfPerceptionProcessor is silently deleting
25* tracks when it gets a delete vs. notifying users of the processor.
26*
27* Beware of a race condition between this invocation and the any other processors.
28* It is not safe to assume you can reference the perception processor for this
29* track because you don't know the order of the callback invocations.
30*
31*******************************************************************************/
32
33#ifndef WSF_BM_TRACK_SCRIPT_CALLBACK_HANDLER_HPP
34#define WSF_BM_TRACK_SCRIPT_CALLBACK_HANDLER_HPP
35
36#include <WsfBMCommon.hpp>
39#include <UtScript.hpp>
40#include <WsfLocalTrack.hpp>
41
43{
44 public:
46
47 WSF_IADS_C2_LIB_EXPORT virtual bool Initialize(WsfScriptProcessor* proc, const std::string& script_handler_fun, const std::string& ret_type, const std::string& arguments_signature);
48
49 WSF_IADS_C2_LIB_EXPORT virtual bool Initialized() const;
50
51 protected:
53
56 UtScript* m_script;
57};
58
59// Can be used for callbacks that get invokes with only a local track (track drop is an example)
61{
62 public:
64
65 bool Initialize(WsfScriptProcessor* proc, const std::string& script_handler_fun);
66
67 bool Invoke(double aSimTime, const WsfLocalTrack* aLocalTrackPtr);
68};
69
70// Used for callbacks that include a local and remote track (local track initiated and updated for instance)
72{
73 public:
75
76 bool Initialize(WsfScriptProcessor* proc, const std::string& script_handler_fun);
77
78 bool Invoke(double aSimTime, const WsfLocalTrack* aLocalTrackPtr, const WsfTrack* aRawTrackPtr);
79};
80
81#endif
virtual WSF_IADS_C2_LIB_EXPORT bool Initialized() const
Definition WsfBMTrackScriptCallbackHandler.cpp:73
WsfBMTrackScriptCallbackHandler()
Definition WsfBMTrackScriptCallbackHandler.cpp:38
WsfScriptContext & GetContext()
Definition WsfBMTrackScriptCallbackHandler.cpp:78
bool m_initialized
Definition WsfBMTrackScriptCallbackHandler.hpp:54
WsfScriptProcessor * m_proc
Definition WsfBMTrackScriptCallbackHandler.hpp:55
UtScript * m_script
Definition WsfBMTrackScriptCallbackHandler.hpp:56
virtual WSF_IADS_C2_LIB_EXPORT bool Initialize(WsfScriptProcessor *proc, const std::string &script_handler_fun, const std::string &ret_type, const std::string &arguments_signature)
Definition WsfBMTrackScriptCallbackHandler.cpp:45
WsfBMTrackScriptLocalHandler()
Definition WsfBMTrackScriptCallbackHandler.cpp:86
bool Invoke(double aSimTime, const WsfLocalTrack *aLocalTrackPtr)
Definition WsfBMTrackScriptCallbackHandler.cpp:96
bool Initialize(WsfScriptProcessor *proc, const std::string &script_handler_fun)
Definition WsfBMTrackScriptCallbackHandler.cpp:91
bool Invoke(double aSimTime, const WsfLocalTrack *aLocalTrackPtr, const WsfTrack *aRawTrackPtr)
Definition WsfBMTrackScriptCallbackHandler.cpp:133
bool Initialize(WsfScriptProcessor *proc, const std::string &script_handler_fun)
Definition WsfBMTrackScriptCallbackHandler.cpp:128
WsfBMTrackScriptRemoteHandler()
Definition WsfBMTrackScriptCallbackHandler.cpp:123
Definition WsfLocalTrack.hpp:32
Definition WsfScriptContext.hpp:71
Definition WsfScriptProcessor.hpp:43
An object that represents an 'track' (perception) of something.
Definition WsfTrack.hpp:120
Copyrights Multiple, All Rights Reserved