INIT(OC)

Shore Programmer's Manual - 3 November 94

NAME

init \- object cache initialization and shutdown methods

SYNOPSIS

#include <ShoreApp.h>
shrc Shore::init(const char *progname = "app",
                 const char *rcfile = 0);

shrc Shore::exit();

shrc Shore::default_options(const char* progname,
                            const char *rcfile = 0);

shrc Shore::process_options(const char *progclass,
                            const char *progname,
                            const char *rcfilename,
                            const char *usage,
                            setup_options_func my_options,
                            option_group_t **options);

DESCRIPTION

Init initializes the object cache and initiates a connection with the Shore Server. It must be called before attempting to being a transaction. Note that this method does not, itself, begin a transaction; see transaction(oc) .

Init also checks to see if options have been initialized. If not, it calls default_options, passing the given progname and rcfile.

Exit terminates the connection with the Shore server and frees all memory resources used by the object cache. Any running transaction must be committed before calling this method; if a transaction is running when this method is called, it will be aborted. For many applications it is not necessary to call this method at all, as the connection with the Shore server will be severed when the application process exits. However, applications wishing to reclaim resources held by the object cache can use this method to do so. Furthermore, init can be called after exit if the application wishes to run more transactions, although any number of transactions can be run after a single call to init.

Default_options initializes the Shore options and reads the option configuration file rcfile. If rcfile is a relative pathname (does not start with "/"), then default_options first searches for it in $HOME, and then in the current directory. Any line in the rcfile that matches shore.client.progname.optionname: value will be used to set an option value. For more information on options options(svas) , specifically the section on client options.

Process_options allows more sophisticated use of the options facility. For an example of how to use this function, see process_options(oc) or the OO7 example in examples/oo7.

VERSION

This manual page applies to Version 0.1 of theShore software.

SPONSORSHIP

The Shore project is sponsored by the Advanced Research Project Agency, ARPA order number 018 (formerly 8230), monitored by the U.S. Army Research Laboratory under contract DAAB07-91-C-Q518.

COPYRIGHT

Copyright (c) 1994 Computer Sciences Department, University of Wisconsin -- Madison. All Rights Reserved.

SEE ALSO

process_options(oc) , transaction(oc) , and options(svas) .