VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
luaEmbarkationSlotReservationJob.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/vrfObject.h"
11 #include "vrfutil/scriptGeometry.h"
14 
15 #include "vlutil/vlMutex.h"
16 
17 #include <luabind/luabind.hpp>
18 
19 #include <boost/scoped_ptr.hpp>
20 
21 class DtSimManager;
22 class DtSimMessage;
23 
26 {
27 public:
28  typedef std::vector<DtLocation3D> Points;
29 
30  static boost::shared_ptr<DtLuaEmbarkationSlotReservationJob> Make(
31  DtSimManager* mgr,
32  DtSharedVrfObjectReference embarkingObject,
33  DtSharedVrfObjectReference objectToEmbarkedOn,
34  int slotNumber);
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<DtLuaEmbarkationSlotReservationJob> shared_from_this();
66  boost::shared_ptr<const DtLuaEmbarkationSlotReservationJob> 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 
82  DtSimManager* mgr,
83  DtSharedVrfObjectReference embarkingObject,
84  DtSharedVrfObjectReference objectToEmbarkedOn,
85  int slotNumber);
86 
87  void start();
88 
90  void taskComplete();
91 
95 
97 
100  DtTaitBryan myOrientation;
102 
103  typedef DtMutex Mutex;
104 
105  mutable Mutex myMutex;
106 };
std::vector< DtLocation3D > Points
Definition: luaEmbarkationSlotReservationJob.h:28
luabind::object getDebugObject(lua_State *L)
Retrieve debug data, if available. Default return value is an empty table.
Definition: luaEmbarkationSlotReservationJob.h:46
DtSharedVrfObjectReference myEmbarkingObject
Definition: luaEmbarkationSlotReservationJob.h:92
int mySlotNumber
Definition: luaEmbarkationSlotReservationJob.h:94
Definition: asciiSerializable.h:33
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...
int myRequestId
Definition: luaEmbarkationSlotReservationJob.h:96
DtTaitBryan myOrientation
Definition: luaEmbarkationSlotReservationJob.h:100
virtual void cancel(lua_State *L)
Currently a no-op.
Definition: luaEmbarkationSlotReservationJob.h:49
virtual DtString serialize()=0
The following characters are reserved and cannot be used in serialization: &#39;|&#39;, &#39;:&#39;.
DtSharedVrfObjectReference myObjectToEmbarkOn
Definition: luaEmbarkationSlotReservationJob.h:93
DtSharedVrfObjectReference class will allocate an empty DtVrfObjectReference if one is not assigned s...
Definition: vrfObjectReference.h:102
File: simMsg.h.
Definition: simMessage.h:35
#define DT_DLL_vrfLua
This file is used to determine how to build.
Definition: vrfLuaDefines.h:25
virtual luabind::object getObject(lua_State *L, int &index, std::string &message)=0
Retrieve current value.
static int nextRequestId()
Definition: luaEmbarkationSlotReservationJob.h:70
bool mySlotAvailable
Definition: luaEmbarkationSlotReservationJob.h:99
virtual DtString objectType() const =0
Should return the string name of this object.
DtVector myPosition
Definition: luaEmbarkationSlotReservationJob.h:101
Mutex myMutex
Definition: luaEmbarkationSlotReservationJob.h:105
Lua object class which represents a request to reserve an embarkation slot.
Definition: luaEmbarkationSlotReservationJob.h:25
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
bool myGotResponse
Definition: luaEmbarkationSlotReservationJob.h:98
DtMutex Mutex
Definition: luaEmbarkationSlotReservationJob.h:103

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)