#ifndef Uint16Array_h
#define Uint16Array_h
#include "wtf/IntegralTypedArrayBase.h"
namespace WTF {
class ArrayBuffer;
class Uint16Array FINAL : public IntegralTypedArrayBase<unsigned short> {
public:
static inline PassRefPtr<Uint16Array> create(unsigned length);
static inline PassRefPtr<Uint16Array> create(const unsigned short* array, unsigned length);
static inline PassRefPtr<Uint16Array> create(PassRefPtr<ArrayBuffer>, unsigned byteOffset, unsigned length);
static inline PassRefPtr<Uint16Array> createUninitialized(unsigned length);
using TypedArrayBase<unsigned short>::set;
using IntegralTypedArrayBase<unsigned short>::set;
inline PassRefPtr<Uint16Array> subarray(int start) const;
inline PassRefPtr<Uint16Array> subarray(int start, int end) const;
virtual ViewType type() const OVERRIDE
{
return TypeUint16;
}
private:
inline Uint16Array(PassRefPtr<ArrayBuffer>,
unsigned byteOffset,
unsigned length);
friend class TypedArrayBase<unsigned short>;
};
PassRefPtr<Uint16Array> Uint16Array::create(unsigned length)
{
return TypedArrayBase<unsigned short>::create<Uint16Array>(length);
}
PassRefPtr<Uint16Array> Uint16Array::create(const unsigned short* array, unsigned length)
{
return TypedArrayBase<unsigned short>::create<Uint16Array>(array, length);
}
PassRefPtr<Uint16Array> Uint16Array::create(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length)
{
return TypedArrayBase<unsigned short>::create<Uint16Array>(buffer, byteOffset, length);
}
PassRefPtr<Uint16Array> Uint16Array::createUninitialized(unsigned length)
{
return TypedArrayBase<unsigned short>::createUninitialized<Uint16Array>(length);
}
Uint16Array::Uint16Array(PassRefPtr<ArrayBuffer> buffer, unsigned byteOffset, unsigned length)
: IntegralTypedArrayBase<unsigned short>(buffer, byteOffset, length)
{
}
PassRefPtr<Uint16Array> Uint16Array::subarray(int start) const
{
return subarray(start, length());
}
PassRefPtr<Uint16Array> Uint16Array::subarray(int start, int end) const
{
return subarrayImpl<Uint16Array>(start, end);
}
}
using WTF::Uint16Array;
#endif