Flutter Engine
The Flutter Engine
Public Member Functions | Friends | List of all members
tonic::DartList Class Reference

#include <dart_list.h>

Public Member Functions

 DartList (DartList &&other)
 
void Set (size_t index, Dart_Handle value)
 
Dart_Handle Get (size_t index)
 
template<class T >
void Set (size_t index, T value)
 
template<class T >
T Get (size_t index)
 
Dart_Handle dart_handle () const
 
size_t size () const
 
bool is_valid () const
 
 operator bool () const
 

Friends

struct DartConverter< DartList >
 

Detailed Description

Definition at line 15 of file dart_list.h.

Constructor & Destructor Documentation

◆ DartList()

tonic::DartList::DartList ( DartList &&  other)

Definition at line 25 of file dart_list.cc.

26 : dart_handle_(other.dart_handle_),
27 size_(other.size_),
28 is_valid_(other.is_valid_) {
29 other.dart_handle_ = nullptr;
30 other.size_ = 0;
31 other.is_valid_ = false;
32}

Member Function Documentation

◆ dart_handle()

Dart_Handle tonic::DartList::dart_handle ( ) const
inline

Definition at line 32 of file dart_list.h.

32{ return dart_handle_; }

◆ Get() [1/2]

Dart_Handle tonic::DartList::Get ( size_t  index)

◆ Get() [2/2]

template<class T >
T tonic::DartList::Get ( size_t  index)
inline

Definition at line 28 of file dart_list.h.

28 {
29 return DartConverter<T>::FromDart(Get(index));
30 }
Dart_Handle Get(size_t index)

◆ is_valid()

bool tonic::DartList::is_valid ( ) const
inline

Definition at line 34 of file dart_list.h.

34{ return is_valid_; }

◆ operator bool()

tonic::DartList::operator bool ( ) const
inlineexplicit

Definition at line 36 of file dart_list.h.

36{ return is_valid_; }

◆ Set() [1/2]

void tonic::DartList::Set ( size_t  index,
Dart_Handle  value 
)

Definition at line 34 of file dart_list.cc.

34 {
35 CheckAndHandleError(Dart_ListSetAt(dart_handle_, index, value));
36}
DART_EXPORT Dart_Handle Dart_ListSetAt(Dart_Handle list, intptr_t index, Dart_Handle value)
uint8_t value
bool CheckAndHandleError(Dart_Handle handle)
Definition: dart_error.cc:33

◆ Set() [2/2]

template<class T >
void tonic::DartList::Set ( size_t  index,
T  value 
)
inline

Definition at line 23 of file dart_list.h.

23 {
25 }
void Set(size_t index, Dart_Handle value)
Definition: dart_list.cc:34
Dart_Handle ToDart(const T &object)

◆ size()

size_t tonic::DartList::size ( ) const
inline

Definition at line 33 of file dart_list.h.

33{ return size_; }

Friends And Related Function Documentation

◆ DartConverter< DartList >

friend struct DartConverter< DartList >
friend

Definition at line 39 of file dart_list.h.


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