/usr/include/player-3.0/libplayerc++/utility.h is in libplayerc++3.0-dev 3.0.2+dfsg-3ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 | /*
* Player - One Hell of a Robot Server
* Copyright (C) 2000-2003
* Brian Gerkey, Kasper Stoy, Richard Vaughan, & Andrew Howard
*
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
*/
/********************************************************************
*
* 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
*
********************************************************************/
/***************************************************************************
* Desc: Player v2.0 C++ client
* Authors: Brad Kratochvil, Toby Collett
*
* Date: 23 Sep 2005
# CVS: $Id: utility.h 7342 2009-02-18 03:43:36Z gbiggs $
**************************************************************************/
#ifndef PLAYERCC_UTILITY_H
#define PLAYERCC_UTILITY_H
namespace PlayerCc
{
/** @ingroup player_clientlib_cplusplus
@addtogroup player_clientlib_utility Constants and utility functions
@brief Helper functions when using the library.
@{
*/
/// The default port number for PlayerClient
const int PLAYER_PORTNUM = 6665;
/// The default hostname for PlayerClient
const std::string PLAYER_HOSTNAME = "localhost";
// Since they are inline, these functions are as efficient as DEFINES,
// but now they have the benefit of type checking!
/// Convert radians to degrees
inline double rtod(double r)
{
return r * 180.0 / M_PI;
}
/// Convert degrees to radians
inline double dtor(double r)
{
return r * M_PI / 180.0;
}
/// Normalize angle to domain -pi, pi
inline double normalize(double z)
{
return atan2(sin(z), cos(z));
}
/// Return the minimum of a, b
#if defined (min)
#undef min
#endif
template<typename T>
inline T min(T a, T b)
{
if (a < b)
return a;
else
return b;
}
/// Return the maximum of a, b
#if defined (max)
#undef max
#endif
template<typename T>
inline T max(T a, T b)
{
if (a > b)
return a;
else
return b;
}
/// Limit a value to the range of min, max
template<typename T>
inline T limit(T a, T min, T max)
{
if (a < min)
return min;
else if (a > max)
return max;
else
return a;
}
/** }@ (utility) */
} // namespace
#endif
|