#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);
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) ).
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).