Regina Calculation Engine
Public Types | Public Member Functions | Public Attributes | List of all members
regina::NewFunction1< Base, Arg > Struct Template Reference

Deprecated function object for creating new objects subclassed from Base. More...

#include <utilities/registryutils.h>

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

Public Types

typedef Base * ReturnType
 Indicates the return type for a function object. More...
 

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...
 

Detailed Description

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

Deprecated function object for creating new objects subclassed from Base.

This is 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 non-void variants of forPacket() and forCoords().

Deprecated:
This has been deprecated. Instead you should use NewFunction, which is more flexible and has less overhead.
Python:
Not present.

Member Typedef Documentation

§ ReturnType

typedef Base * regina::Returns< Base * >::ReturnType
inherited

Indicates the return type for a function object.

Constructor & Destructor Documentation

§ NewFunction1()

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
argthe argument to pass to the new object's class constructor.

Member Function Documentation

§ operator()()

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

§ arg_

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:

Copyright © 1999-2016, 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@maths.uq.edu.au).