Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
![]() | Version 1.9 Build 1367 |
|
The control hub and related structures are implementation details -- they impose no structure for the user to operate in. This section describes the standard environment that the user operates in.
The system described here has the following elements:
In brief, I would describe this model as data-centric and moderately coupled.
Note that GUI related issues are outside the scope of this paper, although they will be important for the adoption of this system.
The Object Browser is used to find data and tasks (although to the user they appear in different GUI's). Thereafter it is used to activate operations on the data, and control for the tasks.
class aips_browser { public: Bool add_package(String package_name); Bool remove_package(String package_name); Vector<package_description> active_packages() const; void current_data_directory(String &alias, String &path) const; Bool change_data_directory_to_path(String path); Bool change_data_directory_to_alias(String alias); void rescan_directory(); void show_all(); void set_name_filter(String show_it_match_this_pattern); void set_type_filter(Vector<ObjectType> hide_these_types); Vector<ObjectID> select_objects(); ObjectID launcb_task_control(); set_viewer(ObjectType type, String server_executable); // e.g. so you can follow one set of directories with a different browser ObjectID clone() const; };
Computational applications which only require modest levels of interaction are called tasks for historical reasons. The model here has the following features.
Parameters are named values required by a task to execute. The values may be of type scalar, array, enumeration, parameter set (hence they are hierarchical), ObjectID, or decision. A decision type is an enumeration that is used to select further parameters. Parameters, as well as their allowed and default values, are mapped into a Record.
Besides a name, each individual parameter might have a parameter type. These types are common to all tasks, and are analogous to the known structures, however they need not be of record type (e.g., it could be an ``alias'' to a String''). These types are used by the parameter database, and are useful for documentation (a ``file name'' instead of just ``string''). Each parameter type has a help pointer.
A task has one parameter set which is used to initiate execution. Ongoing execution of the task is controlled by parameters as well. Those parameters will usually be different (more restricted) than the initial parameters. The parameters are fundamentally obtained from the task at run-time, although they can be cached externally for efficiency and browsing purposes.
Parameters may be stored in a parameter database ``by task'' - with multiple named versions. Defaults for particular parameter types may also be stored.
For an arbitrary object, the ``type'' of the task parameter will be its name. This implies that parameter names should be chosen with some care; in particular they should be the same across classes when their purpose is the same.
Task activation follows a particularly simple protocol:
class task { public: Bool go(ObjectRef<task_controller> controller, Bool block); Bool shutdown(); };
The task controller, which is queried by the task, is a more interesting class:
class task_controller { public: // Common services and information that may be of use to the task Int desired_log_level() const; ObjectRef<log_sink> log_displayer(); ObjectRef<help_viewer> help_displayer(); ObjectRef<progress_monitor> progress_displayer(); // These are object-ID's rather than references to prevent unnecessary // linking ObjectID image_displayer_id(); ObjectID plot_displayer_id(); ObjectID table_displayer_id(); Int demand_parameters(const Record ¶form, Record &set_parameters); void set_update_paraform(const Record ¶form); Bool have_update() const; Record get_update() const; Bool have_replay() const; void replay(Vector<Record> &stored_parameters, Vector<Int> &sequence_points) const; // Use for hints, like memory use Record environment() const; };
Note that this protocol allows the ability for a task to ``replay'' itself, even if task parameters are modified while the task is running. This is implemented by the task emitting a ``sequence number'' whenever its parameters are changed (these numbers need not be consecutive - they will often be associated with an algorithm parameter, e.g., iteration number). When a replay is desired, the sequnce numbers are provided along with the sequence of stored parameters.
It is often useful to be able to run ``load and go'' tasks from the host operating systems command line, and not requring a running control hub, etc. This is accomplished by the run-tim-system providing a local task controller which fills in parameters from command line arguments, and returns local objects which print to standard output for help, logging, and progress monitoring. The other object services, like image display, are null.
These are objects which are provided for the user to manipulate directly, often from the command-line interpreter. They fall into the following categories:
It must be emphasized that these services are being provided directly for the end user. They should generally posess fairly simple interfaces. I would suggest that the interfaces should be approved by potential users.