📄 uchar.hpp
字号:
/* * Open BEAGLE * Copyright (C) 2001-2005 by Christian Gagne and Marc Parizeau * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * * Contact: * Laboratoire de Vision et Systemes Numeriques * Departement de genie electrique et de genie informatique * Universite Laval, Quebec, Canada, G1K 7P4 * http://vision.gel.ulaval.ca * *//*! * \file beagle/UChar.hpp * \brief Definition of the type UChar and related operators. * \author Christian Gagne * \author Marc Parizeau * $Revision: 1.5 $ * $Date: 2005/09/30 15:04:54 $ */#ifndef Beagle_UChar_hpp#define Beagle_UChar_hpp#include "beagle/config.hpp"#include "beagle/macros.hpp"#include "beagle/WrapperT.hpp"namespace Beagle {/*! * \brief Beagle wrapper of the atomic unsigned char type. * \ingroup Adapt */typedef WrapperT< unsigned char > UChar;}/*! * \brief Test whether an unsigned char is less than another. * \param inLeftUChar Left unsigned char compared. * \param inRightUChar Right unsigned char compared. * \return True if left unsigned char is less than the right one, false if not. * \par Note: * The operator is defined relatively to the function isLess of Beagle::UChar. */inline bool operator<(const Beagle::UChar& inLeftUChar, const Beagle::UChar& inRightUChar){ Beagle_StackTraceBeginM(); return inLeftUChar.isLess(inRightUChar); Beagle_StackTraceEndM("bool operator<(const UChar& inLeftUChar, const UChar& inRightUChar)");}/*! * \brief Test whether an unsigned char is less than, or equal to another. * \param inLeftUChar Left unsigned char compared. * \param inRightUChar Right unsigned char compared. * \return True if left unsigned char is less than, or equal to the right one, false if not. * \par Note: * The operator is defined relatively to the functions isLess and isEqual of Beagle::UChar. */inline bool operator<=(const Beagle::UChar& inLeftUChar, const Beagle::UChar& inRightUChar){ Beagle_StackTraceBeginM(); return ( inLeftUChar.isLess(inRightUChar) || inLeftUChar.isEqual(inRightUChar) ); Beagle_StackTraceEndM("bool operator<=(const UChar& inLeftUChar, const UChar& inRightUChar)");}/*! * \brief Test whether an unsigned char is more than another. * \param inLeftUChar Left unsigned char compared. * \param inRightUChar Right unsigned char compared. * \return True if left unsigned char is more than the right one, false if not. * \par Note: * The operator is defined relatively to the function isLess of Beagle::UChar. */inline bool operator>(const Beagle::UChar& inLeftUChar, const Beagle::UChar& inRightUChar){ Beagle_StackTraceBeginM(); return inRightUChar.isLess(inLeftUChar); Beagle_StackTraceEndM("bool operator>(const UChar& inLeftUChar, const UChar& inRightUChar)");}/*! * \brief Test whether an unsigned char is more than, or equal to another. * \param inLeftUChar Left unsigned char compared. * \param inRightUChar Right unsigned char compared. * \return True if left unsigned char is more than, or equal to the right one, false if not. * \par Note: * The operator is defined relatively to the functions isLess and isEqual of Beagle::UChar. */inline bool operator>=(const Beagle::UChar& inLeftUChar, const Beagle::UChar& inRightUChar){ Beagle_StackTraceBeginM(); return ( inRightUChar.isLess(inLeftUChar) || inLeftUChar.isEqual(inRightUChar) ); Beagle_StackTraceEndM("bool operator>=(const UChar& inLeftUChar, const UChar& inRightUChar)");}/*! * \brief Test whether an unsigned char is equal to another. * \param inLeftUChar Left unsigned char compared. * \param inRightUChar Right unsigned char compared. * \return True if left unsigned char is equal to the right one, false if not. * \par Note: * The operator is defined relatively to the function isEqual of Beagle::UChar. */inline bool operator==(const Beagle::UChar& inLeftUChar, const Beagle::UChar& inRightUChar){ Beagle_StackTraceBeginM(); return inLeftUChar.isEqual(inRightUChar); Beagle_StackTraceEndM("bool operator==(const UChar& inLeftUChar, const UChar& inRightUChar)");}/*! * \brief Test whether an unsigned char is not equal to another. * \param inLeftUChar Left unsigned char compared. * \param inRightUChar Right unsigned char compared. * \return True if left unsigned char is not equal to the right one, false if it is. * \par Note: * The operator is defined relatively to the function isEqual of Beagle::UChar. */inline bool operator!=(const Beagle::UChar& inLeftUChar, const Beagle::UChar& inRightUChar){ Beagle_StackTraceBeginM(); return ( inLeftUChar.isEqual(inRightUChar) == false); Beagle_StackTraceEndM("bool operator!=(const UChar& inLeftUChar, const UChar& inRightUChar)");}/*! * \brief Compare equality of a UChar with a unsigned char. * \param inLeftUChar Left value to compare. * \param inRightUChar Right value to compare. * \return Result of the comparison. */inlinebool operator==(const Beagle::UChar& inLeftUChar, unsigned char inRightUChar){ Beagle_StackTraceBeginM(); return inLeftUChar.getWrappedValue() == inRightUChar; Beagle_StackTraceEndM("bool operator==(const UChar& inLeftUChar, unsigned char inRightUChar)");}/*! * \brief Compare inequality of a UChar with a unsigned char. * \param inLeftUChar Left value to compare. * \param inRightUChar Right value to compare. * \return Result of the comparison. */inlinebool operator!=(const Beagle::UChar& inLeftUChar, unsigned char inRightUChar){ Beagle_StackTraceBeginM(); return inLeftUChar.getWrappedValue() != inRightUChar; Beagle_StackTraceEndM("bool operator!=(const UChar& inLeftUChar, unsigned char inRightUChar)");}/*! * \brief Test if a UChar is < than a unsigned char. * \param inLeftUChar Left value to compare. * \param inRightUChar Right value to compare. * \return Result of the comparison. */inlinebool operator<(const Beagle::UChar& inLeftUChar, unsigned char inRightUChar){ Beagle_StackTraceBeginM(); return inLeftUChar.getWrappedValue() < inRightUChar; Beagle_StackTraceEndM("bool operator<(const UChar& inLeftUChar, unsigned char inRightUChar)");}/*! * \brief Test if a UChar is <= than a unsigned char. * \param inLeftUChar Left value to compare. * \param inRightUChar Right value to compare. * \return Result of the comparison. */inlinebool operator<=(const Beagle::UChar& inLeftUChar, unsigned char inRightUChar){ Beagle_StackTraceBeginM(); return inLeftUChar.getWrappedValue() <= inRightUChar; Beagle_StackTraceEndM("bool operator<=(const UChar& inLeftUChar, unsigned char inRightUChar)");}/*! * \brief Test if a UChar is > than a unsigned char. * \param inLeftUChar Left value to compare. * \param inRightUChar Right value to compare. * \return Result of the comparison. */inlinebool operator>(const Beagle::UChar& inLeftUChar, unsigned char inRightUChar){ Beagle_StackTraceBeginM(); return inLeftUChar.getWrappedValue() > inRightUChar; Beagle_StackTraceEndM("bool operator>(const UChar& inLeftUChar, unsigned char inRightUChar)");}/*! * \brief Test if a UChar is >= than a unsigned char. * \param inLeftUChar Left value to compare. * \param inRightUChar Right value to compare. * \return Result of the comparison. */inlinebool operator>=(const Beagle::UChar& inLeftUChar, unsigned char inRightUChar){ Beagle_StackTraceBeginM(); return inLeftUChar.getWrappedValue() >= inRightUChar; Beagle_StackTraceEndM("bool operator>=(const UChar& inLeftUChar, unsigned char inRightUChar)");}/*! * \brief Increment a UChar (prefix version). * \param inUChar UChar to increment. * \return UChar incremented. */inlineBeagle::UChar& operator++(Beagle::UChar& inUChar){ Beagle_StackTraceBeginM(); inUChar.getWrappedValue()++; return inUChar; Beagle_StackTraceEndM("UChar& operator++(UChar& inUChar)");}/*! * \brief Increment a UChar (postfix version). * \param inUChar UChar to increment. * \return UChar before being incremented. */inlineBeagle::UChar operator++(Beagle::UChar& inUChar, int){ Beagle_StackTraceBeginM(); Beagle::UChar lUChar = inUChar; inUChar.getWrappedValue()++; return lUChar; Beagle_StackTraceEndM("UChar operator++(UChar& inUChar, int)");}/*! * \brief Add two UChar. * \param inLeftUChar Left value to add. * \param inRightUChar Right value to add. * \return Result of the addition. */inline
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -