1
// Copyright � 1997 - 2001, Paul C. Gregory
3
// Contact: pgregory@aqsis.com
5
// This library is free software; you can redistribute it and/or
6
// modify it under the terms of the GNU General Public
7
// License as published by the Free Software Foundation; either
8
// version 2 of the License, or (at your option) any later version.
10
// This library is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
// General Public License for more details.
15
// You should have received a copy of the GNU General Public
16
// License along with this library; if not, write to the Free Software
17
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
\brief Global Aqsis include to include all files required within Aqsis
22
\author Matthaeus G. Chajdas (Matthaeus@darkside-conflict.net)
25
//? Is .h included already?
26
#ifndef AQERROR_H_INCLUDED
27
#define AQERROR_H_INCLUDED 1
29
//! A callback/functor class to perform range checks
31
* This class is an abstract base class. In order to use the range check
32
* class, you need to derive a class from this (see CqLogRangeCheckCallback in ri.cpp)
33
* The function call takes an argument which is the result of a CheckMinMax function call.
36
class CqRangeCheckCallback
39
virtual void operator()( int res) = 0;
40
virtual void Call( int res )
42
this->operator()( res );
45
enum { LOWER_BOUND_HIT,
50
//! Range check funtion using CqRangeCheckCallback
54
* Calls a CqRangeCheckCallback functor class, which is responsible for the output.
55
* \return A boolean indicating whether the variable val is inside the range [min,max]
58
bool CheckMinMax( const T& val, const T& min, const T& max, CqRangeCheckCallback* callBack)
62
(*callBack)( CqRangeCheckCallback::LOWER_BOUND_HIT );
68
(*callBack)( CqRangeCheckCallback::UPPER_BOUND_HIT );
72
(*callBack)( CqRangeCheckCallback::VALID );