VR-Forces 5.0.1 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 #include <boost/scoped_ptr.hpp>
20 
21 class DtSimMessage;
22 
25 {
26 public:
27  typedef std::vector<DtLocation3D> Points;
28 
29  static boost::shared_ptr<DtLuaEmbarkationSlotReservationJob> Make(
31  DtSimObjectReference embarkingObject,
32  DtSimObjectReference objectToEmbarkedOn,
33  int slotNumber);
34 
37 
40 
42  luabind::object getObject(lua_State* L, int& index, std::string& message);
43 
45  luabind::object getDebugObject(lua_State* L) {return luabind::newtable(L);}
46 
48  virtual void cancel(lua_State* L) {};
49 
51  static void responseCallback(DtSimMessage* msg, void* usr);
52  virtual void processResponse(DtSimMessage* msg);
53 
57 
58  static DtAsciiSerializable* creator();
59 
61  bool deserialize(const DtString&);
62  DtString objectType() const;
63 
64  boost::shared_ptr<DtLuaEmbarkationSlotReservationJob> shared_from_this();
65  boost::shared_ptr<const DtLuaEmbarkationSlotReservationJob> shared_from_this() const;
66 
67 protected:
68 
69  static int nextRequestId()
70  {
71  static int theRequestId = 0;
72 
73  return ++theRequestId;
74  }
75 
76  class PathTask;
77  friend class PathTask;
78 
82  DtSimObjectReference embarkingObject,
83  DtSimObjectReference objectToEmbarkedOn,
84  int slotNumber);
85 
86  void start();
87 
89  void taskComplete();
90 
94 
96 
99  DtTaitBryan myOrientation;
101 
102  typedef DtMutex Mutex;
103 
104  mutable Mutex myMutex;
105 };
DtSimObjectReference myEmbarkingObject
Definition: luaEmbarkationSlotReservationJob.h:91
std::vector< DtLocation3D > Points
Definition: luaEmbarkationSlotReservationJob.h:27
luabind::object getDebugObject(lua_State *L)
Retrieve debug data, if available. Default return value is an empty table.
Definition: luaEmbarkationSlotReservationJob.h:45
DtSimObjectReference myObjectToEmbarkOn
Definition: luaEmbarkationSlotReservationJob.h:92
int mySlotNumber
Definition: luaEmbarkationSlotReservationJob.h:93
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...
int myRequestId
Definition: luaEmbarkationSlotReservationJob.h:95
DtTaitBryan myOrientation
Definition: luaEmbarkationSlotReservationJob.h:99
The DtSimObjectReference is a shared pointer that can be used amongst many object for access to the u...
Definition: simObjectReference.h:26
virtual void cancel(lua_State *L)
Currently a no-op.
Definition: luaEmbarkationSlotReservationJob.h:48
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:69
bool mySlotAvailable
Definition: luaEmbarkationSlotReservationJob.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...
DtVector myPosition
Definition: luaEmbarkationSlotReservationJob.h:100
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:89
Mutex myMutex
Definition: luaEmbarkationSlotReservationJob.h:104
Lua object class which represents a request to reserve an embarkation slot.
Definition: luaEmbarkationSlotReservationJob.h:24
bool myGotResponse
Definition: luaEmbarkationSlotReservationJob.h:97
DtMutex Mutex
Definition: luaEmbarkationSlotReservationJob.h:102

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)