#include <streamconversion_impl_helper.h>
Helper to Append efficiently to WritableArrayInterface<> by caching several append calls and writing them back in blocks Without this caching mechanism calling Append directly can slow down by a factor of 4 or even more! Usage:
FastArrayAppend<UChar> dst(xdst); // xdst is the WritableArrayInterface of type UChar for ( auto ch : src ) { iferr (dst.Append(ch)) return err; } iferr (dst.Finalize()) // tell the FastArrayAppend that we are finished and remaning elements in the cache should be copied as well return err;
公共成员函数 |
|
MAXON_IMPLICIT | ArrayAppendCache ( WritableArrayInterface < Generic > &destination) |
ArrayAppendCache () | |
MAXON_ATTRIBUTE_FORCE_INLINE Result < void > | Append (const T &ch) |
MAXON_ATTRIBUTE_FORCE_INLINE Result < void > | Finalize () |
Int | GetCount () const |
Private Attributes |
|
Int | _tempPos |
T | _tempArray [ DEFAULT_APPENDSIZE ] |
WritableArrayInterface < T > * | _destination |
MAXON_IMPLICIT ArrayAppendCache | ( | WritableArrayInterface < Generic > & | destination | ) |
ArrayAppendCache | ( | ) |
MAXON_ATTRIBUTE_FORCE_INLINE Result <void> Append | ( | const T & | ch | ) |
MAXON_ATTRIBUTE_FORCE_INLINE Result <void> Finalize | ( | ) |
Int GetCount | ( | ) | const |
|
private |
|
private |
|
private |