An official website of the United States government
Here’s how you know
Official websites use .gov
A
.gov website belongs to an official government
organization in the United States.
Secure .gov websites use HTTPS
A
lock
( ) or https:// means you’ve safely connected to
the .gov website. Share sensitive information only on official,
secure websites.
Isis 3 Programmer Reference
|
Pointer to object policy for copying map elements. More...
#include <CollectorMap.h>
Protected Member Functions | |
T | copy (const T &src) const |
Allocate new object using copy construtor and new pointer. | |
Private Member Functions | |
template<typename P> | |
P * | allocate (const P &obj) const |
Allocate new object using copy constructor. | |
Pointer to object policy for copying map elements.
Defines a copy method to properly handle pointers to objects (assumed) when copying the complete CollectorMap. This implementation assumes the copy constructor properly handles the creation of a new element from a different one.
This policy assumes the assignment operator handles the proper copying of each element T* in the collection.
This employs an intersting technique of redirection. Because the type T is actually T*, the templated allocate() method exists to get down to the T class base level. Looks strange but it works.
Definition at line 214 of file CollectorMap.h.
|
inlineprivate |
Allocate new object using copy constructor.
obj | Source object to create new one from |
Definition at line 239 of file CollectorMap.h.
Referenced by copy().
|
inlineprotected |
Allocate new object using copy construtor and new pointer.
This copy method takes a pointer to a pointer (T is actually a T*) and allocates a new object using the copy constructor.
src | Pointer to pointer of new class to allocate |
Definition at line 226 of file CollectorMap.h.
References allocate().