OOLua  2.0.1
C++ and Lua binding
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
File Generation

Lua module for generating configurable OOLua boilerplate code. More...

Functions

function gen (options, path)
 Generate boilerplate header files. More...
 
function default_details ()
 Returns the library defaults and details. More...
 
function defaults ()
 Gets the default options as key(string) and value(number) entries in a table. More...
 

Detailed Description

Lua module for generating configurable OOLua boilerplate code.

The "oolua_generate" Lua module provides information about the default limits for the library. It enables the generation of boilerplate code using user defined limits or regeneration of files with the default values. The details of these configurable values being :

return
{
lua_params =
{
desc ='Maximum amount of parameters for a call to a Lua function'
,value=10
}
,cpp_params =
{
desc='Maximum number of parameters a C++ function can have'
,value=8
}
,constructor_params =
{
desc='Maximum amount of parameters for a constructor of a proxied type'
,value=5
}
,class_functions =
{
desc='Maximum amount of class functions that can be registered for each proxied type'
,value=15
}
}

The most common change to these options is the number of functions which can be registered for a proxy class, this limit applies individually to constant and none constant functions, base class methods that are registered in a base class do not decrease the count for a derived class.
Using the Lua interpreter to regenerate the OOLua files increasing this option whilst using default values for the remaining options:

lua -e "require'build_scripts.oolua_generate'.gen({class_functions=30},'include/')"

For convenience you do not need a version of Lua installed on a machine to run this module, Premake the project file generator used in OOLua already contains a copy of Lua 5.1 (it has some modifications to the core libraries). To generate the files with the same options as above :

premake4 --class_functions=30 oolua-gen

The module returns a table with the following functions

return { gen = gen, defaults=defaults, default_details=default_details }

Function Documentation

function default_details ( )

Returns the library defaults and details.

–]]

Returns a table detailing the library defaults and descriptions

return
{
lua_params =
{
desc ='Maximum amount of parameters for a call to a Lua function'
,value=10
}
,cpp_params =
{
desc='Maximum number of parameters a C++ function can have'
,value=8
}
,constructor_params =
{
desc='Maximum amount of parameters for a constructor of a proxied type'
,value=5
}
,class_functions =
{
desc='Maximum amount of class functions that can be registered for each proxied type'
,value=15
}
}
Returns
Table of the format { config_option ={desc='blurb',value=0} }
function defaults ( )

Gets the default options as key(string) and value(number) entries in a table.

Modifies the table returned by default_details so the it is formatted correctly for any functions it will be passed to.

Returns
Table of the format { config_option = 0 }
See Also
default_details
function gen ( options  ,
path   
)

Generate boilerplate header files.

Parameters
options[optional] Defaults to the library defaults
path[optional] Defaults to the current working directory

Generates boilerplate C++ files code required for OOLua using the passed options or if an option is not present then the default is used. If Path is not nil then it is required to be a string which is slash postfixed.