Flutter Engine
The Flutter Engine
Classes | Static Public Member Functions | List of all members
dart::Utils Class Reference

#include <utils.h>

Classes

class  BitsIterator
 
class  BitsRange
 

Static Public Member Functions

template<typename T >
static T Minimum (T x, T y)
 
template<typename T >
static constexpr T Maximum (T x, T y)
 
template<typename T >
static T Abs (T x)
 
template<typename T >
static T AbsWithSaturation (T x)
 
template<typename T >
static constexpr bool IsPowerOfTwo (T x)
 
template<typename T >
static constexpr int ShiftForPowerOfTwo (T x)
 
template<typename T >
static constexpr bool IsAligned (T x, uintptr_t alignment, uintptr_t offset=0)
 
template<typename T >
static constexpr bool IsAligned (T *x, uintptr_t alignment, uintptr_t offset=0)
 
template<typename T >
static constexpr T RoundDown (T x, intptr_t alignment)
 
template<typename T >
static TRoundDown (T *x, intptr_t alignment)
 
template<typename T >
static constexpr T RoundUp (T x, uintptr_t alignment, uintptr_t offset=0)
 
template<typename T >
static TRoundUp (T *x, uintptr_t alignment, uintptr_t offset=0)
 
static constexpr uintptr_t RoundUpToPowerOfTwo (uintptr_t x)
 
static constexpr int CountOneBits64 (uint64_t x)
 
static constexpr int CountOneBits32 (uint32_t x)
 
static constexpr int CountOneBitsWord (uword x)
 
static constexpr size_t HighestBit (int64_t v)
 
static constexpr size_t BitLength (int64_t value)
 
static int CountLeadingZeros32 (uint32_t x)
 
static int CountLeadingZeros64 (uint64_t x)
 
static int CountLeadingZerosWord (uword x)
 
static int CountTrailingZeros32 (uint32_t x)
 
static int CountTrailingZeros64 (uint64_t x)
 
static int CountTrailingZerosWord (uword x)
 
static uint64_t ReverseBits64 (uint64_t x)
 
static uint32_t ReverseBits32 (uint32_t x)
 
static uword ReverseBitsWord (uword x)
 
static void CalculateMagicAndShiftForDivRem (int64_t divisor, int64_t *magic, int64_t *shift)
 
static uint32_t StringHash (const void *data, int length)
 
static uint32_t WordHash (intptr_t key)
 
template<typename T >
static bool IsInt (intptr_t N, T value)
 
template<typename T >
static bool IsUint (intptr_t N, T value)
 
template<typename T >
static bool MagnitudeIsUint (intptr_t N, T value)
 
static int32_t Low16Bits (int32_t value)
 
static int32_t High16Bits (int32_t value)
 
static int32_t Low32Bits (int64_t value)
 
static int32_t High32Bits (int64_t value)
 
static int64_t LowHighTo64Bits (uint32_t low, int32_t high)
 
static constexpr bool IsAlphaNumeric (uint32_t c)
 
static constexpr bool IsDecimalDigit (uint32_t c)
 
static bool IsHexDigit (char c)
 
static int HexDigitToInt (char c)
 
static char IntToHexDigit (int i)
 
static bool RangeCheck (intptr_t offset, intptr_t count, intptr_t length)
 
static bool WillAddOverflow (int64_t a, int64_t b)
 
static bool WillSubOverflow (int64_t a, int64_t b)
 
template<typename T = int64_t>
static T AddWithWrapAround (T a, T b)
 
template<typename T = int64_t>
static T SubWithWrapAround (T a, T b)
 
template<typename T = int64_t>
static T MulWithWrapAround (T a, T b)
 
template<typename T = int64_t>
static T NegWithWrapAround (T a)
 
static int64_t ShiftLeftWithTruncation (int64_t a, int64_t b)
 
template<typename T >
static T RotateLeft (T value, uint8_t rotate)
 
template<typename T >
static T RotateRight (T value, uint8_t rotate)
 
static float DivideAllowZero (float a, float b)
 
static double DivideAllowZero (double a, double b)
 
static uint16_t HostToBigEndian16 (uint16_t host_value)
 
static uint32_t HostToBigEndian32 (uint32_t host_value)
 
static uint64_t HostToBigEndian64 (uint64_t host_value)
 
static uint16_t HostToLittleEndian16 (uint16_t host_value)
 
static uint32_t HostToLittleEndian32 (uint32_t host_value)
 
static uint64_t HostToLittleEndian64 (uint64_t host_value)
 
static uint32_t BigEndianToHost32 (uint32_t be_value)
 
static uint64_t LittleEndianToHost64 (uint64_t le_value)
 
static bool DoublesBitEqual (const double a, const double b)
 
template<typename T >
static T SafeDoubleToInt (double v)
 
static bool IsJavaScriptInt (int64_t value)
 
template<typename T = uword>
static constexpr T NBitMask (size_t n)
 
template<typename T = uword>
static constexpr T Bit (size_t n)
 
template<typename T >
static constexpr bool TestBit (T mask, size_t position)
 
static char * StrError (int err, char *buffer, size_t bufsize)
 
static char * StrNDup (const char *s, intptr_t n)
 
static char * StrDup (const char *s)
 
static intptr_t StrNLen (const char *s, intptr_t n)
 
static bool StrStartsWith (const char *s, const char *prefix)
 
static int Close (int fildes)
 
static size_t Read (int filedes, void *buf, size_t nbyte)
 
static int Unlink (const char *path)
 
