objc

Data Structures | Typedefs | Enumerations | Functions | Variables
Foundation Framework

Foundational classes and types, including strings, numbers, dates, data and collections. More...

Collaboration diagram for Foundation Framework:

Data Structures

class  NXArray
 The NXArray classNXArray represents an array that can store ordered objects. More...
 
class  NXAutoreleasePool
 A class for managing autorelease pools. More...
 
class  NXData
 The NXData classNXData represents a structure for storing binary data. More...
 
class  NXDate
 A class for representing and manipulating dates. More...
 
class  NXMap
 The NXMap class. More...
 
class  NXNull
 The NXNull classNXNull represents a null value that can be inserted into collections. More...
 
class  NXNumber
 The base class for NXNumber instances. More...
 
class  NXObject
 The base class for objects in the Foundation framework. More...
 
struct  NXPoint
 A structure representing a point in 2D space. More...
 
class  NXString
 A class for managing and manipulating string objects. More...
 
class  NXThread
 A class for managing and interacting with threads. More...
 
class  NXZone
 A class for managing memory zones. More...
 
protocol  <RetainProtocol>
 Protocol for retaining and releasing objects. More...
 
protocol  <CollectionProtocol>
 A protocol that defines collection methods for an Object. More...
 
protocol  <JSONProtocol>
 A protocol that defines JSON methods for an Object. More...
 
category  Object(Description)
 A category that adds a description method to the Object class. More...
 

Typedefs

typedef struct NXPoint NXPoint
 A structure representing a point in 2D space.
 
typedef int64_t NXTimeInterval
 Time interval type representing nanoseconds as a 64-bit signed integer. More...
 

Enumerations

enum  NXEndian { NXUnknownEndian = 0, NXLittleEndian = 1, NXBigEndian = 2 }
 Enumeration representing different byte order (endianness) types. More...
 
enum  NXComparisonResult { NXComparisonAscending = -1, NXComparisonSame = 0, NXComparisonDescending = 1 }
 Enumeration representing the result of a comparison operation. More...
 
enum  NXHashAlgorithm { NXHashAlgorithmMD5 = sys_hash_md5, NXHashAlgorithmSHA256 = sys_hash_sha256 }
 Hash algorithms supported by NXData.
 

Functions

uint8_t NXArchBits (void)
 Get the current architecture bits (32 or 64). More...
 
const char * NXArchOS (void)
 Get the current operating system name. More...
 
const char * NXArchProcessor (void)
 Get the current processor/CPU type. More...
 
NXEndian NXArchEndian (void)
 Get the current architecture endianness. More...
 
uint8_t NXArchNumCores (void)
 Get the number of CPU cores available on the current system. More...
 
int32_t NXRandInt32 ()
 Generate a random signed 32-bit integer. More...
 
uint32_t NXRandUnsignedInt32 ()
 Generate a random unsigned 32-bit integer. More...
 
int32_t NXTimeIntervalMilliseconds (NXTimeInterval interval)
 Converts a time interval to milliseconds. More...
 
NXStringNXTimeIntervalDescription (NXTimeInterval interval, NXTimeInterval truncate)
 Converts a time interval to a string representation. More...
 
NXTimeInterval NXTimeIntervalTimestamp (void)
 Get the time interval since the application started. More...
 

Variables

const unsigned int NXNotFound
 Constant representing "not found".
 
const NXTimeInterval Nanosecond
 Base unit: 1 nanosecond.
 
const NXTimeInterval Millisecond
 1 millisecond = 1,000,000 nanoseconds
 
const NXTimeInterval Second
 1 second = 1000 milliseconds
 
const NXTimeInterval Minute
 1 minute = 60 seconds
 
const NXTimeInterval Hour
 1 hour = 60 minutes
 
const NXTimeInterval Day
 1 day = 24 hours
 

Detailed Description

Foundational classes and types, including strings, numbers, dates, data and collections.

Typedef Documentation

◆ NXTimeInterval

typedef int64_t NXTimeInterval

Time interval type representing nanoseconds as a 64-bit signed integer.

NXTimeInterval stores time durations in nanoseconds using a signed 64-bit integer. This provides sufficient precision for most timing operations while maintaining compatibility with system APIs.

