Base Framework
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
UnsignedLongInteger Class Reference

An unsigned long integer. More...

#include <base/UnsignedLongInteger.h>

Inherits Object.

Public Types

enum  { FLAG_ALLOW_SPACES = 1 << 0 }
 
enum  BaseOptions {
  BIN = 1, DEC = 2, OCT = 4, HEX = 8,
  PREFIX = 16, ANY =BIN|DEC|OCT|HEX|PREFIX, FLAG_DEFAULT = FLAG_ALLOW_SPACES | ANY
}
 

Public Member Functions

 UnsignedLongInteger () noexcept
 
 UnsignedLongInteger (unsigned long long value) noexcept
 
 UnsignedLongInteger (const UnsignedLongInteger &copy) noexcept
 
UnsignedLongIntegeroperator= (const UnsignedLongInteger &assign) noexcept
 
UnsignedLongIntegeroperator= (unsigned long long value) noexcept
 
unsigned long long getValue () const noexcept
 
void setValue (unsigned long long value) noexcept
 
 operator unsigned long long () const noexcept
 

Static Public Member Functions

static unsigned long long parse (const char *src, const char *end, unsigned int flags=FLAG_DEFAULT)
 
static unsigned long long parse (const String &string, unsigned int flags=FLAG_DEFAULT)
 

Static Public Attributes

static const bool SIGNED = false
 
static const unsigned long long MINIMUM = PrimitiveTraits<unsigned long long>::MINIMUM
 
static const unsigned long long MAXIMUM = PrimitiveTraits<unsigned long long>::MAXIMUM
 

Protected Attributes

unsigned long long value = 0
 

Detailed Description

An unsigned long integer.

Unsigned long integer (64 bits or more). This class maps onto the unsigned long long primitive. There is no wrapper class available for the long primitive.

Version
1.0

Member Enumeration Documentation

◆ BaseOptions

Enumerator
BIN 

Specifies binary integer base (2).

DEC 

Specifies decimal integer base (10).

OCT 

Specifies octal integer base (8).

HEX 

Specifies hexadecimal integer base (16).

PREFIX 

Specifies that prefix is required.

ANY 

Specifies any supported base (integer base is derived from prefix).

Constructor & Destructor Documentation

◆ UnsignedLongInteger() [1/3]

UnsignedLongInteger::UnsignedLongInteger ( )
inlinenoexcept

Initializes the integer as zero.

◆ UnsignedLongInteger() [2/3]

UnsignedLongInteger::UnsignedLongInteger ( unsigned long long  value)
inlinenoexcept

Initializes the integer with the specified value. Implicit initialization allowed.

Parameters
valueThe desired value.

◆ UnsignedLongInteger() [3/3]

UnsignedLongInteger::UnsignedLongInteger ( const UnsignedLongInteger copy)
inlinenoexcept

Copy constructor. Initializes a new Integer from other Integer object.

Member Function Documentation

◆ getValue()

unsigned long long UnsignedLongInteger::getValue ( ) const
inlinenoexcept

Gets the value of the integer.

◆ operator unsigned long long()

UnsignedLongInteger::operator unsigned long long ( ) const
inlinenoexcept

Casts integer to native type.

◆ operator=() [1/2]

UnsignedLongInteger& UnsignedLongInteger::operator= ( const UnsignedLongInteger assign)
inlinenoexcept

Assignment of integer to this integer.

◆ operator=() [2/2]

UnsignedLongInteger& UnsignedLongInteger::operator= ( unsigned long long  value)
inlinenoexcept

Assignment of native type to this integer.

◆ parse() [1/2]

static unsigned long long UnsignedLongInteger::parse ( const char *  src,
const char *  end,
unsigned int  flags = FLAG_DEFAULT 
)
static

Returns the value of the integer string representation.

Parameters
srcThe string representation.
endThe string representation.
acceptSpecifies the integer bases to accept. Default is FLAG_DEFAULT.
Examples
testsuite/IEEE1394.cpp.

◆ parse() [2/2]

static unsigned long long UnsignedLongInteger::parse ( const String string,
unsigned int  flags = FLAG_DEFAULT 
)
inlinestatic

Returns the value of the integer string representation.

Parameters
stringThe string.
acceptSpecifies the integer bases to accept. Default is FLAG_DEFAULT.

◆ setValue()

void UnsignedLongInteger::setValue ( unsigned long long  value)
inlinenoexcept

Sets the value of the integer.

Parameters
valueThe desired value.

Member Data Documentation

◆ MAXIMUM

const unsigned long long UnsignedLongInteger::MAXIMUM = PrimitiveTraits<unsigned long long>::MAXIMUM
static

Specifies the maximum value.

◆ MINIMUM

const unsigned long long UnsignedLongInteger::MINIMUM = PrimitiveTraits<unsigned long long>::MINIMUM
static

Specifies the minimum value.

◆ SIGNED

const bool UnsignedLongInteger::SIGNED = false
static

True if the integer type is signed.

◆ value

unsigned long long UnsignedLongInteger::value = 0
protected

The value.