#include <ShoreApp.h> void *T::operator new(unsigned int size, const char *path, mode_t mode); void *T::operator new(unsigned int size, REF(Pool) pool);
These operators create new Shore objects of type T. In both cases, the size argument is supplied by the C++ compiler, not by the application. The first form creates a registered object named by path and with a mode given by mode (see umask(oc) for a description of how the actual mode is determined). The second form creates an anonymous object in the pool given by pool. If an error occurs during the creation of the object, then the currently installed error handler is called. An alternate interface for Shore object creation is REF(T)::new_persistent (see create(oc) ).
C++ specifies that operator new must return a "void *". However, applications should never assign the result of the Shore new operators to a "void *" or "T *" variable. Instead, they should REF(T)::operator= (see assign(oc) ) to assign it to variable of type REF(T).
REF(Part) part; REF(Pool) pool; // create new registered part object part = new("/home/ned/part", 0644) Part; // create new anonymous part object in the given pool pool = ... part = new(pool) Part;The first call to operator new creates a registered part object with pathname "/home/ned/part" and mode 0644. The second call creates an anonymous part object in the given pool.