00001 // -*- Mode: C++; tab-width: 2; -*- 00002 // vi: set ts=2: 00003 // 00004 // $Id: baseFunctor.h,v 1.11 2005/12/23 17:01:40 amoll Exp $ 00005 // 00006 00007 #ifndef BALL_CONCEPT_BASEFUNCTOR_H 00008 #define BALL_CONCEPT_BASEFUNCTOR_H 00009 00010 #ifndef BALL_COMMON_GLOBAL_H 00011 # include <BALL/COMMON/global.h> 00012 #endif 00013 00014 namespace BALL 00015 { 00016 00022 00026 template <class ArgumentType, class ResultType> 00027 class BALL_EXPORT UnaryFunctor 00028 { 00029 public: 00030 00034 00037 typedef ResultType result_type; 00038 00041 typedef ArgumentType argument_type; 00042 00045 typedef ArgumentType& argument_reference; 00046 00049 typedef const ArgumentType& const_argument_reference; 00050 00053 typedef ArgumentType* argument_pointer; 00054 00057 typedef const ArgumentType* const_argument_pointer; 00058 00060 }; 00061 00065 template <class FirstArgumentType, class SecondArgumentType, class ResultType> 00066 class BALL_EXPORT BinaryFunctor 00067 { 00068 public: 00069 00073 00076 typedef ResultType result_type; 00077 00080 typedef FirstArgumentType first_argument_type; 00083 typedef FirstArgumentType & first_argument_reference; 00086 typedef const FirstArgumentType & const_first_argument_reference; 00089 typedef FirstArgumentType * first_argument_pointer; 00092 typedef const FirstArgumentType * const_first_argument_pointer; 00093 00096 typedef SecondArgumentType second_argument_type; 00099 typedef SecondArgumentType & second_argument_reference; 00102 typedef const SecondArgumentType & const_second_argument_reference; 00105 typedef SecondArgumentType * second_argument_pointer; 00108 typedef const SecondArgumentType * const_second_argument_pointer; 00109 00111 }; 00112 00114 00115 } // namespace BALL 00116 00117 #endif // BALL_CONCEPT_BASEFUNCTOR_H