OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

label.H File Reference


Detailed Description

View label.H
License
This file is part of OpenFOAM.

OpenFOAM 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.

OpenFOAM 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 OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
A label is an int if INT_MAX is large enough otherwise a long.
A readLabel function is defined so that label can be constructed from
Istream.

Definition in file label.H.

Go to the source code of this file.


Namespaces

namespace  Foam

Classes

class  pTraits< label >

Defines

#define MAXMIN(retType, type1, type2)

Typedefs

typedef long label

Functions

label readLabel (Istream &is)
label pow (label a, label b)
 Raise one label to the power of another.
label factorial (label n)
 Evaluate n! : n <= 12.
char max (const char s1, const char s2)
char min (const char s1, const char s2)
short max (const short s1, const short s2)
short min (const short s1, const short s2)
int max (const int s1, const int s2)
int min (const int s1, const int s2)
long max (const long s1, const long s2)
long min (const long s1, const long s2)
unsigned char max (const unsigned char s1, const unsigned char s2)
unsigned char min (const unsigned char s1, const unsigned char s2)
unsigned short max (const unsigned short s1, const unsigned short s2)
unsigned short min (const unsigned short s1, const unsigned short s2)
unsigned int max (const unsigned int s1, const unsigned int s2)
unsigned int min (const unsigned int s1, const unsigned int s2)
unsigned long max (const unsigned long s1, const unsigned long s2)
unsigned long min (const unsigned long s1, const unsigned long s2)
long max (const int s1, const long s2)
long min (const int s1, const long s2)
long max (const long s1, const int s2)
long min (const long s1, const int s2)
label mag (const label l)
label sign (const label s)
label pos (const label s)
label neg (const label s)

Variables

static const label labelMax = LONG_MAX
static const label labelMin = LONG_MIN

Define Documentation

#define MAXMIN ( retType,
type1,
type2   ) 

Value:

\
inline retType max(const type1 s1, const type2 s2) \
{                                                  \
    return (s1 > s2)? s1: s2;                      \
}                                                  \
                                                   \
inline retType min(const type1 s1, const type2 s2) \
{                                                  \
    return (s1 < s2)? s1: s2;                      \
}

Definition at line 148 of file label.H.

Copyright © 2000-2007 OpenCFD Ltd