RealList a convenience class for Lua (std::list<number>)
Functions
Type
Name
string
currentScriptPath () Determines the current directory of the the currently running script file.
loadMacros (macro::MacroManager macroManager) Load macros stored at the MacroManager. Loaded macros are callable functions in SoS script context. Loaded macros are stored in the sos_macros Lua table. Example call:
loadMacros () Load macros stored at the MacroManager of the current sos.database(). Loaded macros are callable functions in SoS script context. Loaded macros are stored in the sos_macros Lua table. Example call:
log (number level, string message) Issues a log message to the SoS logger.
setLogLevel (number level=3, int log_id=-1) sets the verbose level of the logger
setMaxNumThreads (number numthreads) Sets the maximum number of threads used in OpenMP.
bool
useCommandLogFile (bool usage=true) Controls the usage of SoS’s command log file.
Detailed Description
Function Documentation
currentScriptPath()
string currentScriptPath()
Determines the current directory of the the currently running script file.The method uses the global interpreter() function to access the Lua state.ReturnsThe current directory of the script being processed at the moment.Exceptions
Name
Description
An
exception if the current script is not a file
loadMacros() [1/2]
loadMacros(macro::MacroManager macroManager)
Load macros stored at the MacroManager. Loaded macros are callable functions in SoS script context. Loaded macros are stored in the sos_macros Lua table. Example call:sos_macros.getNodeMin(sos.database(), “1”, ‘TEMP’, ‘min[TEMP]’)Parameters
Name
Description
macroManager
A reference to the MacroManager. All the macroManager’s macros are loaded.
loadMacros() [2/2]
loadMacros()
Load macros stored at the MacroManager of the current sos.database(). Loaded macros are callable functions in SoS script context. Loaded macros are stored in the sos_macros Lua table. Example call:sos_macros.getNodeMin(sos.database(), “1”, ‘TEMP’, ‘min[TEMP]’)
log() [1/2]
log(string message)
Issues an info log message.Parameters
Name
Description
message
The info log message
log() [2/2]
log( number level, string message)
Issues a log message to the SoS logger.Parameters
Name
Description
level
Defines the log level. Accepts values between [1-5] as well as their corresponding enum values - 1 / logger.ERROR .. error - 2 / logger.WARNING .. warning - 3 / logger.INFO .. info - 4 / logger.DEBUG .. debug - 5 / logger.TRACE .. trace
message
The log message itself
Exceptions
Name
Description
In
case of unknown log level
setLogLevel()
setLogLevel( number level = 3, int log_id = -1)
sets the verbose level of the loggerParameters
Name
Description
level
defines the new log level
log_id
Gives the Id of the logger to set the level for. If omitted all loggers maintained get the same level The following levels exist: - 0 .. no output - 1 .. only errors - 2 .. like 1 + warnings - 3 .. like 2 + info (default) - 4 .. like 3 + debug info - 5 .. like 4 + trace info
setMaxNumThreads()
setMaxNumThreads(number numthreads)
Sets the maximum number of threads used in OpenMP.Parameters
Name
Description
numthreads
the number of threads
Does not have any action if OpenMP is disabled.
useCommandLogFile()
bool useCommandLogFile(bool usage = true)
Controls the usage of SoS’s command log file.Parameters
Name
Description
usage
Set to true (default) if a command log file is desired. False otherwise
ReturnsThe previous state
The command log file will be updated each time the lua interpreter is about to start the execution of a new line of code. This means the physical command log file will be rewritten for EACH LINE! In consequence, at least if there is any change that your loop might get huge for some input, you’re strongly advised to switch command log file support off immediately before entering the loop and to reanable it afterwards
Was this page helpful?
Assistant
Responses are generated using AI and may contain mistakes.