Range and Limitations:
  • Minimum value: -9,223,372,036,854,775,808 nanoseconds (~-292 billion years)
  • Maximum value: +9,223,372,036,854,775,807 nanoseconds (~+292 billion years)
  • Resolution: 1 nanosecond
Warning
Values exceeding the 64-bit range will overflow. Always validate duration calculations in applications requiring extended time ranges.

Definition at line 31 of file NXTimeInterval.h.

Enumeration Type Documentation

◆ NXComparisonResult

Enumeration representing the result of a comparison operation.

NXComparisonResult is used throughout the Foundation framework to represent the outcome of comparison operations between objects. The values are designed to be compatible with standard C library comparison functions and can be used directly in sorting algorithms.

Enumerator
NXComparisonAscending 

First operand is ordered before the second.

NXComparisonSame 

Operands are equivalent for ordering.

NXComparisonDescending 

First operand is ordered after the second.

Definition at line 20 of file NXComparisonResult.h.

20  {
22  NXComparisonSame = 0,
First operand is ordered after the second.
NXComparisonResult
Enumeration representing the result of a comparison operation.
First operand is ordered before the second.
Operands are equivalent for ordering.

◆ NXEndian

enum NXEndian

Enumeration representing different byte order (endianness) types.

Enumerator
NXUnknownEndian 

Unknown endianness.

NXLittleEndian 

Least significant byte first.

NXBigEndian 

Most significant byte first.

Definition at line 19 of file NXArch.h.

19  {
20  NXUnknownEndian = 0,
21  NXLittleEndian = 1,
22  NXBigEndian = 2
23 } NXEndian;
Least significant byte first.
Definition: NXArch.h:21
Unknown endianness.
Definition: NXArch.h:20
Most significant byte first.
Definition: NXArch.h:22
NXEndian
Enumeration representing different byte order (endianness) types.
Definition: NXArch.h:19

Function Documentation

◆ NXArchBits()

uint8_t NXArchBits ( void  )

Get the current architecture bits (32 or 64).

Returns
The architecture bits, either 32 or 64. Returns 0 if the architecture is unknown.

◆ NXArchEndian()

NXEndian NXArchEndian ( void  )

Get the current architecture endianness.

Returns
The architecture endianness, either NXLittleEndian or NXBigEndian. Returns 0 if the architecture is unknown.

◆ NXArchNumCores()

uint8_t NXArchNumCores ( void  )

Get the number of CPU cores available on the current system.

Returns
The number of CPU cores available. Returns at least 1, even if the actual core count cannot be determined. Returns a maximum of 255 cores.

◆ NXArchOS()

const char* NXArchOS ( void  )

Get the current operating system name.

Returns
A string containing the operating system name (e.g., "darwin", "linux", "pico").

◆ NXArchProcessor()

const char* NXArchProcessor ( void  )

Get the current processor/CPU type.

Returns
A string containing the processor name (e.g., "arm64", "x86-64", "aarch64", "cortex-m0plus").

◆ NXRandInt32()

int32_t NXRandInt32 ( )

Generate a random signed 32-bit integer.

This function generates a random signed integer value using the system's random number generator.

Returns
A random signed integer value.
Note
This function is not thread-safe.

◆ NXRandUnsignedInt32()

uint32_t NXRandUnsignedInt32 ( )

Generate a random unsigned 32-bit integer.

This function generates a random unsigned integer value.

Returns
A random unsigned integer value.
Note
This function is not thread-safe.

◆ NXTimeIntervalDescription()

NXString* NXTimeIntervalDescription ( NXTimeInterval  interval,
NXTimeInterval  truncate 
)

Converts a time interval to a string representation.

This function converts a NXTimeInterval value to its string representation, including the appropriate time unit.

Parameters
intervalThe time interval to convert.
truncateTruncate the interval based on the precision required.
Returns
The string representation of the given time interval.

◆ NXTimeIntervalMilliseconds()

int32_t NXTimeIntervalMilliseconds ( NXTimeInterval  interval)

Converts a time interval to milliseconds.

This function converts a NXTimeInterval value to its milliseconds representation, discarding any fractional nanoseconds.

Parameters
intervalThe time interval to convert.
Returns
The milliseconds equivalent of the given time interval.

◆ NXTimeIntervalTimestamp()

NXTimeInterval NXTimeIntervalTimestamp ( void  )

Get the time interval since the application started.

Returns
The time interval since the application started.