Application :: initialize - Initialize application
The function (re)initializes default settings for the application from a configuration or ini-file. The function enables an application accessing default application resources defined in ode.sys and data and file catalogs. The function should be called before creating any data source and any other client.
Initializing the application, system services as the error handling or data catalog are initialized. In order to support system resources, the configuration file should contain a SYSTEM section, defining the options for the system database to retrieve error messages. When the configuration file contains a DATA-CATALOG and/or a FILE-CATALOG section
The function can be called more than ones. Any time calling the function will reopen global application resources.
Besides, the function initializes the options for the application.
Application::initialize(myIniFile,"MyAppl",ConsoleApplication);
Implementation overview
- Initialize application with separate client
Application :: initialize ( rClient, sIniFile, sApplicationName, eApplicationType ) - Initialize main client for application
Application :: initialize ( sIniFile, sApplicationName, eApplicationType )
Implementation details
-
Initialize application with separate client
Application  :: initialize ( odaba::Client &rClient, odaba::String &sIniFile, odaba::String &sApplicationName, odaba::ApplicationTypes eApplicationType )
The function initializes an application with a separate client.
- rClient
- Client handle
The client handle refers to an (usually) opened ODABA client. Calling functions with invalid client handles may cause an exception. For checking the client handle, isValid() can be called.
- sIniFile
- Path to ini-file location
The path may contain any type of folder separator ('/' or '\'). Folder separators will be converted according to the conventions of the target system.
In order to pass no ini-file, an empty string ( String() ) has to be passed.
- sApplicationName
- Application name
The name of the application is, usually, also the section name for application options in the configuration or ini-file.
In order to pass no application name, an empty string ( String () ) has to be passed.
- eApplicationType
- Application type
This option indicates that the application will run as console or windows application.
to list
- rClient
- Client handle
-
Initialize main client for application
Application  :: initialize ( odaba::String &sIniFile, odaba::String &sApplicationName, odaba::ApplicationTypes eApplicationType )
The configuration file passed in sIniFile is set as default for option settings. The name for the default section in sIniFile used for retrieving options, is passed in sApplicationName . This is usually the section defining the application data source. Options defined in the default section need not to be prefixed by section name but can be read directly ( option("DATABASE") instead of option("myAppl.DATABASE") )
The application type passed in eApplicationType defines whether the application runs as GUI application or as console application.
In order to initialize the options for the application, initializeOptions( sIniFile,sApplicationName ) is called.
- sIniFile
- Path to ini-file location
The path may contain any type of folder separator ('/' or '\'). Folder separators will be converted according to the conventions of the target system.
In order to pass no ini-file, an empty string ( String() ) has to be passed.
- sApplicationName
- Application name
The name of the application is, usually, also the section name for application options in the configuration or ini-file.
In order to pass no application name, an empty string ( String () ) has to be passed.
- eApplicationType
- Application type
This option indicates that the application will run as console or windows application.
to list
- sIniFile
- Path to ini-file location