static int SNPrint (char *str, size_t size, const char *format,...) PRINTF_ATTRIBUTE(3
 
static int static int VSNPrint (char *str, size_t size, const char *format, va_list args)
 
static char * SCreate (const char *format,...) PRINTF_ATTRIBUTE(1
 
static char static char * VSCreate (const char *format, va_list args)
 
static void * LoadDynamicLibrary (const char *library_path, char **error=nullptr)
 
static void * ResolveSymbolInDynamicLibrary (void *library_handle, const char *symbol, char **error=nullptr)
 
static void UnloadDynamicLibrary (void *library_handle, char **error=nullptr)
 

Detailed Description

Definition at line 33 of file utils.h.

Member Function Documentation

◆ Abs()

template<typename T >
static T dart::Utils::Abs ( T  x)
inlinestatic

Definition at line 49 of file utils.h.

49 {
50 // Note: as a general rule, it is not OK to use STL in Dart VM.
51 // However, std::numeric_limits<T>::min() and max() are harmless
52 // and worthwhile exception from this rule.
54 if (x < 0) return -x;
55 return x;
56 }
#define ASSERT(E)
static float min(float r, float g, float b)
Definition: hsl.cpp:48
double x

◆ AbsWithSaturation()

template<typename T >
static T dart::Utils::AbsWithSaturation ( T  x)
inlinestatic

Definition at line 62 of file utils.h.

62 {
63 if (x < 0) {
64 // Note: as a general rule, it is not OK to use STL in Dart VM.
65 // However, std::numeric_limits<T>::min() and max() are harmless
66 // and worthwhile exception from this rule.
69 }
70 return -x;
71 }
72 return x;
73 }
static float max(float r, float g, float b)
Definition: hsl.cpp:49

◆ AddWithWrapAround()

template<typename T = int64_t>
static T dart::Utils::AddWithWrapAround ( T  a,
T  b 
)
inlinestatic

Definition at line 431 of file utils.h.

431 {
432 // Avoid undefined behavior by doing arithmetic in the unsigned type.
433 using Unsigned = typename std::make_unsigned<T>::type;
434 return static_cast<T>(static_cast<Unsigned>(a) + static_cast<Unsigned>(b));
435 }
GLenum type
static bool b
struct MyStruct a[10]
#define T
Definition: precompiler.cc:65

◆ BigEndianToHost32()

static uint32_t dart::Utils::BigEndianToHost32 ( uint32_t  be_value)
inlinestatic

Definition at line 518 of file utils.h.

518 {
519 return HostToBigEndian32(be_value);
520 }
static uint32_t HostToBigEndian32(uint32_t host_value)
Definition: utils_android.h:20

◆ Bit()

template<typename T = uword>
static constexpr T dart::Utils::Bit ( size_t  n)
inlinestaticconstexpr

Definition at line 557 of file utils.h.

557 {
558 ASSERT(n < sizeof(T) * kBitsPerByte);
559 T bit = 1;
560 return bit << n;
561 }
constexpr intptr_t kBitsPerByte
Definition: globals.h:463

◆ BitLength()

static constexpr size_t dart::Utils::BitLength ( int64_t  value)
inlinestaticconstexpr

Definition at line 213 of file utils.h.

213 {
214 // Flip bits if negative (-1 becomes 0).
215 value ^= value >> (8 * sizeof(value) - 1);
216 return (value == 0) ? 0 : (Utils::HighestBit(value) + 1);
217 }
static constexpr size_t HighestBit(int64_t v)
Definition: utils.h:185
uint8_t value

◆ CalculateMagicAndShiftForDivRem()

void dart::Utils::CalculateMagicAndShiftForDivRem ( int64_t  divisor,
int64_t *  magic,
int64_t *  shift 
)
static

Definition at line 39 of file utils.cc.

41 {
42 ASSERT(divisor <= -2 || divisor >= 2);
43 /* The magic number M and shift S can be calculated in the following way:
44 * Let nc be the most positive value of numerator(n) such that nc = kd - 1,
45 * where divisor(d) >= 2.
46 * Let nc be the most negative value of numerator(n) such that nc = kd + 1,
47 * where divisor(d) <= -2.
48 * Thus nc can be calculated like:
49 * nc = exp + exp % d - 1, where d >= 2 and exp = 2^63.
50 * nc = -exp + (exp + 1) % d, where d >= 2 and exp = 2^63.
51 *
52 * So the shift p is the smallest p satisfying
53 * 2^p > nc * (d - 2^p % d), where d >= 2
54 * 2^p > nc * (d + 2^p % d), where d <= -2.
55 *
56 * The magic number M is calculated by
57 * M = (2^p + d - 2^p % d) / d, where d >= 2
58 * M = (2^p - d - 2^p % d) / d, where d <= -2.
59 */
60 int64_t p = 63;
61 const uint64_t exp = 1LL << 63;
62
63 // Initialize the computations.
64 uint64_t abs_d = (divisor >= 0) ? divisor : -static_cast<uint64_t>(divisor);
65 uint64_t sign_bit = static_cast<uint64_t>(divisor) >> 63;
66 uint64_t tmp = exp + sign_bit;
67 uint64_t abs_nc = tmp - 1 - (tmp % abs_d);
68 uint64_t quotient1 = exp / abs_nc;
69 uint64_t remainder1 = exp % abs_nc;
70 uint64_t quotient2 = exp / abs_d;
71 uint64_t remainder2 = exp % abs_d;
72
73 // To avoid handling both positive and negative divisor,
74 // "Hacker's Delight" introduces a method to handle these
75 // two cases together to avoid duplication.
76 uint64_t delta;
77 do {
78 p++;
79 quotient1 = 2 * quotient1;
80 remainder1 = 2 * remainder1;
81 if (remainder1 >= abs_nc) {
82 quotient1++;
83 remainder1 = remainder1 - abs_nc;
84 }
85 quotient2 = 2 * quotient2;
86 remainder2 = 2 * remainder2;
87 if (remainder2 >= abs_d) {
88 quotient2++;
89 remainder2 = remainder2 - abs_d;
90 }
91 delta = abs_d - remainder2;
92 } while (quotient1 < delta || (quotient1 == delta && remainder1 == 0));
93
94 *magic = (divisor > 0) ? (quotient2 + 1) : (-quotient2 - 1);
95 *shift = p - 64;
96}

◆ Close()

static int dart::Utils::Close ( int  fildes)
static

◆ CountLeadingZeros32()

static int dart::Utils::CountLeadingZeros32 ( uint32_t  x)
inlinestatic

Definition at line 219 of file utils.h.

219 {
220#if defined(DART_HOST_OS_WINDOWS)
221 unsigned long position; // NOLINT
222 return (_BitScanReverse(&position, x) == 0)
223 ? 32
224 : 31 - static_cast<int>(position);
225#else
226 return x == 0 ? 32 : __builtin_clz(x);
227#endif
228 }

◆ CountLeadingZeros64()

static int dart::Utils::CountLeadingZeros64 ( uint64_t  x)
inlinestatic

Definition at line 229 of file utils.h.

229 {
230#if defined(DART_HOST_OS_WINDOWS)
231#if defined(ARCH_IS_32_BIT)
232 const uint32_t x_hi = static_cast<uint32_t>(x >> 32);
233 if (x_hi != 0) {
234 return CountLeadingZeros32(x_hi);
235 }
236 return 32 + CountLeadingZeros32(static_cast<uint32_t>(x));
237#else
238 unsigned long position; // NOLINT
239 return (_BitScanReverse64(&position, x) == 0)
240 ? 64
241 : 63 - static_cast<int>(position);
242#endif
243#else
244 return x == 0 ? 64 : __builtin_clzll(x);
245#endif
246 }
static int CountLeadingZeros32(uint32_t x)
Definition: utils.h:219

◆ CountLeadingZerosWord()

static int dart::Utils::CountLeadingZerosWord ( uword  x)
inlinestatic

Definition at line 247 of file utils.h.

247 {
248#ifdef ARCH_IS_64_BIT
249 return CountLeadingZeros64(x);
250#else
251 return CountLeadingZeros32(x);
252#endif
253 }
static int CountLeadingZeros64(uint64_t x)
Definition: utils.h:229

◆ CountOneBits32()

static constexpr int dart::Utils::CountOneBits32 ( uint32_t  x)
inlinestaticconstexpr

Definition at line 160 of file utils.h.

160 {
161 // Apparently there are x64 chips without popcount.
162#if __GNUC__ && !defined(HOST_ARCH_IA32) && !defined(HOST_ARCH_X64)
163 return __builtin_popcount(x);
164#else
165 // Implementation is from "Hacker's Delight" by Henry S. Warren, Jr.,
166 // figure 5-2, page 66, where the function is called pop.
167 x = x - ((x >> 1) & 0x55555555);
168 x = (x & 0x33333333) + ((x >> 2) & 0x33333333);
169 x = (x + (x >> 4)) & 0x0F0F0F0F;
170 x = x + (x >> 8);
171 x = x + (x >> 16);
172 return static_cast<int>(x & 0x0000003F);
173#endif
174 }

◆ CountOneBits64()

static constexpr int dart::Utils::CountOneBits64 ( uint64_t  x)
inlinestaticconstexpr

Definition at line 148 of file utils.h.

148 {
149 // Apparently there are x64 chips without popcount.
150#if __GNUC__ && !defined(HOST_ARCH_IA32) && !defined(HOST_ARCH_X64)
151 return __builtin_popcountll(x);
152#else
153 x = x - ((x >> 1) & 0x5555555555555555);
154 x = (x & 0x3333333333333333) + ((x >> 2) & 0x3333333333333333);
155 x = (((x + (x >> 4)) & 0x0f0f0f0f0f0f0f0f) * 0x0101010101010101) >> 56;
156 return x;
157#endif
158 }

◆ CountOneBitsWord()

static constexpr int dart::Utils::CountOneBitsWord ( uword  x)
inlinestaticconstexpr

Definition at line 176 of file utils.h.

176 {
177#ifdef ARCH_IS_64_BIT
178 return CountOneBits64(x);
179#else
180 return CountOneBits32(x);
181#endif
182 }
static constexpr int CountOneBits32(uint32_t x)
Definition: utils.h:160
static constexpr int CountOneBits64(uint64_t x)
Definition: utils.h:148

◆ CountTrailingZeros32()

static int dart::Utils::CountTrailingZeros32 ( uint32_t  x)
inlinestatic

Definition at line 255 of file utils.h.

255 {
256#if defined(DART_HOST_OS_WINDOWS)
257 unsigned long position; // NOLINT
258 return (_BitScanForward(&position, x) == 0) ? 32
259 : static_cast<int>(position);
260#else
261 return x == 0 ? 32 : __builtin_ctz(x);
262#endif
263 }

◆ CountTrailingZeros64()

static int dart::Utils::CountTrailingZeros64 ( uint64_t  x)
inlinestatic

Definition at line 264 of file utils.h.

264 {
265#if defined(DART_HOST_OS_WINDOWS)
266#if defined(ARCH_IS_32_BIT)
267 const uint32_t x_lo = static_cast<uint32_t>(x);
268 if (x_lo != 0) {
269 return CountTrailingZeros32(x_lo);
270 }
271 return 32 + CountTrailingZeros32(static_cast<uint32_t>(x >> 32));
272#else
273 unsigned long position; // NOLINT
274 return (_BitScanForward64(&position, x) == 0) ? 64
275 : static_cast<int>(position);
276#endif
277#else
278 return x == 0 ? 64 : __builtin_ctzll(x);
279#endif
280 }
static int CountTrailingZeros32(uint32_t x)
Definition: utils.h:255

◆ CountTrailingZerosWord()

static int dart::Utils::CountTrailingZerosWord ( uword  x)
inlinestatic

Definition at line 281 of file utils.h.

281 {
282#ifdef ARCH_IS_64_BIT
283 return CountTrailingZeros64(x);
284#else
285 return CountTrailingZeros32(x);
286#endif
287 }
static int CountTrailingZeros64(uint64_t x)
Definition: utils.h:264

◆ DivideAllowZero() [1/2]

static double dart::Utils::DivideAllowZero ( double  a,
double  b 
)
inlinestatic

Definition at line 503 of file utils.h.

503 {
504 return a / b;
505 }

◆ DivideAllowZero() [2/2]

static float dart::Utils::DivideAllowZero ( float  a,
float  b 
)
inlinestatic

Definition at line 496 of file utils.h.

496 {
497 return a / b;
498 }

◆ DoublesBitEqual()

static bool dart::Utils::DoublesBitEqual ( const double  a,
const double  b 
)
inlinestatic

Definition at line 525 of file utils.h.

525 {
526 return bit_cast<int64_t, double>(a) == bit_cast<int64_t, double>(b);
527 }

◆ HexDigitToInt()

static int dart::Utils::HexDigitToInt ( char  c)
inlinestatic

Definition at line 395 of file utils.h.

395 {
396 ASSERT(IsHexDigit(c));
397 if (IsDecimalDigit(c)) return c - '0';
398 if (('A' <= c) && (c <= 'F')) return 10 + (c - 'A');
399 return 10 + (c - 'a');
400 }
static constexpr bool IsDecimalDigit(uint32_t c)
Definition: utils.h:386
static bool IsHexDigit(char c)
Definition: utils.h:390

◆ High16Bits()

static int32_t dart::Utils::High16Bits ( int32_t  value)
inlinestatic

Definition at line 365 of file utils.h.

365 {
366 return static_cast<int32_t>(value >> 16);
367 }

◆ High32Bits()

static int32_t dart::Utils::High32Bits ( int64_t  value)
inlinestatic

Definition at line 373 of file utils.h.

373 {
374 return static_cast<int32_t>(value >> 32);
375 }

◆ HighestBit()

static constexpr size_t dart::Utils::HighestBit ( int64_t  v)
inlinestaticconstexpr

Definition at line 185 of file utils.h.

185 {
186 uint64_t x = static_cast<uint64_t>((v > 0) ? v : -v);
187 uint64_t t = 0;
188 size_t r = 0;
189 if ((t = x >> 32) != 0) {
190 x = t;
191 r += 32;
192 }
193 if ((t = x >> 16) != 0) {
194 x = t;
195 r += 16;
196 }
197 if ((t = x >> 8) != 0) {
198 x = t;
199 r += 8;
200 }
201 if ((t = x >> 4) != 0) {
202 x = t;
203 r += 4;
204 }
205 if ((t = x >> 2) != 0) {
206 x = t;
207 r += 2;
208 }
209 if (x > 1) r += 1;
210 return r;
211 }

◆ HostToBigEndian16()

uint16_t dart::Utils::HostToBigEndian16 ( uint16_t  host_value)
inlinestatic

Definition at line 16 of file utils_android.h.

16 {
17 return htobe16(value);
18}

◆ HostToBigEndian32()

uint32_t dart::Utils::HostToBigEndian32 ( uint32_t  host_value)
inlinestatic

Definition at line 20 of file utils_android.h.

20 {
21 return htobe32(value);
22}

◆ HostToBigEndian64()

uint64_t dart::Utils::HostToBigEndian64 ( uint64_t  host_value)
inlinestatic

Definition at line 24 of file utils_android.h.

24 {
25 return htobe64(value);
26}

◆ HostToLittleEndian16()

uint16_t dart::Utils::HostToLittleEndian16 ( uint16_t  host_value)
inlinestatic

Definition at line 28 of file utils_android.h.

28 {
29 return htole16(value);
30}

◆ HostToLittleEndian32()

uint32_t dart::Utils::HostToLittleEndian32 ( uint32_t  host_value)
inlinestatic

Definition at line 32 of file utils_android.h.

32 {
33 return htole32(value);
34}

◆ HostToLittleEndian64()

uint64_t dart::Utils::HostToLittleEndian64 ( uint64_t  host_value)
inlinestatic

Definition at line 36 of file utils_android.h.

36 {
37 return htole64(value);
38}

◆ IntToHexDigit()

static char dart::Utils::IntToHexDigit ( int  i)
inlinestatic

Definition at line 402 of file utils.h.

402 {
403 ASSERT(0 <= i && i < 16);
404 if (i < 10) return static_cast<char>('0' + i);
405 return static_cast<char>('A' + (i - 10));
406 }

◆ IsAligned() [1/2]

template<typename T >
static constexpr bool dart::Utils::IsAligned ( T x,
uintptr_t  alignment,
uintptr_t  offset = 0 
)
inlinestaticconstexpr

Definition at line 101 of file utils.h.

103 {
104 return IsAligned(reinterpret_cast<uword>(x), alignment, offset);
105 }
static constexpr bool IsAligned(T x, uintptr_t alignment, uintptr_t offset=0)
Definition: utils.h:92
uintptr_t uword
Definition: globals.h:501
SeparatedVector2 offset

◆ IsAligned() [2/2]

template<typename T >
static constexpr bool dart::Utils::IsAligned ( T  x,
uintptr_t  alignment,
uintptr_t  offset = 0 
)
inlinestaticconstexpr

Definition at line 92 of file utils.h.

94 {
95 ASSERT(IsPowerOfTwo(alignment));
96 ASSERT(offset < alignment);
97 return (x & (alignment - 1)) == offset;
98 }
static constexpr bool IsPowerOfTwo(T x)
Definition: utils.h:76

◆ IsAlphaNumeric()

static constexpr bool dart::Utils::IsAlphaNumeric ( uint32_t  c)
inlinestaticconstexpr

Definition at line 381 of file utils.h.

381 {
382 return (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') ||
384 }

◆ IsDecimalDigit()

static constexpr bool dart::Utils::IsDecimalDigit ( uint32_t  c)
inlinestaticconstexpr

Definition at line 386 of file utils.h.

386 {
387 return ('0' <= c) && (c <= '9');
388 }

◆ IsHexDigit()

static bool dart::Utils::IsHexDigit ( char  c)
inlinestatic

Definition at line 390 of file utils.h.

390 {
391 return IsDecimalDigit(c) || (('A' <= c) && (c <= 'F')) ||
392 (('a' <= c) && (c <= 'f'));
393 }

◆ IsInt()

template<typename T >
static bool dart::Utils::IsInt ( intptr_t  N,
T  value 
)
inlinestatic

Definition at line 313 of file utils.h.

313 {
314 ASSERT(N >= 1);
315 constexpr intptr_t value_size_in_bits = kBitsPerByte * sizeof(T);
316 if constexpr (std::is_signed<T>::value) {
317 if (N >= value_size_in_bits) return true; // Trivially fits.
318 const T limit = static_cast<T>(1) << (N - 1);
319 return (-limit <= value) && (value < limit);
320 } else {
321 if (N > value_size_in_bits) return true; // Trivially fits.
322 const T limit = static_cast<T>(1) << (N - 1);
323 return value < limit;
324 }
325 }
#define N
Definition: beziers.cpp:19

◆ IsJavaScriptInt()

static bool dart::Utils::IsJavaScriptInt ( int64_t  value)
inlinestatic

Definition at line 542 of file utils.h.

542 {
543 return ((-0x20000000000000LL <= value) && (value <= 0x20000000000000LL));
544 }

◆ IsPowerOfTwo()

template<typename T >
static constexpr bool dart::Utils::IsPowerOfTwo ( T  x)
inlinestaticconstexpr

Definition at line 76 of file utils.h.

76 {
77 return ((x & (x - 1)) == 0) && (x != 0);
78 }

◆ IsUint()

template<typename T >
static bool dart::Utils::IsUint ( intptr_t  N,
T  value 
)
inlinestatic

Definition at line 328 of file utils.h.

328 {
329 ASSERT(N >= 1);
330 constexpr intptr_t value_size_in_bits = kBitsPerByte * sizeof(T);
331 if constexpr (std::is_signed<T>::value) {
332 if (value < 0) return false; // Not an unsigned value.
333 if (N >= value_size_in_bits - 1) {
334 return true; // N can fit the magnitude bits.
335 }
336 } else {
337 if (N >= value_size_in_bits) return true; // Trivially fits.
338 }
339 const T limit = (static_cast<T>(1) << N) - 1;
340 return value <= limit;
341 }

◆ LittleEndianToHost64()

static uint64_t dart::Utils::LittleEndianToHost64 ( uint64_t  le_value)
inlinestatic

Definition at line 521 of file utils.h.

521 {
522 return HostToLittleEndian64(le_value);
523 }
static uint64_t HostToLittleEndian64(uint64_t host_value)
Definition: utils_android.h:36

◆ LoadDynamicLibrary()

void * dart::Utils::LoadDynamicLibrary ( const char *  library_path,
char **  error = nullptr 
)
static

Definition at line 289 of file utils.cc.

289 {
290 void* handle = nullptr;
291
292#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
293 defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA)
294 handle = dlopen(library_path, RTLD_LAZY);
295#elif defined(DART_HOST_OS_WINDOWS)
296 SetLastError(0); // Clear any errors.
297
298 if (library_path == nullptr) {
299 handle = GetModuleHandle(nullptr);
300 } else {
301 // Convert to wchar_t string.
302 const int name_len = MultiByteToWideChar(
303 CP_UTF8, /*dwFlags=*/0, library_path, /*cbMultiByte=*/-1, nullptr, 0);
304 if (name_len != 0) {
305 std::unique_ptr<wchar_t[]> name(new wchar_t[name_len]);
306 const int written_len =
307 MultiByteToWideChar(CP_UTF8, /*dwFlags=*/0, library_path,
308 /*cbMultiByte=*/-1, name.get(), name_len);
309 RELEASE_ASSERT(written_len == name_len);
310 handle = LoadLibraryW(name.get());
311 }
312 }
313#endif
314
315 if (handle == nullptr) {
317 }
318
319 return handle;
320}
#define RELEASE_ASSERT(cond)
Definition: assert.h:327
const uint8_t uint32_t uint32_t GError ** error
const char *const name
static void GetLastErrorAsString(char **error)
Definition: utils.cc:257
WINBASEAPI VOID WINAPI SetLastError(_In_ DWORD dwErrCode)

◆ Low16Bits()

static int32_t dart::Utils::Low16Bits ( int32_t  value)
inlinestatic

Definition at line 361 of file utils.h.

361 {
362 return static_cast<int32_t>(value & 0xffff);
363 }

◆ Low32Bits()

static int32_t dart::Utils::Low32Bits ( int64_t  value)
inlinestatic

Definition at line 369 of file utils.h.

369 {
370 return static_cast<int32_t>(value);
371 }

◆ LowHighTo64Bits()

static int64_t dart::Utils::LowHighTo64Bits ( uint32_t  low,
int32_t  high 
)
inlinestatic

Definition at line 377 of file utils.h.

377 {
378 return (static_cast<uint64_t>(high) << 32) | (low & 0x0ffffffffLL);
379 }

◆ MagnitudeIsUint()

template<typename T >
static bool dart::Utils::MagnitudeIsUint ( intptr_t  N,
T  value 
)
inlinestatic

Definition at line 352 of file utils.h.

352 {
353 ASSERT(N >= 1);
354 if constexpr (std::is_signed<T>::value) {
355 using Unsigned = typename std::make_unsigned<T>::type;
356 if (value < 0) return IsUint<Unsigned>(N, -value);
357 }
358 return IsUint(N, value);
359 }
static bool IsUint(intptr_t N, T value)
Definition: utils.h:328

◆ Maximum()

template<typename T >
static constexpr T dart::Utils::Maximum ( T  x,
T  y 
)
inlinestaticconstexpr

Definition at line 41 of file utils.h.

41 {
42 return x > y ? x : y;
43 }
double y

◆ Minimum()

template<typename T >
static T dart::Utils::Minimum ( T  x,
T  y 
)
inlinestatic

Definition at line 36 of file utils.h.

36 {
37 return x < y ? x : y;
38 }

◆ MulWithWrapAround()

template<typename T = int64_t>
static T dart::Utils::MulWithWrapAround ( T  a,
T  b 
)
inlinestatic

Definition at line 449 of file utils.h.

449 {
450 // Avoid undefined behavior by doing arithmetic in the unsigned type.
451 using Unsigned = typename std::make_unsigned<T>::type;
452 return static_cast<T>(static_cast<Unsigned>(a) * static_cast<Unsigned>(b));
453 }

◆ NBitMask()

template<typename T = uword>
static constexpr T dart::Utils::NBitMask ( size_t  n)
inlinestaticconstexpr

Definition at line 548 of file utils.h.

548 {
549 using Unsigned = typename std::make_unsigned<T>::type;
550 constexpr size_t kBitsPerT = sizeof(T) * kBitsPerByte;
551 assert(n <= sizeof(T) * kBitsPerT);
552 return static_cast<T>(n == kBitsPerT ? std::numeric_limits<Unsigned>::max()
553 : (static_cast<Unsigned>(1) << n) - 1);
554 }

◆ NegWithWrapAround()

template<typename T = int64_t>
static T dart::Utils::NegWithWrapAround ( T  a)
inlinestatic

Definition at line 456 of file utils.h.

456 {
457 // Avoid undefined behavior by doing arithmetic in the unsigned type.
458 using Unsigned = typename std::make_unsigned<T>::type;
459 return static_cast<T>(-static_cast<Unsigned>(a));
460 }

◆ RangeCheck()

static bool dart::Utils::RangeCheck ( intptr_t  offset,
intptr_t  count,
intptr_t  length 
)
inlinestatic

Definition at line 411 of file utils.h.

413 {
414 return offset >= 0 && count >= 0 && length >= 0 &&
415 count <= (length - offset);
416 }
int count
Definition: FontMgrTest.cpp:50
size_t length

◆ Read()

static size_t dart::Utils::Read ( int  filedes,
void *  buf,
size_t  nbyte 
)
static

◆ ResolveSymbolInDynamicLibrary()

void * dart::Utils::ResolveSymbolInDynamicLibrary ( void *  library_handle,
const char *  symbol,
char **  error = nullptr 
)
static

Definition at line 322 of file utils.cc.

324 {
325 void* result = nullptr;
326
327#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
328 defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA)
329 dlerror(); // Clear any errors.
330 result = dlsym(library_handle, symbol);
331 // Note: nullptr might be a valid return from dlsym. Must call dlerror
332 // to differentiate.
334 return result;
335#elif defined(DART_HOST_OS_WINDOWS)
336 SetLastError(0);
337 result = reinterpret_cast<void*>(
338 GetProcAddress(reinterpret_cast<HMODULE>(library_handle), symbol));
339#endif
340
341 if (result == nullptr) {
343 }
344
345 return result;
346}
GAsyncResult * result
HINSTANCE HMODULE
Definition: windows_types.h:96

