PSCF v1.1
IFunctor.h
1#ifndef UTIL_I_FUNCTOR_H
2#define UTIL_I_FUNCTOR_H
3
4/*
5* Util Package - C++ Utilities for Scientific Computation
6*
7* Copyright 2010 - 2017, The Regents of the University of Minnesota
8* Distributed under the terms of the GNU General Public License.
9*/
10
11#include <list>
12
13namespace Util
14{
15
23 template <typename T=void>
24 class IFunctor {
25
26 public:
27
31 virtual ~IFunctor(){}
32
38 virtual void operator () (const T& t) = 0;
39
40 };
41
42 // Functor for functions with no arguments.
43
49 template <>
50 class IFunctor<void> {
51
52 public:
53
57 virtual ~IFunctor(){}
58
62 virtual void operator () () = 0;
63
64 };
65
66}
67#endif
virtual ~IFunctor()
Destructor (virtual)
Definition: IFunctor.h:57
Interface for functor that wraps a void function with one argument (abstract).
Definition: IFunctor.h:24
virtual void operator()(const T &t)=0
Call the associated function.
virtual ~IFunctor()
Destructor (virtual)
Definition: IFunctor.h:31
Utility classes for scientific computation.
Definition: accumulators.mod:1