Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
dart::bin::RetainedPointer< Target > Class Template Reference

#include <reference_counting.h>

Public Member Functions

 RetainedPointer ()
 
 RetainedPointer (ReferenceCounted< Target > *t)
 
 ~RetainedPointer ()
 
void set (ReferenceCounted< Target > *t)
 
Targetget () const
 

Detailed Description

template<class Target>
class dart::bin::RetainedPointer< Target >

Definition at line 142 of file reference_counting.h.

Constructor & Destructor Documentation

◆ RetainedPointer() [1/2]

template<class Target >
dart::bin::RetainedPointer< Target >::RetainedPointer ( )
inline

Definition at line 144 of file reference_counting.h.

144: target_(nullptr) {}

◆ RetainedPointer() [2/2]

template<class Target >
dart::bin::RetainedPointer< Target >::RetainedPointer ( ReferenceCounted< Target > *  t)
inlineexplicit

Definition at line 146 of file reference_counting.h.

146 : target_(t) {
147 if (target_ != nullptr) {
148 target_->Retain();
149 }
150 }

◆ ~RetainedPointer()

template<class Target >
dart::bin::RetainedPointer< Target >::~RetainedPointer ( )
inline

Definition at line 152 of file reference_counting.h.

152 {
153 if (target_ != nullptr) {
154 target_->Release();
155 }
156 }

Member Function Documentation

◆ get()

template<class Target >
Target * dart::bin::RetainedPointer< Target >::get ( ) const
inline

Definition at line 168 of file reference_counting.h.

168{ return static_cast<Target*>(target_); }

◆ set()

template<class Target >
void dart::bin::RetainedPointer< Target >::set ( ReferenceCounted< Target > *  t)
inline

Definition at line 158 of file reference_counting.h.

158 {
159 if (target_ != nullptr) {
160 target_->Release();
161 }
162 target_ = t;
163 if (target_ != nullptr) {
164 target_->Retain();
165 }
166 }

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