◆ ReverseBits32()

uint32_t dart::Utils::ReverseBits32 ( uint32_t  x)
static

Definition at line 27 of file utils.cc.

27 {
28 x = ((x >> 16) & 0x0000ffff) | ((x & 0x0000ffff) << 16);
29 x = ((x >> 8) & 0x00ff00ff) | ((x & 0x00ff00ff) << 8);
30 x = ((x >> 4) & 0x0f0f0f0f) | ((x & 0x0f0f0f0f) << 4);
31 x = ((x >> 2) & 0x33333333) | ((x & 0x33333333) << 2);
32 x = ((x >> 1) & 0x55555555) | ((x & 0x55555555) << 1);
33 return x;
34}

◆ ReverseBits64()

uint64_t dart::Utils::ReverseBits64 ( uint64_t  x)
static

Definition at line 17 of file utils.cc.

17 {
18 x = ((x >> 32) & 0x00000000ffffffff) | (x << 32);
19 x = ((x >> 16) & 0x0000ffff0000ffff) | ((x & 0x0000ffff0000ffff) << 16);
20 x = ((x >> 8) & 0x00ff00ff00ff00ff) | ((x & 0x00ff00ff00ff00ff) << 8);
21 x = ((x >> 4) & 0x0f0f0f0f0f0f0f0f) | ((x & 0x0f0f0f0f0f0f0f0f) << 4);
22 x = ((x >> 2) & 0x3333333333333333) | ((x & 0x3333333333333333) << 2);
23 x = ((x >> 1) & 0x5555555555555555) | ((x & 0x5555555555555555) << 1);
24 return x;
25}

