RNBO: RNBO::PlatformInterface Class Reference

Public Member Functions | |
void | resetWarnings () |
virtual void | printMessage (const char *message)=0 |
Print a message to stdout or some kind of log. | |
virtual void | printErrorMessage (const char *message) |
Prints an error message. More... | |
virtual void * | malloc (size_t bytes)=0 |
Allocates uninitialized storage. More... | |
virtual void * | calloc (size_t num, size_t size)=0 |
Allocates memory for an array of objects and initializes all bytes to zero. More... | |
virtual void * | realloc (void *ptr, size_t bytes)=0 |
Reallocates previously-allocated memory. More... | |
virtual void | free (void *ptr)=0 |
Deallocates memory. More... | |
virtual void * | memcpy (void *dest, const void *src, size_t n)=0 |
Copy contents of memory from one location to another. More... | |
virtual void * | memmove (void *dest, const void *src, size_t n)=0 |
Copies memory from one memory location to another. More... | |
virtual void * | memset (void *dest, int value, size_t n)=0 |
Fill a region of memory with a value. More... | |
virtual size_t | strlen (const char *s)=0 |
Get the length of a null-terminated string. More... | |
virtual int | strcmp (const char *s1, const char *s2)=0 |
Compare two null-terminated strings lexicographically. More... | |
virtual char * | strcpy (char *dest, const char *src)=0 |
Copy a null-terminated string to a character array. More... | |
virtual void | toString (char *str, size_t maxlen, number val)=0 |
virtual void | toString (char *str, size_t maxlen, int val)=0 |
virtual void | toString (char *str, size_t maxlen, unsigned int val)=0 |
virtual void | toString (char *str, size_t maxlen, long val)=0 |
virtual void | toString (char *str, size_t maxlen, long long val)=0 |
virtual void | toString (char *str, size_t maxlen, unsigned long val)=0 |
virtual void | toString (char *str, size_t maxlen, unsigned long long val)=0 |
virtual void | toString (char *str, size_t maxlen, void *val)=0 |
virtual void | abort ()=0 |
virtual void | error (RuntimeError e, const char *str)=0 |
Fatal error which should not return. | |
virtual void | assertTrue (bool v, const char *str)=0 |
Fatal error if v is false. | |
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()
|
pure virtual |
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
Implemented in RNBO::PlatformInterfaceStdLib.
◆ free()
|
pure virtual |
Deallocates memory.
- Parameters
-
ptr a pointer to memory to deallocate
Implemented in RNBO::PlatformInterfaceStdLib.
◆ malloc()
|
pure virtual |
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
Implemented in RNBO::PlatformInterfaceStdLib.
◆ memcpy()
|
pure virtual |
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
Implemented in RNBO::PlatformInterfaceStdLib.
◆ memmove()
|
pure virtual |
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
Implemented in RNBO::PlatformInterfaceStdLib.
◆ memset()
|
pure virtual |
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
Implemented in RNBO::PlatformInterfaceStdLib.
◆ printErrorMessage()
|
inlinevirtual |
Prints an error message.
Defaults to printMessage.
◆ realloc()
|
pure virtual |
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)
Implemented in RNBO::PlatformInterfaceStdLib.
◆ strcmp()
|
pure virtual |
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
Implemented in RNBO::PlatformInterfaceStdLib.
◆ strcpy()
|
pure virtual |
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
Implemented in RNBO::PlatformInterfaceStdLib.
◆ strlen()
|
pure virtual |
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
Implemented in RNBO::PlatformInterfaceStdLib.
The documentation for this class was generated from the following file:
- common/RNBO_PlatformInterface.h