|
Yate
|
A fixed ref counted storage. More...
#include <yatemath.h>
Public Member Functions | |
| RefStorage (const void *value, unsigned int len) | |
| unsigned int | length () const |
| void * | data (unsigned int offs, unsigned int len) const |
| bool | set (const void *buf, unsigned int len, unsigned int offs=0) |
Public Member Functions inherited from RefObject | |
| RefObject () | |
| virtual | ~RefObject () |
| virtual void * | getObject (const String &name) const |
| virtual bool | alive () const |
| bool | ref () |
| bool | deref () |
| int | refcount () const |
| virtual void | destruct () |
Public Member Functions inherited from GenObject | |
| GenObject () | |
| virtual | ~GenObject () |
| virtual const String & | toString () const |
| virtual const String & | traceId () const |
| NamedCounter * | getObjCounter () const |
| NamedCounter * | setObjCounter (NamedCounter *counter) |
Static Public Member Functions | |
| static void | fill (void *dest, unsigned int len, int val=0) |
| static bool | copy (void *dest, const void *src, unsigned int len) |
| static bool | equals (const void *buf1, const void *buf2, unsigned int len) |
| static String & | dumpSplit (String &buf, const String &str, unsigned int lineLen, unsigned int offset=0, const char *linePrefix=0, const char *suffix="\r\n") |
Static Public Member Functions inherited from RefObject | |
| static bool | alive (const RefObject *obj) |
| static bool | efficientIncDec () |
Static Public Member Functions inherited from GenObject | |
| static void * | getObject (const String &name, const GenObject *obj) |
| static bool | getObjCounting () |
| static void | setObjCounting (bool enable) |
| static NamedCounter * | getObjCounter (const String &name, bool create=true) |
| static ObjList & | getObjCounters () |
Additional Inherited Members | |
Protected Member Functions inherited from RefObject | |
| virtual void | zeroRefs () |
| bool | resurrect () |
| virtual void | destroyed () |
A fixed ref counted storage.
This class holds a ref counted storage
|
inline |
Constructor
| value | Data to assign, may be NULL to fill with zeros |
| len | Length of data, may be zero (then value is ignored) |
|
inlinestatic |
Copy data
| dest | Destination buffer |
| src | Source buffer |
| len | The number of bytes to copy |
Referenced by SliceVector< Obj >::copy(), and RefStorage::set().
|
inline |
Get a pointer to a byte range inside the stored data
| offs | Byte offset inside the stored data |
| len | Number of bytes that must be valid starting at offset (must not be 0) |
References DataBlock::data().
Referenced by RefStorage::set().
|
static |
Split a string and append lines to another one
| buf | Destination string |
| str | Input string |
| lineLen | Line length, characters to copy |
| offset | Offset in first line (if incomplete). No data will be added on first line if offset is greater then line length |
| linePrefix | Prefix for new lines. Set it to empty string or 0 to use the suffix |
| suffix | End of line for the last line |
Referenced by SliceVector< Obj >::dumpHex().
|
inlinestatic |
Compare data
| buf1 | First buffer |
| buf2 | Second buffer |
| len | The number of bytes to compare |
Referenced by SliceVector< Obj >::equals().
|
inlinestatic |
Fill a buffer
| dest | Destination buffer |
| len | The number of bytes to fill |
| val | Value to fill with |
Referenced by SliceVector< Obj >::bzero(), and SliceVector< Obj >::bzero().
|
inline |
Get the length of the stored data
References DataBlock::length().
|
inline |
Copy data to this storage
| buf | Buffer to copy |
| len | The number of bytes to copy |
| offs | The start index in this storage |
References RefStorage::copy(), and RefStorage::data().
Referenced by SliceVector< Obj >::SliceVector(), and SliceVector< Obj >::SliceVector().