VR-Forces 5.0.1 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 
25  bool setPropertyFromLua(const DtString& propertyName,
26  const luabind::object& inProp, DtRwProperties* outProps);
27 
31  bool setOrAddPropertyFromLua(const DtString& propertyName,
32  const luabind::object& inProp, DtRwProperties* outProps);
33 
37  bool setPropertyListItemFromLua(const DtString& propertyName,
38  const luabind::object& keyValues, const luabind::object& inProp,
39  DtRwProperties* outProps);
40 
44  bool setPropertyListItemFromLua(const DtString& propertyName,
45  int index, const luabind::object& inProp,
46  DtRwProperties* outProps);
47 
51  bool setPropertyMapItemFromLua(const DtString& propertyName,
52  const luabind::object& keyValue, const luabind::object& inProp,
53  DtRwProperties* outProps);
54 
57  bool setLuaFromProperty(lua_State* L, const DtString& propertyName,
58  const DtRwProperties* inProps, luabind::object& outProp);
59 
63  bool setLuaListItemFromProperty(lua_State* L, const DtString& propertyName,
64  const luabind::object& keyValues, const DtRwProperties* inProps,
65  luabind::object& outItem, int& index);
66 
70  bool setLuaListItemFromProperty(lua_State* L, const DtString& propertyName,
71  int index, const DtRwProperties* inProps,
72  luabind::object& outItem);
73 
77  bool setLuaMapItemFromProperty(lua_State* L, const DtString& propertyName,
78  const luabind::object& keyValue, const DtRwProperties* inProps,
79  luabind::object& outItem);
80 
83  bool setPropertyFromLua(const luabind::object& inProp, DtPropertyInterface* outProp);
84 
87  bool setLuaFromProperty(lua_State* L,
88  const DtPropertyInterface* inProps, luabind::object& outProp);
89 
91  typedef bool (*luaToPropFnc)(const DtString& propertyName, luabind::object const& inProp,
92  DtPropertyInterface* outProp);
93 
95 
96  bool setStringPropFromLua(const DtString& propertyName, luabind::object const& inProp,
97  DtPropertyInterface* outProp);
98 
99  bool setUUIDPropFromLua(const DtString& propertyName, luabind::object const& inProp,
100  DtPropertyInterface* outProp);
101 
102  bool setEntityTypePropFromLua(const DtString& propertyName, luabind::object const& inProp,
103  DtPropertyInterface* outProp);
104 
105  bool setObjectTypePropFromLua(const DtString& propertyName, luabind::object const& inProp,
106  DtPropertyInterface* outProp);
107 
108  bool setVerticesPropFromLua(const DtString& propertyName, luabind::object const& inProp,
109  DtPropertyInterface* outProp);
110 
111  bool setOffsetVerticesPropFromLua(const DtString& propertyName, luabind::object const& inProp,
112  DtPropertyInterface* outProp);
113 
114  bool setIntPropFromLua(const DtString& propertyName, luabind::object const& inProp,
115  DtPropertyInterface* outProp);
116 
117  bool setDoublePropFromLua(const DtString& propertyName, luabind::object const& inProp,
118  DtPropertyInterface* outProp);
119 
120  bool setBoolPropFromLua(const DtString& propertyName, luabind::object const& inProp,
121  DtPropertyInterface* outProp);
122 
123  bool setVectorPropFromLua(const DtString& propertyName, luabind::object const& inProp,
124  DtPropertyInterface* outProp);
125 
126  bool setStructPropFromLua(const DtString& propertyName, luabind::object const& inProp,
127  DtPropertyInterface* outProp);
128 
129  bool setListPropFromLua(const DtString& propertyName, luabind::object const& inProp,
130  DtPropertyInterface* outProp);
132 
133 
135  typedef bool (*propToLuaFnc)(lua_State* L, const DtString& propertyName,
136  const DtPropertyInterface* inProp, luabind::object& outProp);
137 
139 
140  bool setLuaFromStringProp(lua_State* L, const DtString& propertyName,
141  const DtPropertyInterface* inProp, luabind::object& outProp);
142 
143  bool setLuaFromEntityTypeProp(lua_State* L, const DtString& propertyName,
144  const DtPropertyInterface* inProp, luabind::object& outProp);
145 
146  bool setLuaFromObjectTypeProp(lua_State* L, const DtString& propertyName,
147  const DtPropertyInterface* inProp, luabind::object& outProp);
148 
149  bool setLuaFromVerticesProp(lua_State* L, const DtString& propertyName,
150  const DtPropertyInterface* inProp, luabind::object& outProp);
151 
152  bool setLuaFromOffsetVerticesProp(lua_State* L, const DtString& propertyName,
153  const DtPropertyInterface* inProp, luabind::object& outProp);
154 
155  bool setLuaFromIntProp(lua_State* L, const DtString& propertyName,
156  const DtPropertyInterface* inProp, luabind::object& outProp);
157 
158  bool setLuaFromDoubleProp(lua_State* L, const DtString& propertyName,
159  const DtPropertyInterface* inProp, luabind::object& outProp);
160 
161  bool setLuaFromBoolProp(lua_State* L, const DtString& propertyName,
162  const DtPropertyInterface* inProp, luabind::object& outProp);
163 
164  bool setLuaFromVectorProp(lua_State* L, const DtString& propertyName,
165  const DtPropertyInterface* inProp, luabind::object& outProp);
166 
167  bool setLuaFromStructProp(lua_State* L, const DtString& propertyName,
168  const DtPropertyInterface* inProp, luabind::object& outProp);
169 
170  bool setLuaFromListProp(lua_State* L, const DtString& propertyName,
171  const DtPropertyInterface* inProp, luabind::object& outProp);
173 
175  typedef DtPropertyInterface* (*luaToPropCreatorFnc)(const DtString& propertyName, luabind::object const& inProp,
176  DtRwProperties* parent);
177 
179 
180  DtPropertyInterface* createStringPropFromLua(const DtString& propertyName, luabind::object const& inProp,
181  DtRwProperties* parent);
182 
183  DtPropertyInterface* createDoublePropFromLua(const DtString& propertyName, luabind::object const& inProp,
184  DtRwProperties* parent);
185 
186  DtPropertyInterface* createBoolPropFromLua(const DtString& propertyName, luabind::object const& inProp,
187  DtRwProperties* parent);
188 
189  DtPropertyInterface* createTablePropFromLua(const DtString& propertyName, luabind::object const& inProp,
190  DtRwProperties* parent);
191 
192  DtPropertyInterface* createCustomPropFromLua(const DtString& propertyName, luabind::object const& inProp,
193  DtRwProperties* parent);
194 
195  DtPropertyInterface* createStructPropFromLua(const DtString& propertyName, luabind::object const& inProp,
196  DtRwProperties* parent);
197 
198  DtPropertyInterface* createListPropFromLua(const DtString& propertyName, luabind::object const& inProp,
199  DtRwProperties* parent);
200 
201  DtPropertyInterface* createMapPropFromLua(const DtString& propertyName, luabind::object const& inProp,
202  DtRwProperties* parent);
204 
208 
210  const luabind::object& keyValues, int& index);
212  const luabind::object& keyValues, int& index);
214 
219  const luabind::object& keyValues, int& index);
220 
225  const luabind::object& keyValues, int& index);
226 
230  const luabind::object& keyValue);
231 
234 
236  const luabind::object& keyValue);
238  const luabind::object& keyValue);
240 
241  typedef std::map<DtString, luaToPropFnc> DtPropFromLuaFcnMap;
244 
245  typedef std::map<DtString, propToLuaFnc> DtLuaFromPropFcnMap;
248 
249  typedef std::map<int, luaToPropCreatorFnc> DtPropFromLuaCreatorFcnMap;
252 };
253 
bool setLuaFromIntProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
bool setBoolPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
bool setLuaFromEntityTypeProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
bool setLuaFromBoolProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
bool(* luaToPropFnc)(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Function signature for Lua-to-property conversion functions.
Definition: propertySetter.h:91
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.
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.
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...
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 ...
bool setLuaFromVerticesProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
DtPropertyInterface * createCustomPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
bool setUUIDPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
bool setOffsetVerticesPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
bool setPropertyFromLua(const DtString &propertyName, const luabind::object &inProp, DtRwProperties *outProps)
Sets the named property property from a Lua property. Returns true if successful. ...
bool setStructPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
DtPropertyInterface * createDoublePropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
bool setIntPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
bool setLuaFromOffsetVerticesProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
DtPropertyInterface * createMapPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
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 ...
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...
DtPropertyInterface * createStringPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
Interface class used to define minimal interface for a property. The DtPropertyInterface class provid...
Definition: propertyInterface.h:48
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.
DtPropertyInterface * createListPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
bool setLuaFromStructProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
bool setLuaFromListProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
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...
DtPropFromLuaFcnMap & propertyFromLuaFcnMap()
The Lua-to-Property by type.
DtPropFromLuaCreatorFcnMap & propertyFromLuaCreatorFcnMap()
The Lua-to-Property creator by type.
bool setObjectTypePropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
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...
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
DtPropertyInterface * createBoolPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
DtPropertyInterface * createTablePropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
bool setEntityTypePropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
std::map< DtString, luaToPropFnc > DtPropFromLuaFcnMap
Definition: propertySetter.h:241
bool setLuaFromVectorProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
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.
bool setStringPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
bool setDoublePropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
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...
bool setVerticesPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
bool setListPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
bool setLuaFromStringProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
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...
bool setLuaFromObjectTypeProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
Acts as a DtRwList for properties. Only real difference between this class and a DtRwProperties class...
Definition: rwPropertiesList.h:38
A list of properties. A DtPropertyInterface object that is a specialized version of DtRwVariableBindi...
Definition: rwProperties.h:126
DtLuaFromPropFcnMap & luaFromPropertyFcnMap()
The Property-to-Lua by type.
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...
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:135
DtPropertyInterface * createStructPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtRwProperties *parent)
Lua-to-Property creation functions.
std::map< int, luaToPropCreatorFnc > DtPropFromLuaCreatorFcnMap
Definition: propertySetter.h:249
bool setLuaFromDoubleProp(lua_State *L, const DtString &propertyName, const DtPropertyInterface *inProp, luabind::object &outProp)
Property-to-Lua conversion functions.
bool setVectorPropFromLua(const DtString &propertyName, luabind::object const &inProp, DtPropertyInterface *outProp)
Lua-to-Property conversion functions.
std::map< DtString, propToLuaFnc > DtLuaFromPropFcnMap
Definition: propertySetter.h:245

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)