ADC Home > Reference Library > Reference > Darwin > Kernel Framework Reference
|
OSNumber |
Inherits from: | |
Declared In: |
A container class for numeric values.
Adds an integer value to the internal numeric value of the OSNumber object.
Releases and deallocates resources created by the OSNumber instances.
Initializes an instance of OSNumber.
Initializes an instance of OSNumber.
Tests the equality of an arbitrary OSObject-derived object and an OSNumber object.
Tests the equality of two OSNumber objects.
Returns the number of bits used to represent the value.
Returns the number of bytes used to represent the value.
Archives the receiver.
Replaces the current internal numeric value of the OSNumber object by the value given.
Returns its internal value as a 16-bit value.
Returns its internal value as a 32-bit value.
Returns its internal value as a 64-bit value.
Returns its internal value as an 8-bit value.
Creates and initializes an instance of OSNumber with a given value represented as a simple C string.
Creates and initializes an instance of OSNumber with a given value.
addValue |
Adds an integer value to the internal numeric value of the OSNumber object.
public
virtual void addValue( signed long long value);
value
The value to be added.
free |
Releases and deallocates resources created by the OSNumber instances.
public
virtual void free();
This function should not be called directly, use release() instead.
init(const char *, unsigned int) |
Initializes an instance of OSNumber.
public
virtual bool init( const char *value, unsigned int numberOfBits);
value
A C string representation of a numeric value.
numberOfBits
The number of bits required to represent the value.
Returns true if the instance was successfully initialized, false otherwise.
init(unsigned long long, unsigned int) |
Initializes an instance of OSNumber.
public
virtual bool init( unsigned long long value, unsigned int numberOfBits);
value
An integer value.
numberOfBits
The number of bits required to represent the value.
Returns true if the instance was successfully initialized, false otherwise.
isEqualTo(const OSMetaClassBase *) |
Tests the equality of an arbitrary OSObject-derived object and an OSNumber object.
public
virtual bool isEqualTo( const OSMetaClassBase *obj) const;
obj
The OSObject-derived object to be compared to the receiver.
Returns true if the two objects are equivalent, false otherwise.
isEqualTo(const OSNumber *) |
Tests the equality of two OSNumber objects.
public
virtual bool isEqualTo( const OSNumber *integer) const;
integer
The OSNumber object to be compared against the receiver.
Returns true if the two objects are equivalent, false otherwise.
numberOfBits |
Returns the number of bits used to represent the value.
public
virtual unsigned int numberOfBits() const;
Returns the number of bits required to represent the value.
numberOfBytes |
Returns the number of bytes used to represent the value.
public
virtual unsigned int numberOfBytes() const;
Returns the number of bytes required to represent the value.
serialize |
Archives the receiver.
public
virtual bool serialize( OSSerialize *s) const;
s
The OSSerialize object.
Returns true if serialization was successful, false if not.
setValue |
Replaces the current internal numeric value of the OSNumber object by the value given.
public
virtual void setValue( unsigned long long value);
value
The new value for the OSNumber object.
unsigned16BitValue |
Returns its internal value as a 16-bit value.
public
virtual unsigned short unsigned16BitValue() const;
Returns the internal value as a 16-bit value.
unsigned32BitValue |
Returns its internal value as a 32-bit value.
public
virtual unsigned int unsigned32BitValue() const;
Returns the internal value as a 32-bit value.
unsigned64BitValue |
Returns its internal value as a 64-bit value.
public
virtual unsigned long long unsigned64BitValue() const;
Returns the internal value as a 64-bit value.
unsigned8BitValue |
Returns its internal value as an 8-bit value.
public
virtual unsigned char unsigned8BitValue() const;
Returns the internal value as an 8-bit value.
withNumber(const char *, unsigned int) |
Creates and initializes an instance of OSNumber with a given value represented as a simple C string.
public
static OSNumber *withNumber( const char *value, unsigned int numberOfBits);
value
A C string representing a numeric value.
numberOfBits
The number of bits required to represent the value.
Returns an instance of OSNumber or 0 if an error occurred.
This function does not work on IOKit versions prior to 8.0 (prior to Mac OS X v10.4). For IOKit versions 8.0 and later, it works but is limited to parsing unsigned 32-bit quantities The format of the C string may be decimal, hexadecimal ("0x" prefix), binary ("0b" prefix), or octal ("0" prefix).
withNumber(unsigned long long, unsigned int) |
Creates and initializes an instance of OSNumber with a given value.
public
static OSNumber *withNumber( unsigned long long value, unsigned int numberOfBits);
value
The numeric integer value.
numberOfBits
The number of bits required to represent the value.
Returns an instance of OSNumber or 0 if an error occurred.
reserved |
protected
ExpansionData *reserved;
Reserved for future use. (Internal use only)
|
Last Updated: 2008-12-19