VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
readerWriterSetter.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
7 
8 #pragma once
9 
10 #include <vrfLua/vrfLuaDefines.h>
11 #include <luabind/luabind.hpp>
12 
13 class DtString;
14 class DtReaderWriter;
15 
18 namespace DtReaderWriterSetter
19 {
22  DT_DLL_vrfLua bool setPropertyFromLua(const luabind::object& inObj, DtReaderWriter* outRw);
23 
26  DT_DLL_vrfLua bool setLuaFromRw(lua_State* L,
27  const DtReaderWriter* inRw, luabind::object& outObj);
28 
35  DT_DLL_vrfLua bool setRwFromLua(const luabind::object& inObj, DtReaderWriter* outRw);
36 
38  typedef bool (*luaToRwFnc)(const DtString& rwName, luabind::object const& inObj,
39  DtReaderWriter* outRw);
40 
42 
43  DT_DLL_vrfLua bool setStringRwFromLua(const DtString& rwName, luabind::object const& inObj,
44  DtReaderWriter* outRw);
45 
46  DT_DLL_vrfLua bool setUUIDRwFromLua(const DtString& rwName, luabind::object const& inObj,
47  DtReaderWriter* outRw);
48 
49  DT_DLL_vrfLua bool setEntityTypeFromLua(const DtString& rwName, luabind::object const& inObj,
50  DtReaderWriter* outRw);
51 
52  DT_DLL_vrfLua bool setResourceTypeFromLua(const DtString& rwName, luabind::object const& inObj,
53  DtReaderWriter* outRw);
54 
55  DT_DLL_vrfLua bool setObjectTypeFromLua(const DtString& rwName, luabind::object const& inObj,
56  DtReaderWriter* outRw);
57 
64  DT_DLL_vrfLua bool setLocVectorRwFromLua(const DtString& rwName, luabind::object const& inObj,
65  DtReaderWriter* outRw);
66 
67  DT_DLL_vrfLua bool setOffsetVectorRwFromLua(const DtString& rwName, luabind::object const& inObj,
68  DtReaderWriter* outRw);
69 
70  DT_DLL_vrfLua bool setVerticesFromLua(const DtString& rwName, luabind::object const& inObj,
71  DtReaderWriter* outRw);
72 
73  DT_DLL_vrfLua bool setOffsetVerticesFromLua(const DtString& rwName, luabind::object const& inObj,
74  DtReaderWriter* outRw);
75 
76  DT_DLL_vrfLua bool setIntRwFromLua(const DtString& rwName, luabind::object const& inObj,
77  DtReaderWriter* outRw);
78 
79  DT_DLL_vrfLua bool setForceRwFromLua(const DtString& rwName, luabind::object const& inObj,
80  DtReaderWriter* outRw);
81 
82  DT_DLL_vrfLua bool setDoubleRwFromLua(const DtString& rwName, luabind::object const& inObj,
83  DtReaderWriter* outRw);
84 
85  DT_DLL_vrfLua bool setBoolRwFromLua(const DtString& rwName, luabind::object const& inObj,
86  DtReaderWriter* outRw);
87 
88  DT_DLL_vrfLua bool setStructRwFromLua(const DtString& rwName, luabind::object const& inObj,
89  DtReaderWriter* outRw);
90 
91  DT_DLL_vrfLua bool setListRwFromLua(const DtString& rwName, luabind::object const& inObj,
92  DtReaderWriter* outRw);
94 
95 
97  typedef bool (*rwToLuaFnc)(lua_State* L, const DtString& rwName,
98  const DtReaderWriter* inRw, luabind::object& outObj);
99 
101 
102  DT_DLL_vrfLua bool setStringLuaFromRw(lua_State* L, const DtString& rwName,
103  const DtReaderWriter* inRw, luabind::object& outObj);
104 
105  DT_DLL_vrfLua bool setEntityTypeLuaFromRw(lua_State* L, const DtString& rwName,
106  const DtReaderWriter* inRw, luabind::object& outObj);
107 
108  DT_DLL_vrfLua bool setObjectTypeLuaFromRw(lua_State* L, const DtString& rwName,
109  const DtReaderWriter* inRw, luabind::object& outObj);
110 
112  DT_DLL_vrfLua bool setSimObjectLuaFromRw(lua_State* L, const DtString& rwName,
113  const DtReaderWriter* inRw, luabind::object& outObj);
114 
117  DT_DLL_vrfLua bool setLocationLuaFromRw(lua_State* L, const DtString& rwName,
118  const DtReaderWriter* inRw, luabind::object& outObj);
119 
120  DT_DLL_vrfLua bool setOffsetVectorLuaFromRw(lua_State* L, const DtString& rwName,
121  const DtReaderWriter* inRw, luabind::object& outObj);
122 
123  DT_DLL_vrfLua bool setVerticesLuaFromRw(lua_State* L, const DtString& rwName,
124  const DtReaderWriter* inRw, luabind::object& outObj);
125 
126  DT_DLL_vrfLua bool setOffsetVerticesLuaFromRw(lua_State* L, const DtString& rwName,
127  const DtReaderWriter* inRw, luabind::object& outObj);
128 
129  DT_DLL_vrfLua bool setIntLuaFromRw(lua_State* L, const DtString& rwName,
130  const DtReaderWriter* inRw, luabind::object& outObj);
131 
132  DT_DLL_vrfLua bool setDoubleLuaFromRw(lua_State* L, const DtString& rwName,
133  const DtReaderWriter* inRw, luabind::object& outObj);
134 
135  DT_DLL_vrfLua bool setBoolLuaFromRw(lua_State* L, const DtString& rwName,
136  const DtReaderWriter* inRw, luabind::object& outObj);
137 
138  DT_DLL_vrfLua bool setStructLuaFromRw(lua_State* L, const DtString& rwName,
139  const DtReaderWriter* inRw, luabind::object& outObj);
140 
141  DT_DLL_vrfLua bool setListLuaFromRw(lua_State* L, const DtString& rwName,
142  const DtReaderWriter* inRw, luabind::object& outObj);
144 
146  typedef DtReaderWriter* (*luaToRwCreatorFnc)(const DtString& rwName, luabind::object const& inObj,
147  DtReaderWriter* parent);
148 
149  typedef std::map<DtString, luaToRwFnc> DtRwFromLuaFcnMap;
152 
153  typedef std::map<DtString, rwToLuaFnc> DtLuaFromRwFcnMap;
156 };
157 
DT_DLL_vrfLua bool setRwFromLua(const luabind::object &inObj, DtReaderWriter *outRw)
Tries to set all the contents of the reader/writer item from lua. If there is not a factory represent...
std::map< DtString, rwToLuaFnc > DtLuaFromRwFcnMap
Definition: readerWriterSetter.h:153
std::map< DtString, luaToRwFnc > DtRwFromLuaFcnMap
Definition: readerWriterSetter.h:149
DT_DLL_vrfLua bool setOffsetVectorRwFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
DT_DLL_vrfLua bool setVerticesFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
DT_DLL_vrfLua bool setLuaFromRw(lua_State *L, const DtReaderWriter *inRw, luabind::object &outObj)
Sets the given Lua object from a ReaderWriter. Returns true if successful.
DT_DLL_vrfLua bool setLocVectorRwFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
A DtVector can be used to hold a location3D or a vector3D. There is no type DtRwPoint, and DtVector is used for locations throughout VRF code, DtVector is used for locations and vectors. There is no way to tell from DtVector whether it is representing a point or vector. So, in readerWriterSetter, use DtRwVector for location3Ds and reject vector3Ds when going from Lua to RW; assume DtRwVectors are location 3Ds.
DT_DLL_vrfLua bool setListLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
ReaderWriter-to-Lua conversion functions.
DT_DLL_vrfLua bool setStructLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
ReaderWriter-to-Lua conversion functions.
DT_DLL_vrfLua bool setStringRwFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
DT_DLL_vrfLua bool setEntityTypeLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
ReaderWriter-to-Lua conversion functions.
Definition: readerWriter.h:85
DT_DLL_vrfLua bool setOffsetVectorLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
ReaderWriter-to-Lua conversion functions.
DT_DLL_vrfLua bool setDoubleLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
ReaderWriter-to-Lua conversion functions.
DT_DLL_vrfLua bool setBoolRwFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
DT_DLL_vrfLua bool setOffsetVerticesFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
bool(* rwToLuaFnc)(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
Function signature for ReaderWriter-to-Lua object conversion functions.
Definition: readerWriterSetter.h:97
DT_DLL_vrfLua bool setLocationLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
See comment above. A DtVector is interpreted as a location3D, not a vector3D or anything other object...
DT_DLL_vrfLua bool setObjectTypeLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
ReaderWriter-to-Lua conversion functions.
DT_DLL_vrfLua bool setPropertyFromLua(const luabind::object &inObj, DtReaderWriter *outRw)
Sets the given ReaderWriter from a Lua object. Returns true if successful.
DT_DLL_vrfLua bool setEntityTypeFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
#define DT_DLL_vrfLua
This file is used to determine how to build.
Definition: vrfLuaDefines.h:25
DT_DLL_vrfLua bool setOffsetVerticesLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
ReaderWriter-to-Lua conversion functions.
DT_DLL_vrfLua DtRwFromLuaFcnMap & rwFromLuaFcnMap()
The Lua-to-ReaderWriter by type.
DT_DLL_vrfLua bool setDoubleRwFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
DT_DLL_vrfLua bool setIntRwFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
DT_DLL_vrfLua bool setForceRwFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
DT_DLL_vrfLua bool setUUIDRwFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
DT_DLL_vrfLua bool setVerticesLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
ReaderWriter-to-Lua conversion functions.
DT_DLL_vrfLua bool setStructRwFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
DT_DLL_vrfLua bool setIntLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
ReaderWriter-to-Lua conversion functions.
DT_DLL_vrfLua bool setSimObjectLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
Assumes the RW is a UUID.
DT_DLL_vrfLua DtLuaFromRwFcnMap & luaFromRwFcnMap()
The ReaderWriter-to-Lua by type.
DT_DLL_vrfLua bool setBoolLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
ReaderWriter-to-Lua conversion functions.
DT_DLL_vrfLua bool setListRwFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
bool(* luaToRwFnc)(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Function signature for Lua-to-ReaderWriter conversion functions.
Definition: readerWriterSetter.h:38
DT_DLL_vrfLua bool setStringLuaFromRw(lua_State *L, const DtString &rwName, const DtReaderWriter *inRw, luabind::object &outObj)
ReaderWriter-to-Lua conversion functions.
DT_DLL_vrfLua bool setObjectTypeFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.
DT_DLL_vrfLua bool setResourceTypeFromLua(const DtString &rwName, luabind::object const &inObj, DtReaderWriter *outRw)
Lua-to-ReaderWriter conversion functions.

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)