◆ ReverseBitsWord()

static uword dart::Utils::ReverseBitsWord ( uword  x)
inlinestatic

Definition at line 292 of file utils.h.

292 {
293#ifdef ARCH_IS_64_BIT
294 return ReverseBits64(x);
295#else
296 return ReverseBits32(x);
297#endif
298 }
static uint32_t ReverseBits32(uint32_t x)
Definition: utils.cc:27
static uint64_t ReverseBits64(uint64_t x)
Definition: utils.cc:17

◆ RotateLeft()

template<typename T >
static T dart::Utils::RotateLeft ( T  value,
uint8_t  rotate 
)
inlinestatic

Definition at line 474 of file utils.h.

474 {
475 const uint8_t width = sizeof(T) * kBitsPerByte;
476 ASSERT(0 <= rotate);
477 ASSERT(rotate <= width);
478 using Unsigned = typename std::make_unsigned<T>::type;
479 return (static_cast<Unsigned>(value) << rotate) |
480 (static_cast<T>(value) >> ((width - rotate) & (width - 1)));
481 }
static bool rotate(const SkDCubic &cubic, int zero, int index, SkDCubic &rotPath)
int32_t width

◆ RotateRight()

template<typename T >
static T dart::Utils::RotateRight ( T  value,
uint8_t  rotate 
)
inlinestatic

