CREATE(CXXLB)

Shore Programmer's Manual - 2 August 96

NAME

create \- create Shore object

SYNOPSIS

#include <ShoreApp.h>

static shrc Ref<T>::new_persistent(const char *path,
                                   mode_t mode,
                                   Ref<T> &returned_ref);

static shrc Ref<T>::new_persistent(Ref<Pool> pool,
                                   Ref<T> &returned_ref);

DESCRIPTION

These methods create new Shore objects of type T. The first form creates a registered object whose pathname is given by path, and whose mode is given by mode (see umask(oc) for a description of how the actual mode bits are determined). The second form creates an anonymous object in the pool given by pool. In both cases, a pointer to the new object is returned in returned_ref, upon successful completion. An alternate interface to object creation is T::operator new (see new(cxxlb) ).

WARNING

This is the preferred way to create registered objects (rather than using the new operator for a type) because this is the only way to discover the occurrence of an error in the process of creating the object. Many errors can occur when trying to create a registered object (the object already exists, you don't have write permission in that directory, etc).

VERSION

This manual page applies to Version 1.0 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-92-C-Q508.

COPYRIGHT

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

SEE ALSO

intro(cxxlb) , ref(cxxlb) , new(cxxlb) , umask(oc) .