Isis 3 Developer Reference
Isis::PointerCopy< T > Struct Template Reference

Pointer to object policy for copying map elements. More...

#include <CollectorMap.h>

Collaboration diagram for Isis::PointerCopy< T >:
Collaboration graph

Protected Member Functions

copy (const T &src) const
 Allocate new object using copy construtor and new pointer. More...
 

Detailed Description

template<typename T>
struct Isis::PointerCopy< T >

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.

Member Function Documentation

◆ copy()

template<typename T >
T Isis::PointerCopy< T >::copy ( const T &  src) const
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.

Parameters
srcPointer to pointer of new class to allocate
Returns
T Pointer to new object type T

The documentation for this struct was generated from the following file: