IlsScriptManager
 
IlsScriptManager
Category 
Dynamic modeling
Inheritance Path 
IlsScriptManager
Description 
This class is the Rogue Wave Server Script Manager. Its utility methods allow you to manage Rogue Wave Views Script scripts that have been loaded to the server. The Rogue Wave Views Script integration is automatically initialized if you run a dynamic view server with dynamic modeling capabilities (see the class IlsDynMvServer).
Library 
<server>
Header File 
#include <ilserver/scriptmgr.h>
Synopsis 
class IlsScriptManager
{
public:
Loading Scripts
static IlsBoolean LoadScript(const IlsString& filename);
static IlsBoolean LoadScriptFromString(const IlsString& code);
static IlsBoolean OnLoad(int argc=0,
char** argv=0,
IlsBoolean checkError = IlsFalse);
Trace Mode
static IlsBoolean IsTraced();
static void SetTraced(IlsBoolean b);
Others
static IlsMvValue CallFunction(const IlsString& funcName,
IlsMvValue* args,
int nbParam,
IlsBoolean checkError = IlsTrue,
IlsBoolean useArray=IlsFalse);
static void UseDebugger(IlsBoolean b);
static void SetRaiseExceptionOnError(IlsBoolean b=IlsTrue);
};
Member Functions 
Loading Scripts
[static] IlsBoolean LoadScript(const IlsString& filename);
This static member function loads a script file to memory.
[static] IlsBoolean LoadScriptFromString(const IlsString& code);
This static member function loads the script contained in the string code to memory.
[static] IlsBoolean OnLoad(int argc=0,
char** argv=0,
IlsBoolean checkError = IlsFalse);
This static member function calls the script function OnLoad(args) if it exists. The args parameter is a script array which contains the arguments you provided when you called this function.
Trace Mode
[static] void SetTraced(IlsBoolean b);
[static] IlsBoolean IsTraced();
These static member functions respectively set or test a specific trace mode for the Rogue Wave Script integration. If trace mode is enabled, a trace is displayed each time a method is called from or to C++ code.
Others
[static] IlsMvValue CallFunction(const IlsString& funcName,
IlsMvValue* args,
int nbParam,
IlsBoolean checkError = IlsTrue,
IlsBoolean useArray=IlsFalse);
This static member function invokes the script function funcName if it exists, passing it the provided arguments. If the checkError argument is true, an error will be raised if the function does not exist. The useArray parameter specifies whether the arguments are passed as an Rogue Wave Script array, or as independent function arguments.
[static] void UseDebugger(IlsBoolean b);
Call this static member function with the argument set to IlsTrue before the dynamic-view server is initialized so as to enable the default Rogue Wave Views Script debugger in console mode. The dynamic-view server must also have been initialized in console mode (see the member function IlsDynMvServer::Initialize).
[static] void SetRaiseExceptionOnError(IlsBoolean b=IlsTrue);
If the b property is true, an Rogue Wave Script exception is raised if an error occurs when Server objects are accessed from a script. The script function resumes its execution. If b is set to IlsFalse, an error message is displayed but the script function continues its execution. By default, this property is set to IlsFalse, meaning that no exception is raised).
See Also 
IlsDynMvServer

Version 5.8
Copyright © 2014, Rogue Wave Software, Inc. All Rights Reserved.