Go to the first, previous, next, last section, table of contents.


CNInt -- Integers derived from CNObject

SYNOPSIS

#include <CNCL/Int.h>

TYPE

CN_INT

BASE CLASSES

CNObject

DERIVED CLASSES

None

RELATED CLASSES

CNDouble

DESCRIPTION

This class provides a long int value derived from CNObject. Such it combines the behavior of the builtin type long int with the possibility to use this type with generic containers (like CNDLList) or as parameters to CNEvents and SDLSignals.
Note: CNInt consumes much more memory than an ordinary long int. Therefore it isn't a good idea to create large arrays of CNInts when one doesn't need its special capabilities.
Constructors:

CNInt(long n=0);
CNInt(CNParam *param);
Initializes the Int with the value n (default = 0).


In addition to the member functions required by CNCL, CNInt provides:

operator long()
Conversion of CNInt to ordinary long. This allows the use of CNInt in calculations.
Note: to explicitly convert a CNInt identifier to a double (or else) write double(long(identifier)). Implicit conversion however works well without casting to long first.
long operator ++()
long operator ++(int)
Prefix and postfix version of increment.
long operator --()
long operator --(int)
Prefix and postfix version of decrement.
long operator -()
long operator +()
Unary minus and plus operator.
long operator +=(long n)
long operator -=(long n)
long operator *=(long n)
long operator /=(long n)
long operator %=(long n)
Arithmetic operators where a CNInt is on the left and on the right side of an equation.
long operator ^=(long n)
long operator |=(long n)
long operator &=(long n)
long operator !=(long n)
Logical operators where a CNInt is on the left and on the right side of an equation.
long operator <<=(long n)
long operator >>=(long n)
Left and right shifts of a CNInt. Note: unary * and & operators aren't overloaded.


Go to the first, previous, next, last section, table of contents.