Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
testing::internal::scoped_ptr< T > Class Template Reference

#include <gtest-port.h>

Public Types

typedef T element_type
 

Public Member Functions

 scoped_ptr (T *p=NULL)
 
 ~scoped_ptr ()
 
Toperator* () const
 
Toperator-> () const
 
Tget () const
 
Trelease ()
 
void reset (T *p=NULL)
 

Friends

void swap (scoped_ptr &a, scoped_ptr &b)
 

Detailed Description

template<typename T>
class testing::internal::scoped_ptr< T >

Definition at line 1181 of file gtest-port.h.

Member Typedef Documentation

◆ element_type

template<typename T >
T testing::internal::scoped_ptr< T >::element_type

Definition at line 1183 of file gtest-port.h.

Constructor & Destructor Documentation

◆ scoped_ptr()

template<typename T >
testing::internal::scoped_ptr< T >::scoped_ptr ( T * p = NULL)
inlineexplicit

Definition at line 1185 of file gtest-port.h.

1185: ptr_(p) {}
const mie::Vuint & p
Definition bn.cpp:27

◆ ~scoped_ptr()

template<typename T >
testing::internal::scoped_ptr< T >::~scoped_ptr ( )
inline

Definition at line 1186 of file gtest-port.h.

1186{ reset(); }
Here is the call graph for this function:

Member Function Documentation

◆ get()

template<typename T >
T * testing::internal::scoped_ptr< T >::get ( ) const
inline

Definition at line 1190 of file gtest-port.h.

1190{ return ptr_; }
Here is the caller graph for this function:

◆ operator*()

template<typename T >
T & testing::internal::scoped_ptr< T >::operator* ( ) const
inline

Definition at line 1188 of file gtest-port.h.

1188{ return *ptr_; }

◆ operator->()

template<typename T >
T * testing::internal::scoped_ptr< T >::operator-> ( ) const
inline

Definition at line 1189 of file gtest-port.h.

1189{ return ptr_; }

◆ release()

template<typename T >
T * testing::internal::scoped_ptr< T >::release ( )
inline

Definition at line 1192 of file gtest-port.h.

1192 {
1193 T* const ptr = ptr_;
1194 ptr_ = NULL;
1195 return ptr;
1196 }
#define T(meth, val, expected)

◆ reset()

template<typename T >
void testing::internal::scoped_ptr< T >::reset ( T * p = NULL)
inline

Definition at line 1198 of file gtest-port.h.

1198 {
1199 if (p != ptr_) {
1200 if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
1201 delete ptr_;
1202 }
1203 ptr_ = p;
1204 }
1205 }
GTEST_API_ bool IsTrue(bool condition)
Definition gtest.cc:5404
Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Symbol Documentation

◆ swap

template<typename T >
void swap ( scoped_ptr< T > & a,
scoped_ptr< T > & b )
friend

Definition at line 1207 of file gtest-port.h.

1207 {
1208 using std::swap;
1209 swap(a.ptr_, b.ptr_);
1210 }
friend void swap(scoped_ptr &a, scoped_ptr &b)
void swap(picojson::value &x, picojson::value &y)
const GenericPointer< typename T::ValueType > T2 T::AllocatorType & a
Definition pointer.h:1181

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