Fermi Physics Class Libraries Module: ValuePtr


ValuePtr Class Package

This mini-package provides a simple template class, ValuePtr, that can serve as a pointer to an object, with the property that when the ValuePtr is copied, it creates its own copy of the object pointed to as well.

This copy is made using the object's virtual clone() method if such a method exists, or using the copy constructor if not. That mkae it possible for a ValuePtr that is declared to point to some base class B but actually is used to point to a derived class D to make a clone of the full D object rather than its B slice.

Complete documentation may be found at a Guru-of-the-week page.
In the origianl article, this concept was called HolderPtr. We have changed the name to ValuePtr, which is the name now used in Boost and elsewhere.

This package may be obtained from the following sources:

Walter Brown, Module Coordinator
Fermilab Physics Class Library Task Force

Comments, questions about getting started, feature needs, and bug/annoyance reports may be sent to zoom-support@fnal.gov or zoom@fnal.gov.

This class was adapted from an idea presented by H.P. Sutter on the Guru of the Week Solution number 62. It was presented by Marc Paterno. Walter Brown edited the result for conformance to Zoom standards.

ZMtools main page - ZOOM Home Page - Fermilab at Work - Fermilab Home

Walter Brown
Last modified: May 19, 2000.