📄 ushort.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/UShort.hpp * \brief Definition of the type UShort and related operators. * \author Christian Gagne * \author Marc Parizeau * $Revision: 1.6 $ * $Date: 2005/09/30 15:04:54 $ */#ifndef Beagle_UShort_hpp#define Beagle_UShort_hpp#include "beagle/config.hpp"#include "beagle/macros.hpp"#include "beagle/WrapperT.hpp"#include "beagle/ArrayT.hpp"namespace Beagle {/*! * \brief Beagle wrapper of the atomic unsigned short type. * \ingroup Adapt */typedef WrapperT< unsigned short > UShort;/*! * \brief Beagle array of the atomic unsigned short type. * \ingroup Adapt */typedef ArrayT< unsigned short > UShortArray;}/*! * \brief Test whether an unsigned short is less than another. * \param inLeftUShort Left unsigned short compared. * \param inRightUShort Right unsigned short compared. * \return True if left unsigned short is less than the right one, false if not. * \par Note: * The operator is defined relatively to the function isLess of Beagle::UShort. */inline bool operator<(const Beagle::UShort& inLeftUShort, const Beagle::UShort& inRightUShort){ Beagle_StackTraceBeginM(); return inLeftUShort.isLess(inRightUShort); Beagle_StackTraceEndM("bool operator<(const UShort& inLeftUShort, const UShort& inRightUShort)");}/*! * \brief Test whether an unsigned short is less than, or equal to another. * \param inLeftUShort Left unsigned short compared. * \param inRightUShort Right unsigned short compared. * \return True if left unsigned short 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::UShort. */inline bool operator<=(const Beagle::UShort& inLeftUShort, const Beagle::UShort& inRightUShort){ Beagle_StackTraceBeginM(); return ( inLeftUShort.isLess(inRightUShort) || inLeftUShort.isEqual(inRightUShort) ); Beagle_StackTraceEndM("bool operator<=(const UShort& inLeftUShort, const UShort& inRightUShort)");}/*! * \brief Test whether an unsigned short is more than another. * \param inLeftUShort Left unsigned short compared. * \param inRightUShort Right unsigned short compared. * \return True if left unsigned short is more than the right one, false if not. * \par Note: * The operator is defined relatively to the function isLess of Beagle::UShort. */inline bool operator>(const Beagle::UShort& inLeftUShort, const Beagle::UShort& inRightUShort){ Beagle_StackTraceBeginM(); return inRightUShort.isLess(inLeftUShort); Beagle_StackTraceEndM("bool operator>(const UShort& inLeftUShort, const UShort& inRightUShort)");}/*! * \brief Test whether an unsigned short is more than, or equal to another. * \param inLeftUShort Left unsigned short compared. * \param inRightUShort Right unsigned short compared. * \return True if left unsigned short 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::UShort. */inline bool operator>=(const Beagle::UShort& inLeftUShort, const Beagle::UShort& inRightUShort){ Beagle_StackTraceBeginM(); return ( inRightUShort.isLess(inLeftUShort) || inLeftUShort.isEqual(inRightUShort) ); Beagle_StackTraceEndM("bool operator>=(const UShort& inLeftUShort, const UShort& inRightUShort)");}/*! * \brief Test whether an unsigned short is equal to another. * \param inLeftUShort Left unsigned short compared. * \param inRightUShort Right unsigned short compared. * \return True if left unsigned short is equal to the right one, false if not. * \par Note: * The operator is defined relatively to the function isEqual of Beagle::UShort. */inline bool operator==(const Beagle::UShort& inLeftUShort, const Beagle::UShort& inRightUShort){ Beagle_StackTraceBeginM(); return inLeftUShort.isEqual(inRightUShort); Beagle_StackTraceEndM("bool operator==(const UShort& inLeftUShort, const UShort& inRightUShort)");}/*! * \brief Test whether an unsigned short is not equal to another. * \param inLeftUShort Left unsigned short compared. * \param inRightUShort Right unsigned short compared. * \return True if left unsigned short is not equal to the right one, false if it is. * \par Note: * The operator is defined relatively to the function isEqual of Beagle::UShort. */inline bool operator!=(const Beagle::UShort& inLeftUShort, const Beagle::UShort& inRightUShort){ Beagle_StackTraceBeginM(); return ( inLeftUShort.isEqual(inRightUShort) == false); Beagle_StackTraceEndM("bool operator!=(const UShort& inLeftUShort, const UShort& inRightUShort)");}/*! * \brief Compare equality of a UShort with a unsigned short. * \param inLeftUShort Left value to compare. * \param inRightUShort Right value to compare. * \return Result of the comparison. */inlinebool operator==(const Beagle::UShort& inLeftUShort, unsigned short inRightUShort){ Beagle_StackTraceBeginM(); return inLeftUShort.getWrappedValue() == inRightUShort; Beagle_StackTraceEndM("bool operator==(const UShort& inLeftUShort, unsigned short inRightUShort)");}/*! * \brief Compare inequality of a UShort with a unsigned short. * \param inLeftUShort Left value to compare. * \param inRightUShort Right value to compare. * \return Result of the comparison. */inlinebool operator!=(const Beagle::UShort& inLeftUShort, unsigned short inRightUShort){ Beagle_StackTraceBeginM(); return inLeftUShort.getWrappedValue() != inRightUShort; Beagle_StackTraceEndM("bool operator!=(const UShort& inLeftUShort, unsigned short inRightUShort)");}/*! * \brief Test if a UShort is < than a unsigned short. * \param inLeftUShort Left value to compare. * \param inRightUShort Right value to compare. * \return Result of the comparison. */inlinebool operator<(const Beagle::UShort& inLeftUShort, unsigned short inRightUShort){ Beagle_StackTraceBeginM(); return inLeftUShort.getWrappedValue() < inRightUShort; Beagle_StackTraceEndM("bool operator<(const UShort& inLeftUShort, unsigned short inRightUShort)");}/*! * \brief Test if a UShort is <= than a unsigned short. * \param inLeftUShort Left value to compare. * \param inRightUShort Right value to compare. * \return Result of the comparison. */inlinebool operator<=(const Beagle::UShort& inLeftUShort, unsigned short inRightUShort){ Beagle_StackTraceBeginM(); return inLeftUShort.getWrappedValue() <= inRightUShort; Beagle_StackTraceEndM("bool operator<=(const UShort& inLeftUShort, unsigned short inRightUShort)");}/*! * \brief Test if a UShort is > than a unsigned short. * \param inLeftUShort Left value to compare. * \param inRightUShort Right value to compare. * \return Result of the comparison. */inlinebool operator>(const Beagle::UShort& inLeftUShort, unsigned short inRightUShort){ Beagle_StackTraceBeginM(); return inLeftUShort.getWrappedValue() > inRightUShort; Beagle_StackTraceEndM("bool operator>(const UShort& inLeftUShort, unsigned short inRightUShort)");}/*! * \brief Test if a UShort is >= than a unsigned short. * \param inLeftUShort Left value to compare. * \param inRightUShort Right value to compare. * \return Result of the comparison. */inlinebool operator>=(const Beagle::UShort& inLeftUShort, unsigned short inRightUShort){ Beagle_StackTraceBeginM(); return inLeftUShort.getWrappedValue() >= inRightUShort; Beagle_StackTraceEndM("bool operator>=(const UShort& inLeftUShort, unsigned short inRightUShort)");}/*! * \brief Increment a UShort (prefix version). * \param inUShort UShort to increment. * \return UShort incremented. */inlineBeagle::UShort& operator++(Beagle::UShort& inUShort){ Beagle_StackTraceBeginM(); inUShort.getWrappedValue()++; return inUShort; Beagle_StackTraceEndM("UShort& operator++(UShort& inUShort)");}/*! * \brief Increment a UShort (postfix version). * \param inUShort UShort to increment. * \return UShort before being incremented. */inlineBeagle::UShort operator++(Beagle::UShort& inUShort, int){ Beagle_StackTraceBeginM(); Beagle::UShort lUShort = inUShort; inUShort.getWrappedValue()++; return lUShort; Beagle_StackTraceEndM("UShort operator++(UShort& inUShort, int)");}/*! * \brief Add two UShort. * \param inLeftUShort Left value to add.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -