METHOD(OC)

Shore Programmer's Manual - 3 November 94

NAME

method \- method calls on Shore objects

SYNOPSIS

#include <ShoreApp.h>
const T *REF(T)::operator->() const

DESCRIPTION

Operator-> is used to call methods on Shore objects. If the object referenced by the ref is not resident in the object cache then it is fetched from the Shore server. If the method is a "const" method, then an SH-mode (share-mode) lock is obtained on the object if it is not already locked in SH or a higher mode. If the method is not a "const" method, then the application must first call REF(T)::update (see update(oc) ) to inform Shore of its intent to modify the object.

If operator-> encounters any errors, then it calls the installed error handler. Applications can reduce the possibility of such errors using REF(T)::valid (see valid(oc) ) or REF(T)::fetch (see fetch(oc) ), to determine the validity of the ref before attempting to call a method on its target.

EXAMPLE

The following code fragment illustrates method calls on Shore objects.
REF(Part) part;
long partid;

part = ...;

partid = part->get_partid();

part.update()->set_partid(partid);
"Get_partid" can be called directly if it is a "const" method. "Set_partid" requires a call to update to notify Shore of the application's intent to modify the object.

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

ref(oc) , fetch(oc) , update(oc) , valid(oc) .