Inherited by application_example
[virtual], test_array, test_bcast_spocket
[virtual], test_file_info, test_file_time, test_filename
[virtual], test_packable_tree, test_parsing_csv
[virtual], test_string, test_string_table
[virtual], transporter, unpacker_stub, value_tagger, version_stamper, vsts_version_fixer, and write_build_config.
Public Member Functions
|constructs an application_shell to serve as the root of the program. |
|virtual int||execute_application ()|
|runs the base class's execute() method and catches any exceptions due to it. |
|int||exit_value () const|
|once the application has finished executing, this will contain the exit value. |
|const mathematics::chaos &||randomizer () const|
|provides access to the random number generator owned by this app. |
|virtual basis::outcome||log (const basis::base_string &to_print, int filter=basis::ALWAYS_PRINT)|
|< returns the full name of the current application. |
Static Public Member Functions
|static application_shell *||single_instance ()|
|in a program with a single application_shell extant, this gives out the instance. |
Protected Member Functions
|virtual int||execute ()=0|
|< retrieves the command line from the /proc hierarchy on linux. |
The application_shell is a base object for console programs.
It is generally used in that context (console mode), but can be employed as the root of windowed programs also. The application_shell provides a few features, such as logging functionality, that make it a bit easier than starting up a program from scratch every time.
|virtual int application::application_shell::execute||(||)||
< retrieves the command line from the /proc hierarchy on linux.
< seeks out process info for a particular process. forwards base_application responsibility upwards to derived objects. this should not be invoked by anyone in general; it is automatically called from the constructor of this class.
Implemented in write_build_config.
Referenced by execute_application().
runs the base class's execute() method and catches any exceptions due to it.
you can override this method, but generally should never need to. the derived class's method should catch exceptions and deal with them meaningfully also.
|int application::application_shell::exit_value||(||)|| const
|outcome application::application_shell::log||(||const basis::base_string &||to_print,|
|int|| filter = |
< returns the full name of the current application.
< returns the process id for this task, if that's relevant on the OS. < returns the current directory as reported by the operating system. as above, logs a line "to_print" but only if the "filter" is enabled. the second version uses the filter value to assess whether to print the string or not. the string will not print if that filter is not enabled for the program wide logger.
|const mathematics::chaos& application::application_shell::randomizer||(||)|| const
|application_shell * application::application_shell::single_instance||(||)||
in a program with a single application_shell extant, this gives out the instance.
if there are more than one application_shells floating around a program, then this will only give out the most recently registered. note that this pointer is not the slightest bit thread safe if it's changing after the application shell has been constructed, and that it cannot be relied upon until that's happened either. be careful. do not use it in any function that might be invoked during program shutdown.