Definition at line 483 of file utils.h.

483 {
484 const uint8_t width = sizeof(T) * kBitsPerByte;
485 ASSERT(0 <= rotate);
486 ASSERT(rotate <= width);
487 using Unsigned = typename std::make_unsigned<T>::type;
488 return (static_cast<T>(value) >> rotate) |
489 (static_cast<Unsigned>(value) << ((width - rotate) & (width - 1)));
490 }

◆ RoundDown() [1/2]

template<typename T >
static T * dart::Utils::RoundDown ( T x,
intptr_t  alignment 
)
inlinestatic

Definition at line 114 of file utils.h.

114 {
115 return reinterpret_cast<T*>(
116 RoundDown(reinterpret_cast<uword>(x), alignment));
117 }
static constexpr T RoundDown(T x, intptr_t alignment)
Definition: utils.h:108

◆ RoundDown() [2/2]

template<typename T >
static constexpr T dart::Utils::RoundDown ( T  x,
intptr_t  alignment 
)
inlinestaticconstexpr

Definition at line 108 of file utils.h.

108 {
109 ASSERT(IsPowerOfTwo(alignment));
110 return (x & -alignment);
111 }

◆ RoundUp() [1/2]

template<typename T >
static T * dart::Utils::RoundUp ( T x,
uintptr_t  alignment,
uintptr_t  offset = 0 
)
inlinestatic

