Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Attributes | List of all members
skjson::VectorValue< T, vtype > Class Template Reference

#include <SkJSON.h>

Inheritance diagram for skjson::VectorValue< T, vtype >:
skjson::Value

Public Types

using ValueT = T
 
- Public Types inherited from skjson::Value
enum class  Type {
  kNull , kBool , kNumber , kString ,
  kArray , kObject
}
 

Public Member Functions

size_t size () const
 
const Tbegin () const
 
const Tend () const
 
const Toperator[] (size_t i) const
 
- Public Member Functions inherited from skjson::Value
Type getType () const
 
template<typename T >
bool is () const
 
template<typename T >
const Tas () const
 
template<typename T >
 operator const T * () const
 
SkString toString () const
 
const Valueoperator[] (const char *key) const
 

Static Public Attributes

static constexpr Type kType = vtype
 

Additional Inherited Members

- Protected Types inherited from skjson::Value
enum class  Tag : uint8_t {
  kShortString = 0b00000000 , kNull = 0b00000001 , kBool = 0b00000010 , kInt = 0b00000011 ,
  kFloat = 0b00000100 , kString = 0b00000101 , kArray = 0b00000110 , kObject = 0b00000111
}
 
- Protected Member Functions inherited from skjson::Value
void init_tagged (Tag)
 
void init_tagged_pointer (Tag, void *)
 
Tag getTag () const
 
template<typename T >
const Tcast () const
 
template<typename T >
Tcast ()
 
template<typename T >
const Tptr () const
 
- Static Protected Attributes inherited from skjson::Value
static constexpr uint8_t kTagMask = 0b00000111
 

Detailed Description

template<typename T, Value::Type vtype>
class skjson::VectorValue< T, vtype >

Definition at line 257 of file SkJSON.h.

Member Typedef Documentation

◆ ValueT

template<typename T , Value::Type vtype>
using skjson::VectorValue< T, vtype >::ValueT = T

Definition at line 259 of file SkJSON.h.

Member Function Documentation

◆ begin()

template<typename T , Value::Type vtype>
const T * skjson::VectorValue< T, vtype >::begin ( ) const
inline

Definition at line 267 of file SkJSON.h.

267 {
268 SkASSERT(this->getType() == kType);
269 const auto* size_ptr = this->ptr<size_t>();
270 return reinterpret_cast<const T*>(size_ptr + 1);
271 }
#define SkASSERT(cond)
Definition SkAssert.h:116
Type getType() const
Definition SkJSON.h:371
static constexpr Type kType
Definition SkJSON.h:260
#define T

◆ end()

template<typename T , Value::Type vtype>
const T * skjson::VectorValue< T, vtype >::end ( ) const
inline

Definition at line 273 of file SkJSON.h.

273 {
274 SkASSERT(this->getType() == kType);
275 const auto* size_ptr = this->ptr<size_t>();
276 return reinterpret_cast<const T*>(size_ptr + 1) + *size_ptr;
277 }

◆ operator[]()

template<typename T , Value::Type vtype>
const T & skjson::VectorValue< T, vtype >::operator[] ( size_t  i) const
inline

Definition at line 279 of file SkJSON.h.

279 {
280 SkASSERT(this->getType() == kType);
281 SkASSERT(i < this->size());
282
283 return *(this->begin() + i);
284 }
const T * begin() const
Definition SkJSON.h:267
size_t size() const
Definition SkJSON.h:262

◆ size()

template<typename T , Value::Type vtype>
size_t skjson::VectorValue< T, vtype >::size ( ) const
inline

Definition at line 262 of file SkJSON.h.

262 {
263 SkASSERT(this->getType() == kType);
264 return *this->ptr<size_t>();
265 }

Member Data Documentation

◆ kType

template<typename T , Value::Type vtype>
constexpr Type skjson::VectorValue< T, vtype >::kType = vtype
inlinestaticconstexpr

Definition at line 260 of file SkJSON.h.


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