# Class: LuxModule

### LuxModule: luxinialuacore

LuxModules are luascripts that are part of the official Luxinia distribution. LuxModules are not related to the module and package system of lua. LuxModules are creating lot's of global functionnames, so watch out for problems for namespaces.

LuxModules are extending the luxinia API with addtitional scripts for simplified use. In difference to the native API of Luxinia, modules are implemented within the scripting of Luxinia. LuxModules extend Luxinia with functions and classes that are simpler to use than the native API functions. This means that you can modify the modules, but you should always keep in mind that Luxinia can and should be used for different projects and maybe not only for your own projects. Changing the official scripts may cause problems with other projects that are not written by you into. Even worse, changes on the official scripts can will need you to update your modified scripts, too.
However, you may write your own modules that fits into the modulestructure of Luxinia. By doing so, you can extend Luxinia in a way that other can easily use, too.

## Methods:

### Method overview:

- getClassInfo
- getLuxModuleDescription
- getclasses
- getclasshierarchy
- getclassinfo
- load
- modulenames
- register
- registerclass
- registerclassfunction
- setLuxModuleDescription

getClassInfo (table obj/string name)
  returns: ([string name, modulename,description, table functionhelp, string parent, table interfaces])
  returns name and modulename of the given class or object if possible. If a string was passed, the name and the modulename is returned if it is a registered class. Additionally, the description of the class and the description of the functions is returned as a table where the keys are the functionnames and the values are the functiondescriptions.
getLuxModuleDescription (string modulename)
  returns: ([string])
  return description of LuxModule
getclasses (string modulename)
  returns: (table classes)
  Returns the classes as a table. This prevents overriding previously defined global variables as described in 'load'. I.e. if a LuxModule named 'foo' is loaded and it contains the classes 'a' and 'b', the returned table contains the two classes 'a' and 'b'.
getclasshierarchy (string modulename)
  returns: (table hierarchy, table allclasses)
  returns a hierarchy in a datastructure that is compatible to the used format in the autodoc.lua file.
getclassinfo (string modulename, string classname)
  returns: ()
  returns all known information on a class of a LuxModule
load (string modulename)
  returns: ()
  Puts all the classes that belong to the LuxModule into the global variable space. I.e. if a LuxModule has a certain class that's name is 'foo', the class can be used from now on by simply using the name 'foo'. This can of course override your own tables or even classes of other modules. If this is a problem to you, you can use getclasses instead, which returns a table of classes.
modulenames ()
  returns: (table modulenames, int count)
  returns names and number of known modules.
register (string modulename, string description)
  returns: ()
  Registers a modulename as LuxModule. The description should explain what the whole LuxModule is good for.
registerclass (string modulename,string name, string/function/table description, table class, table help, [string parent],[table interfaces], [boolean isthreadsafe], [table threadsafefunctions])
  returns: ()

  registers a class that is part of a certain LuxModule with a certain name. The help table should describe each function of the class with the functionname as key and a descriptionstring that describes the arguments and functiondetails. You can optionally define the name of the parentclass and the names of the interfaces. This has only a hierachical purpose for the documentation.

  If the description is a function, the function is called with the modulename and classname as argument. It may return a string or a table.

  If the description is a table, it is concatenated to a string.

registerclassfunction (string modulename,string classname,string functionname,string description)
  returns: ()
  sets a functiondescription for a function of a class.
setLuxModuleDescription (string modulename, string/function description)
  returns: ()
  sets description of LuxModule