Definition at line 128 of file utils.h.

128 {
129 return reinterpret_cast<T*>(
130 RoundUp(reinterpret_cast<uword>(x), alignment, offset));
131 }
static constexpr T RoundUp(T x, uintptr_t alignment, uintptr_t offset=0)
Definition: utils.h:120

◆ RoundUp() [2/2]

template<typename T >
static constexpr T dart::Utils::RoundUp ( T  x,
uintptr_t  alignment,
uintptr_t  offset = 0 
)
inlinestaticconstexpr

Definition at line 120 of file utils.h.

122 {
123 ASSERT(offset < alignment);
124 return RoundDown(x + alignment - 1 + offset, alignment) - offset;
125 }

◆ RoundUpToPowerOfTwo()

static constexpr uintptr_t dart::Utils::RoundUpToPowerOfTwo ( uintptr_t  x)
inlinestaticconstexpr

Definition at line 135 of file utils.h.

135 {
136 x = x - 1;
137 x = x | (x >> 1);
138 x = x | (x >> 2);
139 x = x | (x >> 4);
140 x = x | (x >> 8);
141 x = x | (x >> 16);
142#if defined(ARCH_IS_64_BIT)
143 x = x | (x >> 32);
144#endif // defined(ARCH_IS_64_BIT)
145 return x + 1;
146 }

