VR-Forces Developer's Guide
 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/simObject.h"
11 #include "vrfutil/scriptGeometry.h"
14 
15 #include "vlutil/vlMutex.h"
16 
17 #include <luabind/luabind.hpp>
18 
19 
20 class DtSimMessage;
21 
24 {
25 public:
26  typedef std::vector<DtLocation3D> Points;
27 
28  static std::shared_ptr<DtLuaEmbarkationSlotReservationJob> Make(
30  DtSimObjectReference embarkingObject,
31  DtSimObjectReference objectToEmbarkedOn,
32  int slotNumber);
33 
36 
38  virtual ~DtLuaEmbarkationSlotReservationJob() override;
39 
41  virtual luabind::object getObject(lua_State* L, int& index, std::string& message) override;
42 
44  virtual luabind::object getDebugObject(lua_State* L) override { return luabind::newtable(L);}
45 
47  virtual void cancel(lua_State* L) override {};
48 
50  static void responseCallback(DtSimMessage* msg, void* usr);
51  virtual void processResponse(DtSimMessage* msg);
52 
56 
57  static DtAsciiSerializable* creator();
58 
59  virtual DtString serialize() override;
60  virtual bool deserialize(const DtString&) override;
61  virtual DtString objectType() const override;
62 
63  std::shared_ptr<DtLuaEmbarkationSlotReservationJob> shared_from_this();
64  std::shared_ptr<const DtLuaEmbarkationSlotReservationJob> shared_from_this() const;
65 
66 protected:
67 
68  static int nextRequestId()
69  {
70  static int theRequestId = 0;
71 
72  return ++theRequestId;
73  }
74 
75  class PathTask;
76  friend class PathTask;
77 
81  DtSimObjectReference embarkingObject,
82  DtSimObjectReference objectToEmbarkedOn,
83  int slotNumber);
84 
85  void start();
86 
88  void taskComplete();
89 
93 
95 
98  DtTaitBryan myOrientation;
99  DtVector myPosition;
100 
101  typedef DtMutex Mutex;
102 
103  mutable Mutex myMutex;
104 };
DtSimObjectReference myEmbarkingObject
Definition: luaEmbarkationSlotReservationJob.h:90
std::vector< DtLocation3D > Points
Definition: luaEmbarkationSlotReservationJob.h:26
virtual luabind::object getDebugObject(lua_State *L) override
Retrieve debug data, if available. Default return value is an empty table.
Definition: luaEmbarkationSlotReservationJob.h:44
DtSimObjectReference myObjectToEmbarkOn
Definition: luaEmbarkationSlotReservationJob.h:91
int mySlotNumber
Definition: luaEmbarkationSlotReservationJob.h:92
Definition: asciiSerializable.h:40
Interface for getting asynchronously computed data into Lua.
Definition: luaAsyncJob.h:27
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:94
DtTaitBryan myOrientation
Definition: luaEmbarkationSlotReservationJob.h:98
virtual DtString serialize()=0
The following characters are reserved and cannot be used in serialization: &#39;|&#39;, &#39;:&#39;.
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:68
bool mySlotAvailable
Definition: luaEmbarkationSlotReservationJob.h:97
virtual DtString objectType() const =0
Should return the string name of this object. The object name should not be part of the serialization...
DtVector myPosition
Definition: luaEmbarkationSlotReservationJob.h:99
virtual void cancel(lua_State *L) override
Currently a no-op.
Definition: luaEmbarkationSlotReservationJob.h:47
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
Mutex myMutex
Definition: luaEmbarkationSlotReservationJob.h:103
Lua object class which represents a request to reserve an embarkation slot.
Definition: luaEmbarkationSlotReservationJob.h:23
bool myGotResponse
Definition: luaEmbarkationSlotReservationJob.h:96
DtMutex Mutex
Definition: luaEmbarkationSlotReservationJob.h:101

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)