VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
propertySetter.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2013 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
7 
8 #pragma once
9 
10 #include <vrfLua/vrfLuaDefines.h>
11 #include <luabind/luabind.hpp>
14 
15 class DtString;
16 class DtRwProperties;
17 
20 namespace DtPropertySetter
21 {
22  using ConstPrioritizedProperties = std::vector<const DtRwProperties*>;
23  using PrioritizedProperties = std::vector<DtRwProperties*>;
24 
27  DT_DLL_vrfLua bool setPropertyFromLua(const DtString& propertyName,
28  const luabind::object& inProp, DtRwProperties* outProps);
29  DT_DLL_vrfLua bool setPropertyFromLua(const DtString& propertyName,
30  const luabind::object& inProp, PrioritizedProperties outProps);
31 
35  DT_DLL_vrfLua bool setOrAddPropertyFromLua(const DtString& propertyName,
36  const luabind::object& inProp, DtRwProperties* outProps);
37  DT_DLL_vrfLua bool setOrAddPropertyFromLua(const DtString& propertyName,
38  const luabind::object& inProp, PrioritizedProperties outProps);
39 
43  DT_DLL_vrfLua bool setPropertyListItemFromLua(const DtString& propertyName,
44  const luabind::object& keyValues, const luabind::object& inProp,
45  DtRwProperties* outProps);
46  DT_DLL_vrfLua bool setPropertyListItemFromLua(const DtString& propertyName,
47  const luabind::object& keyValues, const luabind::object& inProp,
48  PrioritizedProperties outProps);
49 
53  DT_DLL_vrfLua bool setPropertyListItemFromLua(const DtString& propertyName,
54  int index, const luabind::object& inProp,
55  DtRwProperties* outProps);
56  DT_DLL_vrfLua bool setPropertyListItemFromLua(const DtString& propertyName,
57  int index, const luabind::object& inProp,
58  PrioritizedProperties outProps);
59 
63  DT_DLL_vrfLua bool setPropertyMapItemFromLua(const DtString& propertyName,
64  const luabind::object& keyValue, const luabind::object& inProp,
65  DtRwProperties* outProps);
66  DT_DLL_vrfLua bool setPropertyMapItemFromLua(const DtString& propertyName,
67  const luabind::object& keyValue, const luabind::object& inProp,
68  PrioritizedProperties outProps);
69 
72  DT_DLL_vrfLua bool setLuaFromProperty(lua_State* L, const DtString& propertyName,
73  const DtRwProperties* inProps, luabind::object& outProp);
74  DT_DLL_vrfLua bool setLuaFromProperty(lua_State* L, const DtString& propertyName,
75  ConstPrioritizedProperties inProps, luabind::object& outProp);
76 
80  DT_DLL_vrfLua bool setLuaListItemFromProperty(lua_State* L, const DtString& propertyName,
81  const luabind::object& keyValues, const DtRwProperties* inProps,
82  luabind::object& outItem, int& index);
83  DT_DLL_vrfLua bool setLuaListItemFromProperty(lua_State* L, const DtString& propertyName,
84  const luabind::object& keyValues, ConstPrioritizedProperties inProps,
85  luabind::object& outItem, int& index);
86 
90  DT_DLL_vrfLua bool setLuaListItemFromProperty(lua_State* L, const DtString& propertyName,
91  int index, const DtRwProperties* inProps,
92  luabind::object& outItem);
93  DT_DLL_vrfLua bool setLuaListItemFromProperty(lua_State* L, const DtString& propertyName,
94  int index, ConstPrioritizedProperties inProps,
95  luabind::object& outItem);
96 
100  DT_DLL_vrfLua bool setLuaMapItemFromProperty(lua_State* L, const DtString& propertyName,
101  const luabind::object& keyValue, const DtRwProperties* inProps,
102  luabind::object& outItem);
103  DT_DLL_vrfLua bool setLuaMapItemFromProperty(lua_State* L, const DtString& propertyName,
104  const luabind::object& keyValue, ConstPrioritizedProperties inProps,
105  luabind::object& outItem);
106 
109  DT_DLL_vrfLua bool setPropertyFromLua(const luabind::object& inProp, DtPropertyInterface* outProp);
110 
113  DT_DLL_vrfLua bool setLuaFromProperty(lua_State* L,
114  const DtPropertyInterface* inProps, luabind::object& outProp);
115 
117  typedef bool (*luaToPropFnc)(const DtString& propertyName, luabind::object const& inProp,
118  DtPropertyInterface* outProp);
119 
121 
122  DT_DLL_vrfLua bool setStringPropFromLua(const DtString& propertyName, luabind::object const& inProp,
123  DtPropertyInterface* outProp);
124 
125  DT_DLL_vrfLua bool setUUIDPropFromLua(const DtString& propertyName, luabind::object const& inProp,
126  DtPropertyInterface* outProp);
127 
128  DT_DLL_vrfLua bool setEntityTypePropFromLua(const DtString& propertyName, luabind::object const& inProp,
129  DtPropertyInterface* outProp);
130 
131  DT_DLL_vrfLua bool setResourceTypePropFromLua(const DtString& propertyName, luabind::object const& inProp,
132  DtPropertyInterface* outProp);
133 
134  DT_DLL_vrfLua bool setObjectTypePropFromLua(const DtString& propertyName, luabind::object const& inProp,
135  DtPropertyInterface* outProp);
136 
137  DT_DLL_vrfLua bool setVerticesPropFromLua(const DtString& propertyName, luabind::object const& inProp,
138  DtPropertyInterface* outProp);
139 
140  DT_DLL_vrfLua bool setOffsetVerticesPropFromLua(const DtString& propertyName, luabind::object const& inProp,
141  DtPropertyInterface* outProp);
142 
143  DT_DLL_vrfLua bool setIntPropFromLua(const DtString& propertyName, luabind::object const& inProp,
144  DtPropertyInterface* outProp);
145 
146  DT_DLL_vrfLua bool setDoublePropFromLua(const DtString& propertyName, luabind::object const& inProp,
147  DtPropertyInterface* outProp);
148 
149  DT_DLL_vrfLua bool setBoolPropFromLua(const DtString& propertyName, luabind::object const& inProp,
150  DtPropertyInterface* outProp);
151 
152  DT_DLL_vrfLua bool setVectorPropFromLua(const DtString& propertyName, luabind::object const& inProp,
153  DtPropertyInterface* outProp);
154 
155  DT_DLL_vrfLua bool setStructPropFromLua(const DtString& propertyName, luabind::object const& inProp,
156  DtPropertyInterface* outProp);
157 
158  DT_DLL_vrfLua bool setListPropFromLua(const DtString& propertyName, luabind::object const& inProp,
159  DtPropertyInterface* outProp);
160 
161  DT_DLL_vrfLua bool setMapPropFromLua(const DtString& propertyName, luabind::object const& inProp,
162  DtPropertyInterface* outProp);
164 
165 
167  typedef bool (*propToLuaFnc)(lua_State* L, const DtString& propertyName,
168  const DtPropertyInterface* inProp, luabind::object& outProp);
169 
171 
172  DT_DLL_vrfLua bool setLuaFromStringProp(lua_State* L, const DtString& propertyName,
173  const DtPropertyInterface* inProp, luabind::object& outProp);
174 
175  DT_DLL_vrfLua bool setLuaFromEntityTypeProp(lua_State* L, const DtString& propertyName,
176  const DtPropertyInterface* inProp, luabind::object& outProp);
177 
178  DT_DLL_vrfLua bool setLuaFromObjectTypeProp(lua_State* L, const DtString& propertyName,
179  const DtPropertyInterface* inProp, luabind::object& outProp);
180 
181  DT_DLL_vrfLua bool setLuaFromVerticesProp(lua_State* L, const DtString& propertyName,
182  const DtPropertyInterface* inProp, luabind::object& outProp);
183 
184  DT_DLL_vrfLua bool setLuaFromOffsetVerticesProp(lua_State* L, const DtString& propertyName,
185  const DtPropertyInterface* inProp, luabind::object& outProp);
186 
187  DT_DLL_vrfLua bool setLuaFromIntProp(lua_State* L, const DtString& propertyName,
188  const DtPropertyInterface* inProp, luabind::object& outProp);
189 
190  DT_DLL_vrfLua bool setLuaFromDoubleProp(lua_State* L, const DtString& propertyName,
191  const DtPropertyInterface* inProp, luabind::object& outProp);
192 
193  DT_DLL_vrfLua bool setLuaFromBoolProp(lua_State* L, const DtString& propertyName,
194  const DtPropertyInterface* inProp, luabind::object& outProp);
195 
196  DT_DLL_vrfLua bool setLuaFromVectorProp(lua_State* L, const DtString& propertyName,
197  const DtPropertyInterface* inProp, luabind::object& outProp);
198 
199  DT_DLL_vrfLua bool setLuaFromStructProp(lua_State* L, const DtString& propertyName,
200  const DtPropertyInterface* inProp, luabind::object& outProp);
201 
202  DT_DLL_vrfLua bool setLuaFromListProp(lua_State* L, const DtString& propertyName,
203  const DtPropertyInterface* inProp, luabind::object& outProp);
205 
207  typedef DtPropertyInterface* (*luaToPropCreatorFnc)(const DtString& propertyName, luabind::object const& inProp,
208  DtRwProperties* parent);
209 
211 
212  DT_DLL_vrfLua DtPropertyInterface* createStringPropFromLua(const DtString& propertyName, luabind::object const& inProp,
213  DtRwProperties* parent);
214 
215  DT_DLL_vrfLua DtPropertyInterface* createDoublePropFromLua(const DtString& propertyName, luabind::object const& inProp,
216  DtRwProperties* parent);
217 
218  DT_DLL_vrfLua DtPropertyInterface* createBoolPropFromLua(const DtString& propertyName, luabind::object const& inProp,
219  DtRwProperties* parent);
220 
221  DT_DLL_vrfLua DtPropertyInterface* createTablePropFromLua(const DtString& propertyName, luabind::object const& inProp,
222  DtRwProperties* parent);
223 
224  DT_DLL_vrfLua DtPropertyInterface* createCustomPropFromLua(const DtString& propertyName, luabind::object const& inProp,
225  DtRwProperties* parent);
226 
227  DT_DLL_vrfLua DtPropertyInterface* createStructPropFromLua(const DtString& propertyName, luabind::object const& inProp,
228  DtRwProperties* parent);
229 
230  DT_DLL_vrfLua DtPropertyInterface* createListPropFromLua(const DtString& propertyName, luabind::object const& inProp,
231  DtRwProperties* parent);
232 
233  DT_DLL_vrfLua DtPropertyInterface* createMapPropFromLua(const DtString& propertyName, luabind::object const& inProp,
234  DtRwProperties* parent);
236 
240 
242  const luabind::object& keyValues, int& index);
244  const luabind::object& keyValues, int& index);
246 
251  const luabind::object& keyValues, int& index);
252 
257  const luabind::object& keyValues, int& index);
258 
262  const luabind::object& keyValue);
263 
266 
268  const luabind::object& keyValue);
270  const luabind::object& keyValue);
272 
273  typedef std::map<DtString, luaToPropFnc> DtPropFromLuaFcnMap;
276 
277  typedef std::map<DtString, propToLuaFnc> DtLuaFromPropFcnMap;
280 
281  typedef std::map<int, luaToPropCreatorFnc> DtPropFromLuaCreatorFcnMap;
284 };
285 
DT_DLL_vrfLua bool setLuaFromStructProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
DT_DLL_vrfLua bool setUUIDPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
DT_DLL_vrfLua bool setLuaListItemFromProperty(lua_State *L, const DtString &propertyName, const luabind::object &keyValues, const DtRwProperties *inProps, luabind::object &outItem, int &index)
Finds the item in the named list property that matches the specified keyValues and sets outItem with ...
DT_DLL_vrfLua const DtPropertyInterface * findConstMapItem(const DtRwPropertiesMap *propMap, const luabind::object &keyValue)
Find the item in the map that matches the given key defined in the keyValue Lua object.
DT_DLL_vrfLua DtPropFromLuaFcnMap & propertyFromLuaFcnMap()
The Lua-to-Property by type.
bool(* luaToPropFnc)(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Function signature for Lua-to-property conversion functions.
Definition: propertySetter.h:117
DT_DLL_vrfLua bool setIntPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
DT_DLL_vrfLua DtPropertyInterface * createStringPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
DT_DLL_vrfLua DtPropertyInterface * createMapPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
DT_DLL_vrfLua DtLuaFromPropFcnMap & luaFromPropertyFcnMap()
The Property-to-Lua by type.
DT_DLL_vrfLua bool setLuaFromProperty(lua_State *L, const DtString &propertyName, const DtRwProperties *inProps, luabind::object &outProp)
Sets the named Lua property from a property. Returns true if successful.
DT_DLL_vrfLua bool setOrAddPropertyFromLua(const DtString &propertyName, const luabind::object &inProp, DtRwProperties *outProps)
Sets the named property from a Lua property, adding it if it&#39;s not found. Returns true if successful...
DT_DLL_vrfLua bool setListPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
DT_DLL_vrfLua const DtPropertyInterface * findConstListItemByValue(const DtRwPropertiesList *propList, const luabind::object &keyValues, int &index)
Called by findConstListItem in the case where keyValues is just a single value that matches a simple ...
DT_DLL_vrfLua bool setOffsetVerticesPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
DT_DLL_vrfLua DtPropertyInterface * findMapItem(DtRwPropertiesMap *propMap, const luabind::object &keyValue)
Find the item in the map that matches the given key defined in the keyValue Lua object.
DT_DLL_vrfLua bool setLuaFromOffsetVerticesProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
DT_DLL_vrfLua bool setPropertyMapItemFromLua(const DtString &propertyName, const luabind::object &keyValue, const luabind::object &inProp, DtRwProperties *outProps)
Finds the item in the named map property that matches the specified keyValues and updates it with the...
DT_DLL_vrfLua const DtPropertyInterface * findConstListItem(const DtRwPropertiesList *propList, const luabind::object &keyValues, int &index)
Find the item in the list that matches the given keys defined in the keyValues Lua object...
DT_DLL_vrfLua bool setPropertyFromLua(const DtString &propertyName, const luabind::object &inProp, DtRwProperties *outProps)
Sets the named property property from a Lua property. Returns true if successful. ...
DT_DLL_vrfLua bool setVectorPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
Interface class used to define minimal interface for a property. The DtPropertyInterface class provid...
Definition: propertyInterface.h:53
DT_DLL_vrfLua bool setBoolPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
DT_DLL_vrfLua bool setPropertyListItemFromLua(const DtString &propertyName, const luabind::object &keyValues, const luabind::object &inProp, DtRwProperties *outProps)
Finds the item in the named list property that matches the specified keyValues and updates it with th...
DT_DLL_vrfLua DtPropFromLuaCreatorFcnMap & propertyFromLuaCreatorFcnMap()
The Lua-to-Property creator by type.
DT_DLL_vrfLua bool setDoublePropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
DT_DLL_vrfLua bool setLuaFromIntProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
DT_DLL_vrfLua DtPropertyInterface * createDoublePropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
DT_DLL_vrfLua bool setLuaFromStringProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
DT_DLL_vrfLua DtString convertMapKey(const DtRwPropertiesMap *propMap, const luabind::object &keyValue)
Converts the Lua object to a string to be used as a key to the specified DtRwPropertiesMap.
DT_DLL_vrfLua bool setLuaFromBoolProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
DT_DLL_vrfLua bool setLuaFromListProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
std::vector< DtRwProperties * > PrioritizedProperties
Definition: propertySetter.h:23
#define DT_DLL_vrfLua
This file is used to determine how to build.
Definition: vrfLuaDefines.h:25
DT_DLL_vrfLua bool setLuaFromVerticesProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
DT_DLL_vrfLua const DtPropertyInterface * findConstListItemByKeys(const DtRwPropertiesList *propList, const luabind::object &keyValues, int &index)
Called by findConstListItem in the case where keyValues is a table of keys that match fields in the s...
DT_DLL_vrfLua DtPropertyInterface * createListPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
Acts as a map for properties. A map is a definition that has a key and a prototype, with values being the key and prototype pair. The key can only be a string (DtRwStringType), int (DtRwIntType, DtRwInt8Type, DtRwInt16Type, DtRwInt32Type), or real (DtRwRealType, DtRwReal32Type, DtRwReal64Type).
Definition: rwPropertiesMap.h:41
DT_DLL_vrfLua DtPropertyInterface * createTablePropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
DT_DLL_vrfLua bool setStringPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
DT_DLL_vrfLua bool setMapPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
DT_DLL_vrfLua DtPropertyInterface * createCustomPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
DT_DLL_vrfLua bool setVerticesPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
DT_DLL_vrfLua bool setEntityTypePropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
DT_DLL_vrfLua bool setLuaFromObjectTypeProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
DT_DLL_vrfLua bool setLuaFromVectorProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
std::map< DtString, luaToPropFnc > DtPropFromLuaFcnMap
Definition: propertySetter.h:273
DT_DLL_vrfLua bool setLuaFromEntityTypeProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
DT_DLL_vrfLua DtPropertyInterface * createStructPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
DT_DLL_vrfLua DtPropertyInterface * createBoolPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
DT_DLL_vrfLua bool setLuaMapItemFromProperty(lua_State *L, const DtString &propertyName, const luabind::object &keyValue, const DtRwProperties *inProps, luabind::object &outItem)
Finds the item in the named map property that matches the specified keyValue and sets outItem with it...
DT_DLL_vrfLua DtPropertyInterface * findListItem(DtRwPropertiesList *propList, const luabind::object &keyValues, int &index)
Find the item in the list that matches the given keys defined in the keyValues Lua object...
Acts as a DtRwList for properties. Only real difference between this class and a DtRwProperties class...
Definition: rwPropertiesList.h:38
DT_DLL_vrfLua bool setResourceTypePropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
A list of properties. A DtPropertyInterface object that is a specialized version of DtRwVariableBindi...
Definition: rwProperties.h:122
std::vector< const DtRwProperties * > ConstPrioritizedProperties
Definition: propertySetter.h:22
DT_DLL_vrfLua bool setLuaFromDoubleProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
DT_DLL_vrfLua bool setObjectTypePropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
bool(* propToLuaFnc)(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Function signature for Property-to-Lua conversion functions.
Definition: propertySetter.h:167
DT_DLL_vrfLua bool setStructPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
std::map< int, luaToPropCreatorFnc > DtPropFromLuaCreatorFcnMap
Definition: propertySetter.h:281
std::map< DtString, propToLuaFnc > DtLuaFromPropFcnMap
Definition: propertySetter.h:277

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)