VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
luaEmbarkationSlotQueryJob.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
8 #include "vrfLua/vrfLuaDefines.h"
9 #include "vrfLua/luaAsyncJob.h"
10 #include "vrfobjcore/simObject.h"
11 #include "vrfutil/scriptGeometry.h"
15 
16 #include "vlutil/vlMutex.h"
17 
18 #include <luabind/luabind.hpp>
19 
20 #include <boost/scoped_ptr.hpp>
21 
22 class DtSimMessage;
23 
26 {
27 public:
28  typedef std::vector<DtLocation3D> Points;
29 
30  static boost::shared_ptr<DtLuaEmbarkationSlotQueryJob> Make(
32  DtSimObjectReference queryingObject,
33  DtSimObjectReference objectToBeQueried,
34  bool bAllSlots);
35 
38 
41 
43  luabind::object getObject(lua_State* L, int& index, std::string& message);
44 
46  luabind::object getDebugObject(lua_State* L) {return luabind::newtable(L);}
47 
49  virtual void cancel(lua_State* L) {};
50 
52  static void responseCallback(DtSimMessage* msg, void* usr);
53  virtual void processResponse(DtSimMessage* msg);
54 
58 
59  static DtAsciiSerializable* creator();
60 
62  bool deserialize(const DtString&);
63  DtString objectType() const;
64 
65  boost::shared_ptr<DtLuaEmbarkationSlotQueryJob> shared_from_this();
66  boost::shared_ptr<const DtLuaEmbarkationSlotQueryJob> shared_from_this() const;
67 
68 protected:
69 
70  static int nextRequestId()
71  {
72  static int theRequestId = 0;
73 
74  return ++theRequestId;
75  }
76 
77  class PathTask;
78  friend class PathTask;
79 
83  DtSimObjectReference queryingObject,
84  DtSimObjectReference objectToBeQueried,
85  bool bAllSlots);
86 
87  void start();
88 
90  void taskComplete();
91 
94  bool myAllSlots;
95 
97 
100 
101  typedef DtMutex Mutex;
102 
103  mutable Mutex myMutex;
104 };
virtual void cancel(lua_State *L)
Currently a no-op.
Definition: luaEmbarkationSlotQueryJob.h:49
Mutex myMutex
Definition: luaEmbarkationSlotQueryJob.h:103
Definition: asciiSerializable.h:34
Interface for getting asynchronously computed data into Lua.
Definition: luaAsyncJob.h:29
virtual bool deserialize(const DtString &)=0
This function should take the string that was serialized via serialize() and fill this object with th...
DtSimObjectReference myObjectBeingQueried
Definition: luaEmbarkationSlotQueryJob.h:93
std::map< int, SlotInformation > SlotInformationMap
Definition: ifEmbarkationSlotInformationResponse.h:35
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
DtMutex Mutex
Definition: luaEmbarkationSlotQueryJob.h:101
virtual DtString serialize()=0
The following characters are reserved and cannot be used in serialization: &#39;|&#39;, &#39;:&#39;.
luabind::object getDebugObject(lua_State *L)
Retrieve debug data, if available. Default return value is an empty table.
Definition: luaEmbarkationSlotQueryJob.h:46
int myRequestId
Definition: luaEmbarkationSlotQueryJob.h:96
File: simMsg.h.
Definition: simMessage.h:35
#define DT_DLL_vrfLua
This file is used to determine how to build.
Definition: vrfLuaDefines.h:25
bool myAllSlots
Definition: luaEmbarkationSlotQueryJob.h:94
virtual luabind::object getObject(lua_State *L, int &index, std::string &message)=0
Retrieve current value.
bool myGotResponse
Definition: luaEmbarkationSlotQueryJob.h:98
virtual DtString objectType() const =0
Should return the string name of this object. The object name should not be part of the serialization...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:90
static int nextRequestId()
Definition: luaEmbarkationSlotQueryJob.h:70
Lua object class which represents a query for embarkation slot info.
Definition: luaEmbarkationSlotQueryJob.h:25
DtIfEmbarkationSlotInformationResponse::SlotInformationMap mySlotInfo
Definition: luaEmbarkationSlotQueryJob.h:99
DtSimObjectReference myQueryingObject
Definition: luaEmbarkationSlotQueryJob.h:92
std::vector< DtLocation3D > Points
Definition: luaEmbarkationSlotQueryJob.h:28

Document ID: Generated on Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)