◆ SafeDoubleToInt()

template<typename T >
static T dart::Utils::SafeDoubleToInt ( double  v)
inlinestatic

Definition at line 533 of file utils.h.

533 {
534 const double min = static_cast<double>(std::numeric_limits<T>::min());
535 const double max = static_cast<double>(std::numeric_limits<T>::max());
536 return (min <= v && v <= max) ? static_cast<T>(v)
538 }

◆ SCreate()

char * dart::Utils::SCreate ( const char *  format,
  ... 
)
static

Definition at line 231 of file utils.cc.

231 {
232 va_list args;
234 char* buffer = VSCreate(format, args);
235 va_end(args);
236 return buffer;
237}
static char static char * VSCreate(const char *format, va_list args)
Definition: utils.cc:239
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
uint32_t uint32_t * format
va_start(args, format)
va_end(args)
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126

◆ ShiftForPowerOfTwo()

template<typename T >
static constexpr int dart::Utils::ShiftForPowerOfTwo ( T  x)
inlinestaticconstexpr

Definition at line 81 of file utils.h.

81 {
83 int num_shifts = 0;
84 while (x > 1) {
85 num_shifts++;
86 x = x >> 1;
87 }
88 return num_shifts;
89 }

◆ ShiftLeftWithTruncation()

static int64_t dart::Utils::ShiftLeftWithTruncation ( int64_t  a,
int64_t  b 
)
inlinestatic

Definition at line 464 of file utils.h.

464 {
465 ASSERT(b >= 0);
466 if (b >= kBitsPerInt64) {
467 return 0;
468 }
469 // Avoid undefined behavior by doing arithmetic in the unsigned type.
470 return static_cast<int64_t>(static_cast<uint64_t>(a) << b);
471 }
constexpr intptr_t kBitsPerInt64
Definition: globals.h:467

◆ SNPrint()

static int dart::Utils::SNPrint ( char *  str,
size_t  size,
const char *  format,
  ... 
)
static

◆ StrDup()

static char * dart::Utils::StrDup ( const char *  s)
static

◆ StrError()

char * dart::Utils::StrError ( int  err,
char *  buffer,
size_t  bufsize 
)
inlinestatic

Definition at line 40 of file utils_android.h.

40 {
41 if (strerror_r(err, buffer, bufsize) != 0) {
42 snprintf(buffer, bufsize, "%s", "strerror_r failed");
43 }
44 return buffer;
45}

◆ StringHash()

uint32_t dart::Utils::StringHash ( const void *  data,
int  length 
)
static

Definition at line 114 of file utils.cc.

114 {
115 int size = length;
116 uint32_t hash = size;
117
118 auto cursor = reinterpret_cast<const uint8_t*>(data);
119
120 if (size >= kInt32Size) {
121 const intptr_t misalignment =
122 reinterpret_cast<intptr_t>(cursor) % kInt32Size;
123 if (misalignment > 0) {
124 // Stores 4-byte values starting from the start of the string to mimic
125 // the algorithm on aligned data.
126 uint32_t data_window = 0;
127
128 // Shift sizes for adjusting the data window when adding the next aligned
129 // piece of data.
130 const uint32_t sr = misalignment * kBitsPerByte;
131 const uint32_t sl = kBitsPerInt32 - sr;
132
133 const intptr_t pre_alignment_length = kInt32Size - misalignment;
134 switch (pre_alignment_length) {
135 case 3:
136 data_window |= cursor[2] << 16;
138 case 2:
139 data_window |= cursor[1] << 8;
141 case 1:
142 data_window |= cursor[0];
143 }
144 cursor += pre_alignment_length;
145 size -= pre_alignment_length;
146
147 // Mix four bytes at a time now that we're at an aligned spot.
148 for (; size >= kInt32Size; cursor += kInt32Size, size -= kInt32Size) {
149 uint32_t aligned_part = *reinterpret_cast<const uint32_t*>(cursor);
150 data_window |= (aligned_part << sl);
151 MIX(hash, data_window);
152 data_window = aligned_part >> sr;
153 }
154
155 if (size >= misalignment) {
156 // There's one more full window in the data. We'll let the normal tail
157 // code handle any partial window.
158 switch (misalignment) {
159 case 3:
160 data_window |= cursor[2] << (16 + sl);
162 case 2:
163 data_window |= cursor[1] << (8 + sl);
165 case 1:
166 data_window |= cursor[0] << sl;
167 }
168 MIX(hash, data_window);
169 cursor += misalignment;
170 size -= misalignment;
171 } else {
172 // This is a partial window, so just xor and multiply by M.
173 switch (size) {
174 case 2:
175 data_window |= cursor[1] << (8 + sl);
177 case 1:
178 data_window |= cursor[0] << sl;
179 }
180 hash ^= data_window;
182 cursor += size;
183 size = 0;
184 }
185 } else {
186 // Mix four bytes at a time into the hash.
187 for (; size >= kInt32Size; size -= kInt32Size, cursor += kInt32Size) {
188 uint32_t part = *reinterpret_cast<const uint32_t*>(cursor);
189 MIX(hash, part);
190 }
191 }
192 }
193
194 // Handle the last few bytes of the string if any.
195 switch (size) {
196 case 3:
197 hash ^= cursor[2] << 16;
199 case 2:
200 hash ^= cursor[1] << 8;
202 case 1:
203 hash ^= cursor[0];
205 }
206
207 // Do a few final mixes of the hash to ensure the last few bytes are
208 // well-incorporated.
209 hash ^= hash >> 13;
211 hash ^= hash >> 15;
212 return hash;
213}
static uint32_t hash(const SkShaderBase::GradientInfo &v)
constexpr intptr_t kInt32Size
Definition: globals.h:450
static constexpr uint32_t kStringHashM
Definition: utils.cc:101
constexpr intptr_t kBitsPerInt32
Definition: globals.h:466
static int8_t data[kExtLength]
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
#define FALL_THROUGH
Definition: globals.h:15
#define MIX(hash, part)
Definition: utils.cc:105

