Where Online Learning is simpler!
The C and C++ Include Header Files
/usr/include/node/v8-typed-array.h
$ cat -n /usr/include/node/v8-typed-array.h 1 // Copyright 2021 the V8 project authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef INCLUDE_V8_TYPED_ARRAY_H_ 6 #define INCLUDE_V8_TYPED_ARRAY_H_ 7 8 #include "v8-array-buffer.h" // NOLINT(build/include_directory) 9 #include "v8-local-handle.h" // NOLINT(build/include_directory) 10 #include "v8config.h" // NOLINT(build/include_directory) 11 12 namespace v8 { 13 14 class SharedArrayBuffer; 15 16 /** 17 * A base class for an instance of TypedArray series of constructors 18 * (ES6 draft 15.13.6). 19 */ 20 class V8_EXPORT TypedArray : public ArrayBufferView { 21 public: 22 /* 23 * The largest typed array size that can be constructed using New. 24 */ 25 static constexpr size_t kMaxLength = 26 internal::kApiSystemPointerSize == 4 27 ? internal::kSmiMaxValue 28 : static_cast
(uint64_t{1} << 32); 29 30 /** 31 * Number of elements in this typed array 32 * (e.g. for Int16Array, |ByteLength|/2). 33 */ 34 size_t Length(); 35 36 V8_INLINE static TypedArray* Cast(Value* value) { 37 #ifdef V8_ENABLE_CHECKS 38 CheckCast(value); 39 #endif 40 return static_cast
(value); 41 } 42 43 private: 44 TypedArray(); 45 static void CheckCast(Value* obj); 46 }; 47 48 /** 49 * An instance of Uint8Array constructor (ES6 draft 15.13.6). 50 */ 51 class V8_EXPORT Uint8Array : public TypedArray { 52 public: 53 static Local
New(Local
array_buffer, 54 size_t byte_offset, size_t length); 55 static Local
New(Local
shared_array_buffer, 56 size_t byte_offset, size_t length); 57 V8_INLINE static Uint8Array* Cast(Value* value) { 58 #ifdef V8_ENABLE_CHECKS 59 CheckCast(value); 60 #endif 61 return static_cast
(value); 62 } 63 64 private: 65 Uint8Array(); 66 static void CheckCast(Value* obj); 67 }; 68 69 /** 70 * An instance of Uint8ClampedArray constructor (ES6 draft 15.13.6). 71 */ 72 class V8_EXPORT Uint8ClampedArray : public TypedArray { 73 public: 74 static Local
New(Local
array_buffer, 75 size_t byte_offset, size_t length); 76 static Local
New( 77 Local
shared_array_buffer, size_t byte_offset, 78 size_t length); 79 V8_INLINE static Uint8ClampedArray* Cast(Value* value) { 80 #ifdef V8_ENABLE_CHECKS 81 CheckCast(value); 82 #endif 83 return static_cast
(value); 84 } 85 86 private: 87 Uint8ClampedArray(); 88 static void CheckCast(Value* obj); 89 }; 90 91 /** 92 * An instance of Int8Array constructor (ES6 draft 15.13.6). 93 */ 94 class V8_EXPORT Int8Array : public TypedArray { 95 public: 96 static Local
New(Local
array_buffer, 97 size_t byte_offset, size_t length); 98 static Local
New(Local
shared_array_buffer, 99 size_t byte_offset, size_t length); 100 V8_INLINE static Int8Array* Cast(Value* value) { 101 #ifdef V8_ENABLE_CHECKS 102 CheckCast(value); 103 #endif 104 return static_cast
(value); 105 } 106 107 private: 108 Int8Array(); 109 static void CheckCast(Value* obj); 110 }; 111 112 /** 113 * An instance of Uint16Array constructor (ES6 draft 15.13.6). 114 */ 115 class V8_EXPORT Uint16Array : public TypedArray { 116 public: 117 static Local
New(Local
array_buffer, 118 size_t byte_offset, size_t length); 119 static Local
New(Local
shared_array_buffer, 120 size_t byte_offset, size_t length); 121 V8_INLINE static Uint16Array* Cast(Value* value) { 122 #ifdef V8_ENABLE_CHECKS 123 CheckCast(value); 124 #endif 125 return static_cast
(value); 126 } 127 128 private: 129 Uint16Array(); 130 static void CheckCast(Value* obj); 131 }; 132 133 /** 134 * An instance of Int16Array constructor (ES6 draft 15.13.6). 135 */ 136 class V8_EXPORT Int16Array : public TypedArray { 137 public: 138 static Local
New(Local
array_buffer, 139 size_t byte_offset, size_t length); 140 static Local
New(Local
shared_array_buffer, 141 size_t byte_offset, size_t length); 142 V8_INLINE static Int16Array* Cast(Value* value) { 143 #ifdef V8_ENABLE_CHECKS 144 CheckCast(value); 145 #endif 146 return static_cast
(value); 147 } 148 149 private: 150 Int16Array(); 151 static void CheckCast(Value* obj); 152 }; 153 154 /** 155 * An instance of Uint32Array constructor (ES6 draft 15.13.6). 156 */ 157 class V8_EXPORT Uint32Array : public TypedArray { 158 public: 159 static Local
New(Local
array_buffer, 160 size_t byte_offset, size_t length); 161 static Local
New(Local
shared_array_buffer, 162 size_t byte_offset, size_t length); 163 V8_INLINE static Uint32Array* Cast(Value* value) { 164 #ifdef V8_ENABLE_CHECKS 165 CheckCast(value); 166 #endif 167 return static_cast
(value); 168 } 169 170 private: 171 Uint32Array(); 172 static void CheckCast(Value* obj); 173 }; 174 175 /** 176 * An instance of Int32Array constructor (ES6 draft 15.13.6). 177 */ 178 class V8_EXPORT Int32Array : public TypedArray { 179 public: 180 static Local
New(Local
array_buffer, 181 size_t byte_offset, size_t length); 182 static Local
New(Local
shared_array_buffer, 183 size_t byte_offset, size_t length); 184 V8_INLINE static Int32Array* Cast(Value* value) { 185 #ifdef V8_ENABLE_CHECKS 186 CheckCast(value); 187 #endif 188 return static_cast
(value); 189 } 190 191 private: 192 Int32Array(); 193 static void CheckCast(Value* obj); 194 }; 195 196 /** 197 * An instance of Float32Array constructor (ES6 draft 15.13.6). 198 */ 199 class V8_EXPORT Float32Array : public TypedArray { 200 public: 201 static Local
New(Local
array_buffer, 202 size_t byte_offset, size_t length); 203 static Local
New(Local
shared_array_buffer, 204 size_t byte_offset, size_t length); 205 V8_INLINE static Float32Array* Cast(Value* value) { 206 #ifdef V8_ENABLE_CHECKS 207 CheckCast(value); 208 #endif 209 return static_cast
(value); 210 } 211 212 private: 213 Float32Array(); 214 static void CheckCast(Value* obj); 215 }; 216 217 /** 218 * An instance of Float64Array constructor (ES6 draft 15.13.6). 219 */ 220 class V8_EXPORT Float64Array : public TypedArray { 221 public: 222 static Local
New(Local
array_buffer, 223 size_t byte_offset, size_t length); 224 static Local
New(Local
shared_array_buffer, 225 size_t byte_offset, size_t length); 226 V8_INLINE static Float64Array* Cast(Value* value) { 227 #ifdef V8_ENABLE_CHECKS 228 CheckCast(value); 229 #endif 230 return static_cast
(value); 231 } 232 233 private: 234 Float64Array(); 235 static void CheckCast(Value* obj); 236 }; 237 238 /** 239 * An instance of BigInt64Array constructor. 240 */ 241 class V8_EXPORT BigInt64Array : public TypedArray { 242 public: 243 static Local
New(Local
array_buffer, 244 size_t byte_offset, size_t length); 245 static Local
New(Local
shared_array_buffer, 246 size_t byte_offset, size_t length); 247 V8_INLINE static BigInt64Array* Cast(Value* value) { 248 #ifdef V8_ENABLE_CHECKS 249 CheckCast(value); 250 #endif 251 return static_cast
(value); 252 } 253 254 private: 255 BigInt64Array(); 256 static void CheckCast(Value* obj); 257 }; 258 259 /** 260 * An instance of BigUint64Array constructor. 261 */ 262 class V8_EXPORT BigUint64Array : public TypedArray { 263 public: 264 static Local
New(Local
array_buffer, 265 size_t byte_offset, size_t length); 266 static Local
New(Local
shared_array_buffer, 267 size_t byte_offset, size_t length); 268 V8_INLINE static BigUint64Array* Cast(Value* value) { 269 #ifdef V8_ENABLE_CHECKS 270 CheckCast(value); 271 #endif 272 return static_cast
(value); 273 } 274 275 private: 276 BigUint64Array(); 277 static void CheckCast(Value* obj); 278 }; 279 280 } // namespace v8 281 282 #endif // INCLUDE_V8_TYPED_ARRAY_H_
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2025 MyWebUniversity.com ™