regina::NewFunction1< Base, Arg > Struct Template Reference

A function object that creates a new object subclassed from Base, where the particular subclass is chosen according to the template argument to operator(). More...

`#include <utilities/registryutils.h>`

Inheritance diagram for regina::NewFunction1< Base, Arg >:

## Public Member Functions

| NewFunction1 (Arg arg)
| Creates a new function object, whose bracket operator will create a new object by passing arg to its constructor. More...
template<typename Info >
Base * | operator() (Info)
| Creates a new object of the subclass Info::Class. More...

## Public Attributes

size_t | arg_
| The length of the new vector to create. More...

## Additional Inherited Members

Public Types inherited from regina::Returns< Base * >
typedef Base * | ReturnType
| Indicates the return type for a function object. More...

## Detailed Description

### template<class Base, typename Arg>
struct regina::NewFunction1< Base, Arg >

A function object that creates a new object subclassed from Base, where the particular subclass is chosen according to the template argument to operator().

The template argument to the bracket operator would typically be one of the registry helper classes, such as PacketInfo or NormalInfo.

The new object will be created using a single-argument constructor, where the argument is of type Arg.

This routine is intended for use with registry routines, such as the three-argument variants of forPacket() and forCoords().

Python:
  Not present.

## Constructor & Destructor Documentation

template<class Base , typename Arg >

regina::NewFunction1< Base, Arg >::NewFunction1 | ( | Arg | arg | ) |

inline

Creates a new function object, whose bracket operator will create a new object by passing arg to its constructor.

Parameters

  arg | the argument to pass to the new object's class constructor.

## Member Function Documentation

template<class Base , typename Arg >
template<typename Info >

Base* regina::NewFunction1< Base, Arg >::operator() | ( | Info |  | ) |

inline

Creates a new object of the subclass Info::Class.

The object will be created using a single-argument constructor for Info::Class, and the argument to this constructor will be the same argument arg that was passed to this function object's NewFunction1 constructor.

Precondition
  It is known in advance that Info::Class will be a subclass of Base.

Returns
  a new object of the subclass Info::Class.

## Member Data Documentation

template<class Base , typename Arg >

size_t regina::NewFunction1< Base, Arg >::arg_

The length of the new vector to create.

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

- utilities/registryutils.h

Copyright © 1999-2013, The Regina development team
This software is released under the GNU General Public License, with some additional permissions; see the source code for details.
For further information, or to submit a bug or other problem, please contact Ben Burton (bab@debian.org).