◆ StrNDup()

static char * dart::Utils::StrNDup ( const char *  s,
intptr_t  n 
)
static

◆ StrNLen()

static intptr_t dart::Utils::StrNLen ( const char *  s,
intptr_t  n 
)
static

◆ StrStartsWith()

static bool dart::Utils::StrStartsWith ( const char *  s,
const char *  prefix 
)
inlinestatic

Definition at line 627 of file utils.h.

627 {
628 return strncmp(s, prefix, strlen(prefix)) == 0;
629 }
struct MyStruct s

◆ SubWithWrapAround()

template<typename T = int64_t>
static T dart::Utils::SubWithWrapAround ( T  a,
T  b 
)
inlinestatic

Definition at line 440 of file utils.h.

440 {
441 // Avoid undefined behavior by doing arithmetic in the unsigned type.
442 using Unsigned = typename std::make_unsigned<T>::type;
443 return static_cast<T>(static_cast<Unsigned>(a) - static_cast<Unsigned>(b));
444 }

◆ TestBit()

template<typename T >
static constexpr bool dart::Utils::TestBit ( T  mask,
size_t  position 
)
inlinestaticconstexpr

Definition at line 564 of file utils.h.

564 {
565 ASSERT(position < sizeof(T) * kBitsPerByte);
566 return ((mask >> position) & 1) != 0;
567 }

◆ Unlink()

static int dart::Utils::Unlink ( const char *  path)
static

◆ UnloadDynamicLibrary()

void dart::Utils::UnloadDynamicLibrary ( void *  library_handle,
char **  error = nullptr 
)
static

Definition at line 348 of file utils.cc.

348 {
349 bool ok = false;
350
351#if defined(DART_HOST_OS_LINUX) || defined(DART_HOST_OS_MACOS) || \
352 defined(DART_HOST_OS_ANDROID) || defined(DART_HOST_OS_FUCHSIA)
353 ok = dlclose(library_handle) == 0;
354#elif defined(DART_HOST_OS_WINDOWS)
355 SetLastError(0); // Clear any errors.
356
357 ok = FreeLibrary(reinterpret_cast<HMODULE>(library_handle));
358#endif
359
360 if (!ok) {
362 }
363}
static bool ok(int result)

◆ VSCreate()

char * dart::Utils::VSCreate ( const char *  format,
va_list  args 
)
static

Definition at line 239 of file utils.cc.

239 {
240 // Measure.
241 va_list measure_args;
242 va_copy(measure_args, args);
243 intptr_t len = VSNPrint(nullptr, 0, format, measure_args);
244 va_end(measure_args);
245
246 char* buffer = reinterpret_cast<char*>(malloc(len + 1));
247 ASSERT(buffer != nullptr);
248
249 // Print.
250 va_list print_args;
251 va_copy(print_args, args);
252 VSNPrint(buffer, len + 1, format, print_args);
253 va_end(print_args);
254 return buffer;
255}
static int static int VSNPrint(char *str, size_t size, const char *format, va_list args)
void * malloc(size_t size)
Definition: allocation.cc:19

◆ VSNPrint()

static int static int dart::Utils::VSNPrint ( char *  str,
size_t  size,
const char *  format,
va_list  args 
)
static

◆ WillAddOverflow()

static bool dart::Utils::WillAddOverflow ( int64_t  a,
int64_t  b 
)
inlinestatic

Definition at line 418 of file utils.h.

418 {
419 return ((b > 0) && (a > (kMaxInt64 - b))) ||
420 ((b < 0) && (a < (kMinInt64 - b)));
421 }
constexpr int64_t kMaxInt64
Definition: globals.h:486
constexpr int64_t kMinInt64
Definition: globals.h:485

◆ WillSubOverflow()

static bool dart::Utils::WillSubOverflow ( int64_t  a,
int64_t  b 
)
inlinestatic

Definition at line 423 of file utils.h.

423 {
424 return ((b > 0) && (a < (kMinInt64 + b))) ||
425 ((b < 0) && (a > (kMaxInt64 + b)));
426 }

◆ WordHash()

uint32_t dart::Utils::WordHash ( intptr_t  key)
static

Definition at line 217 of file utils.cc.

217 {
218 // TODO(iposva): Need to check hash spreading.
219 // This example is from http://www.concentric.net/~Ttwang/tech/inthash.htm
220 // via. http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
221 uword a = static_cast<uword>(key);
222 a = (a + 0x7ed55d16) + (a << 12);
223 a = (a ^ 0xc761c23c) ^ (a >> 19);
224 a = (a + 0x165667b1) + (a << 5);
225 a = (a + 0xd3a2646c) ^ (a << 9);
226 a = (a + 0xfd7046c5) + (a << 3);
227 a = (a ^ 0xb55a4f09) ^ (a >> 16);
228 return static_cast<uint32_t>(a);
229}

The documentation for this class was generated from the following files: