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