RNBO: RNBO::PlatformInterfaceStdLib Class Reference

Public Member Functions | |
void | printMessage (const char *message) override |
Print a message to stdout or some kind of log. | |
void * | malloc (size_t bytes) override |
Allocates uninitialized storage. More... | |
void * | calloc (size_t num, size_t size) override |
Allocates memory for an array of objects and initializes all bytes to zero. More... | |
void * | realloc (void *ptr, size_t bytes) override |
Reallocates previously-allocated memory. More... | |
void | free (void *ptr) override |
Deallocates memory. More... | |
void * | memcpy (void *dest, const void *src, size_t n) override |
Copy contents of memory from one location to another. More... | |
void * | memmove (void *dest, const void *src, size_t n) override |
Copies memory from one memory location to another. More... | |
void * | memset (void *dest, int value, size_t n) override |
Fill a region of memory with a value. More... | |
size_t | strlen (const char *s) override |
Get the length of a null-terminated string. More... | |
int | strcmp (const char *s1, const char *s2) override |
Compare two null-terminated strings lexicographically. More... | |
char * | strcpy (char *dest, const char *src) override |
Copy a null-terminated string to a character array. More... | |
void | toString (char *str, size_t maxlen, number val) override |
void | toString (char *str, size_t maxlen, int val) override |
void | toString (char *str, size_t maxlen, unsigned int val) override |
void | toString (char *str, size_t maxlen, long val) override |
void | toString (char *str, size_t maxlen, long long val) override |
void | toString (char *str, size_t maxlen, unsigned long val) override |
void | toString (char *str, size_t maxlen, unsigned long long val) override |
void | toString (char *str, size_t maxlen, void *val) override |
void | abort () override |
void | error (RuntimeError e, const char *msg) override |
Fatal error which should not return. | |
void | assertTrue (bool v, const char *msg) override |
Fatal error if v is false. | |
![]() | |
void | resetWarnings () |
virtual void | printErrorMessage (const char *message) |
Prints an error message. More... | |
template<typename T > | |
T | errorOrDefault (RuntimeError e, const char *str, T def) |
template<typename T > | |
T | assertTrueOrDefault (bool v, const char *str, T def) |
Member Function Documentation
◆ calloc()
|
inlineoverridevirtual |
Allocates memory for an array of objects and initializes all bytes to zero.
- Parameters
-
num size
- Returns
- a pointer to the first byte in the allocated memory block if allocation succeeds
Implements RNBO::PlatformInterface.
◆ free()
|
inlineoverridevirtual |
Deallocates memory.
- Parameters
-
ptr a pointer to memory to deallocate
Implements RNBO::PlatformInterface.
◆ malloc()
|
inlineoverridevirtual |
Allocates uninitialized storage.
- Parameters
-
bytes the number of bytes of memory to allocate
- Returns
- a pointer to the first byte in the allocated memory block if allocation succeeds
Implements RNBO::PlatformInterface.
◆ memcpy()
|
inlineoverridevirtual |
Copy contents of memory from one location to another.
Both memory objects are interpreted as arrays of unsigned char
.
- Parameters
-
dest a pointer to the object to copy to src a pointer to the object to copy from n number of bytes to copy
- Returns
dest
Implements RNBO::PlatformInterface.
◆ memmove()
|
inlineoverridevirtual |
Copies memory from one memory location to another.
Both memory objects are interpreted as arrays of unsigned char
. As opposed to memcpy, memmove can have overlapping memory regions.
- Parameters
-
dest a pointer to the object to copy to src a pointer to the object to copy from n number of bytes to copy
- Returns
- copy of
dest
Implements RNBO::PlatformInterface.
◆ memset()
|
inlineoverridevirtual |
Fill a region of memory with a value.
- Parameters
-
dest a pointer to the object to fill value the fill value n number of bytes to fill
- Returns
- copy of
dest
Implements RNBO::PlatformInterface.
◆ realloc()
|
inlineoverridevirtual |
Reallocates previously-allocated memory.
- Parameters
-
ptr a pointer to previously-allocated memory bytes the new allocation size
- Returns
- on success, a pointer to the beginning of the newly allocated memory (and the original pointer is invalidated); on failure, a null pointer is returned (and the original pointer remains valid)
Implements RNBO::PlatformInterface.
◆ strcmp()
|
inlineoverridevirtual |
Compare two null-terminated strings lexicographically.
- Parameters
-
s1 a pointer to a null-terminated string s2 a pointer to a null-terminated string to compare with s1
- Returns
- negative value if s1 is before s2 in lexicographic order, zero if s1 and s2 are equal, and positive value if s1 is after s2 in lexicographic order
Implements RNBO::PlatformInterface.
◆ strcpy()
|
inlineoverridevirtual |
Copy a null-terminated string to a character array.
- Parameters
-
dest a pointer to the character array to write to src a pointer to the null-terminated byte string to copy from
- Returns
- copy of
dest
Implements RNBO::PlatformInterface.
◆ strlen()
|
inlineoverridevirtual |
Get the length of a null-terminated string.
- Parameters
-
s a pointer to the null-terminated string to examine
- Returns
- length of the null-terminated string
Implements RNBO::PlatformInterface.
The documentation for this class was generated from the following file:
- src/platforms/stdlib/RNBO_PlatformInterfaceStdLib.h