00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00023
#ifndef __vtkLargeInteger_h
00024
#define __vtkLargeInteger_h
00025
00026
#include "vtkObject.h"
00027
00028 class VTK_COMMON_EXPORT vtkLargeInteger
00029 {
00030
public:
00031 vtkLargeInteger(
void);
00032 vtkLargeInteger(
long n);
00033 vtkLargeInteger(
unsigned long n);
00034 vtkLargeInteger(
int n);
00035 vtkLargeInteger(
unsigned int n);
00036 vtkLargeInteger(
const vtkLargeInteger& n);
00037 ~vtkLargeInteger(
void);
00038
00039
char CastToChar(
void)
const;
00040
short CastToShort(
void)
const;
00041
int CastToInt(
void)
const;
00042
long CastToLong(
void)
const;
00043
unsigned long CastToUnsignedLong(
void)
const;
00044
00045
int IsEven(
void)
const;
00046
int IsOdd(
void)
const;
00047
int GetLength(
void)
const;
00048
int GetBit(
unsigned int p)
const;
00049
int IsZero()
const;
00050
int GetSign(
void)
const;
00051
00052
void Truncate(
unsigned int n);
00053
void Complement(
void);
00054
00055
int operator==(
const vtkLargeInteger& n)
const;
00056
int operator!=(
const vtkLargeInteger& n)
const;
00057
int operator<(
const vtkLargeInteger& n)
const;
00058
int operator<=(
const vtkLargeInteger& n)
const;
00059
int operator>(
const vtkLargeInteger& n)
const;
00060
int operator>=(
const vtkLargeInteger& n)
const;
00061
00062 vtkLargeInteger& operator=(
const vtkLargeInteger& n);
00063 vtkLargeInteger& operator+=(
const vtkLargeInteger& n);
00064 vtkLargeInteger& operator-=(
const vtkLargeInteger& n);
00065 vtkLargeInteger& operator<<=(
int n);
00066 vtkLargeInteger& operator>>=(
int n);
00067 vtkLargeInteger& operator++(
void);
00068 vtkLargeInteger& operator--(
void);
00069 vtkLargeInteger operator++(
int);
00070 vtkLargeInteger operator--(
int);
00071 vtkLargeInteger& operator*=(
const vtkLargeInteger& n);
00072 vtkLargeInteger& operator/=(
const vtkLargeInteger& n);
00073 vtkLargeInteger& operator%=(
const vtkLargeInteger& n);
00074
00075 vtkLargeInteger& operator&=(
const vtkLargeInteger& n);
00076 vtkLargeInteger& operator|=(
const vtkLargeInteger& n);
00077 vtkLargeInteger& operator^=(
const vtkLargeInteger& n);
00078
00079 vtkLargeInteger operator+(
const vtkLargeInteger& n)
const;
00080 vtkLargeInteger operator-(
const vtkLargeInteger& n)
const;
00081 vtkLargeInteger operator*(
const vtkLargeInteger& n)
const;
00082 vtkLargeInteger operator/(
const vtkLargeInteger& n)
const;
00083 vtkLargeInteger operator%(
const vtkLargeInteger& n)
const;
00084
00085 vtkLargeInteger operator&(
const vtkLargeInteger& n)
const;
00086 vtkLargeInteger operator|(
const vtkLargeInteger& n)
const;
00087 vtkLargeInteger operator^(
const vtkLargeInteger& n)
const;
00088 vtkLargeInteger
operator<<(
int n)
const;
00089 vtkLargeInteger
operator>>(
int n)
const;
00090
00091
friend ostream&
operator<<(ostream& s,
const vtkLargeInteger& n);
00092
friend istream&
operator>>(istream& s, vtkLargeInteger& n);
00093
00094
private:
00095
char* Number;
00096
int Negative;
00097
unsigned int Sig;
00098
unsigned int Max;
00099
00100
00101
int IsSmaller(
const vtkLargeInteger& n)
const;
00102
int IsGreater(
const vtkLargeInteger& n)
const;
00103
void Expand(
unsigned int n);
00104
void Contract();
00105
void Plus(
const vtkLargeInteger& n);
00106
void Minus(
const vtkLargeInteger& n);
00107 };
00108
00109
#endif
00110
00111