proxygen
testing::internal::scoped_ptr< T > Class Template Reference

#include <gtest-port.h>

Public Types

typedef T element_type
 
typedef T element_type
 
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)
 
 scoped_ptr (T *p=NULL)
 
 ~scoped_ptr ()
 
Toperator* () const
 
Toperator-> () const
 
Tget () const
 
Trelease ()
 
void reset (T *p=NULL)
 
 scoped_ptr (T *p=NULL)
 
 ~scoped_ptr ()
 
Toperator* () const
 
Toperator-> () const
 
Tget () const
 
Trelease ()
 
void reset (T *p=NULL)
 

Private Member Functions

 scoped_ptr (scoped_ptr const &)
 
void operator= (scoped_ptr const &)
 
 scoped_ptr (scoped_ptr const &)
 
void operator= (scoped_ptr const &)
 
 scoped_ptr (scoped_ptr const &)
 
void operator= (scoped_ptr const &)
 

Private Attributes

Tptr_
 

Friends

void swap (scoped_ptr &a, scoped_ptr &b)
 
void swap (scoped_ptr &a, scoped_ptr &b)
 
void swap (scoped_ptr &a, scoped_ptr &b)
 

Detailed Description

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

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

Member Typedef Documentation

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

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

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

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

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

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

Constructor & Destructor Documentation

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

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

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

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

1120 { reset(); }
template<typename T>
testing::internal::scoped_ptr< T >::scoped_ptr ( scoped_ptr< T > const &  )
private
template<typename T>
testing::internal::scoped_ptr< T >::scoped_ptr ( T p = NULL)
inlineexplicit

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

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

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

1120 { reset(); }
template<typename T>
testing::internal::scoped_ptr< T >::scoped_ptr ( scoped_ptr< T > const &  )
private
template<typename T>
testing::internal::scoped_ptr< T >::scoped_ptr ( T p = NULL)
inlineexplicit

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

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

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

1120 { reset(); }
template<typename T>
testing::internal::scoped_ptr< T >::scoped_ptr ( scoped_ptr< T > const &  )
private

Member Function Documentation

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

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

1124 { return ptr_; }
template<typename T>
T* testing::internal::scoped_ptr< T >::get ( ) const
inline

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

1124 { return ptr_; }
template<typename T>
T& testing::internal::scoped_ptr< T >::operator* ( ) const
inline

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

1122 { return *ptr_; }
template<typename T>
T& testing::internal::scoped_ptr< T >::operator* ( ) const
inline

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

1122 { return *ptr_; }
template<typename T>
T& testing::internal::scoped_ptr< T >::operator* ( ) const
inline

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

1122 { return *ptr_; }
template<typename T>
T* testing::internal::scoped_ptr< T >::operator-> ( ) const
inline

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

1123 { return ptr_; }
template<typename T>
T* testing::internal::scoped_ptr< T >::operator-> ( ) const
inline

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

1123 { return ptr_; }
template<typename T>
T* testing::internal::scoped_ptr< T >::operator-> ( ) const
inline

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

1123 { return ptr_; }
template<typename T>
void testing::internal::scoped_ptr< T >::operator= ( scoped_ptr< T > const &  )
private
template<typename T>
void testing::internal::scoped_ptr< T >::operator= ( scoped_ptr< T > const &  )
private
template<typename T>
void testing::internal::scoped_ptr< T >::operator= ( scoped_ptr< T > const &  )
private
template<typename T>
T* testing::internal::scoped_ptr< T >::release ( )
inline

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

1126  {
1127  T* const ptr = ptr_;
1128  ptr_ = NULL;
1129  return ptr;
1130  }
void * ptr
#define T(v)
Definition: http_parser.c:233
template<typename T>
T* testing::internal::scoped_ptr< T >::release ( )
inline

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

1126  {
1127  T* const ptr = ptr_;
1128  ptr_ = NULL;
1129  return ptr;
1130  }
void * ptr
#define T(v)
Definition: http_parser.c:233
template<typename T>
T* testing::internal::scoped_ptr< T >::release ( )
inline

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

1126  {
1127  T* const ptr = ptr_;
1128  ptr_ = NULL;
1129  return ptr;
1130  }
void * ptr
#define T(v)
Definition: http_parser.c:233
template<typename T>
void testing::internal::scoped_ptr< T >::reset ( T p = NULL)
inline

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

1132  {
1133  if (p != ptr_) {
1134  if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
1135  delete ptr_;
1136  }
1137  ptr_ = p;
1138  }
1139  }
bool IsTrue(bool condition)
Definition: gtest.cc:4986
#define T(v)
Definition: http_parser.c:233
template<typename T>
void testing::internal::scoped_ptr< T >::reset ( T p = NULL)
inline

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

Referenced by testing::internal::NoDefaultContructor::NoDefaultContructor(), and testing::internal::TEST().

1132  {
1133  if (p != ptr_) {
1134  if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
1135  delete ptr_;
1136  }
1137  ptr_ = p;
1138  }
1139  }
bool IsTrue(bool condition)
Definition: gtest.cc:4986
#define T(v)
Definition: http_parser.c:233
template<typename T>
void testing::internal::scoped_ptr< T >::reset ( T p = NULL)
inline

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

1132  {
1133  if (p != ptr_) {
1134  if (IsTrue(sizeof(T) > 0)) { // Makes sure T is a complete type.
1135  delete ptr_;
1136  }
1137  ptr_ = p;
1138  }
1139  }
bool IsTrue(bool condition)
Definition: gtest.cc:4986
#define T(v)
Definition: http_parser.c:233

Friends And Related Function Documentation

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

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

1141  {
1142  using std::swap;
1143  swap(a.ptr_, b.ptr_);
1144  }
char b
friend void swap(scoped_ptr &a, scoped_ptr &b)
Definition: gtest-port.h:1141
char a
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
Definition: F14TestUtil.h:414
template<typename T>
void swap ( scoped_ptr< T > &  a,
scoped_ptr< T > &  b 
)
friend

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

1141  {
1142  using std::swap;
1143  swap(a.ptr_, b.ptr_);
1144  }
char b
friend void swap(scoped_ptr &a, scoped_ptr &b)
Definition: gtest-port.h:1141
char a
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
Definition: F14TestUtil.h:414
template<typename T>
void swap ( scoped_ptr< T > &  a,
scoped_ptr< T > &  b 
)
friend

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

1141  {
1142  using std::swap;
1143  swap(a.ptr_, b.ptr_);
1144  }
char b
friend void swap(scoped_ptr &a, scoped_ptr &b)
Definition: gtest-port.h:1141
char a
void swap(SwapTrackingAlloc< T > &, SwapTrackingAlloc< T > &)
Definition: F14TestUtil.h:414

Member Data Documentation

template<typename T>
T * testing::internal::scoped_ptr< T >::ptr_
private

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


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