proxygen
testing::internal::NativeArray< Element > Class Template Reference

#include <gtest-internal.h>

Public Types

typedef Element value_type
 
typedef Element * iterator
 
typedef const Element * const_iterator
 
typedef Element value_type
 
typedef Element * iterator
 
typedef const Element * const_iterator
 
typedef Element value_type
 
typedef Element * iterator
 
typedef const Element * const_iterator
 

Public Member Functions

 NativeArray (const Element *array, size_t count, RelationToSourceReference)
 
 NativeArray (const Element *array, size_t count, RelationToSourceCopy)
 
 NativeArray (const NativeArray &rhs)
 
 ~NativeArray ()
 
size_t size () const
 
const_iterator begin () const
 
const_iterator end () const
 
bool operator== (const NativeArray &rhs) const
 
 NativeArray (const Element *array, size_t count, RelationToSourceReference)
 
 NativeArray (const Element *array, size_t count, RelationToSourceCopy)
 
 NativeArray (const NativeArray &rhs)
 
 ~NativeArray ()
 
size_t size () const
 
const_iterator begin () const
 
const_iterator end () const
 
bool operator== (const NativeArray &rhs) const
 
 NativeArray (const Element *array, size_t count, RelationToSourceReference)
 
 NativeArray (const Element *array, size_t count, RelationToSourceCopy)
 
 NativeArray (const NativeArray &rhs)
 
 ~NativeArray ()
 
size_t size () const
 
const_iterator begin () const
 
const_iterator end () const
 
bool operator== (const NativeArray &rhs) const
 

Private Types

enum  { kCheckTypeIsNotConstOrAReference }
 
enum  { kCheckTypeIsNotConstOrAReference }
 
enum  { kCheckTypeIsNotConstOrAReference }
 

Private Member Functions

void InitCopy (const Element *array, size_t a_size)
 
void InitRef (const Element *array, size_t a_size)
 
 GTEST_DISALLOW_ASSIGN_ (NativeArray)
 
void InitCopy (const Element *array, size_t a_size)
 
void InitRef (const Element *array, size_t a_size)
 
 GTEST_DISALLOW_ASSIGN_ (NativeArray)
 
void InitCopy (const Element *array, size_t a_size)
 
void InitRef (const Element *array, size_t a_size)
 
 GTEST_DISALLOW_ASSIGN_ (NativeArray)
 

Private Attributes

const Element * array_
 
size_t size_
 
void(NativeArray::* clone_ )(const Element *, size_t)
 

Detailed Description

template<typename Element>
class testing::internal::NativeArray< Element >

Definition at line 1034 of file gtest-internal.h.

Member Typedef Documentation

template<typename Element>
typedef const Element* testing::internal::NativeArray< Element >::const_iterator

Definition at line 1039 of file gtest-internal.h.

template<typename Element>
typedef const Element* testing::internal::NativeArray< Element >::const_iterator

Definition at line 1039 of file gtest-internal.h.

template<typename Element>
typedef const Element* testing::internal::NativeArray< Element >::const_iterator

Definition at line 1039 of file gtest-internal.h.

template<typename Element>
typedef Element* testing::internal::NativeArray< Element >::iterator

Definition at line 1038 of file gtest-internal.h.

template<typename Element>
typedef Element* testing::internal::NativeArray< Element >::iterator

Definition at line 1038 of file gtest-internal.h.

template<typename Element>
typedef Element* testing::internal::NativeArray< Element >::iterator

Definition at line 1038 of file gtest-internal.h.

template<typename Element>
typedef Element testing::internal::NativeArray< Element >::value_type

Definition at line 1037 of file gtest-internal.h.

template<typename Element>
typedef Element testing::internal::NativeArray< Element >::value_type

Definition at line 1037 of file gtest-internal.h.

template<typename Element>
typedef Element testing::internal::NativeArray< Element >::value_type

Definition at line 1037 of file gtest-internal.h.

Member Enumeration Documentation

template<typename Element>
anonymous enum
private
Enumerator
kCheckTypeIsNotConstOrAReference 

Definition at line 1071 of file gtest-internal.h.

1071  {
1072  kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
1073  Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value,
1074  };
static const char *const value
Definition: Conv.cpp:50
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)
template<typename Element>
anonymous enum
private
Enumerator
kCheckTypeIsNotConstOrAReference 

Definition at line 1071 of file gtest-internal.h.

1071  {
1072  kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
1073  Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value,
1074  };
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)
static const char *const value
Definition: Conv.cpp:50
template<typename Element>
anonymous enum
private
Enumerator
kCheckTypeIsNotConstOrAReference 

Definition at line 1071 of file gtest-internal.h.

1071  {
1072  kCheckTypeIsNotConstOrAReference = StaticAssertTypeEqHelper<
1073  Element, GTEST_REMOVE_REFERENCE_AND_CONST_(Element)>::value,
1074  };
static const char *const value
Definition: Conv.cpp:50
#define GTEST_REMOVE_REFERENCE_AND_CONST_(T)

Constructor & Destructor Documentation

template<typename Element>
testing::internal::NativeArray< Element >::NativeArray ( const Element *  array,
size_t  count,
RelationToSourceReference   
)
inline

Definition at line 1042 of file gtest-internal.h.

1042  {
1043  InitRef(array, count);
1044  }
void InitRef(const Element *array, size_t a_size)
int * count
template<typename Element>
testing::internal::NativeArray< Element >::NativeArray ( const Element *  array,
size_t  count,
RelationToSourceCopy   
)
inline

Definition at line 1047 of file gtest-internal.h.

1047  {
1048  InitCopy(array, count);
1049  }
int * count
void InitCopy(const Element *array, size_t a_size)
template<typename Element>
testing::internal::NativeArray< Element >::NativeArray ( const NativeArray< Element > &  rhs)
inline

Definition at line 1052 of file gtest-internal.h.

References testing::internal::NativeArray< Element >::array_, testing::internal::NativeArray< Element >::clone_, and testing::internal::NativeArray< Element >::size_.

1052  {
1053  (this->*rhs.clone_)(rhs.array_, rhs.size_);
1054  }
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
template<typename Element>
testing::internal::NativeArray< Element >::~NativeArray ( )
inline

Definition at line 1056 of file gtest-internal.h.

1056  {
1057  if (clone_ != &NativeArray::InitRef)
1058  delete[] array_;
1059  }
void InitRef(const Element *array, size_t a_size)
void(NativeArray::* clone_)(const Element *, size_t)
template<typename Element>
testing::internal::NativeArray< Element >::NativeArray ( const Element *  array,
size_t  count,
RelationToSourceReference   
)
inline

Definition at line 1042 of file gtest-internal.h.

1042  {
1043  InitRef(array, count);
1044  }
void InitRef(const Element *array, size_t a_size)
int * count
template<typename Element>
testing::internal::NativeArray< Element >::NativeArray ( const Element *  array,
size_t  count,
RelationToSourceCopy   
)
inline

Definition at line 1047 of file gtest-internal.h.

1047  {
1048  InitCopy(array, count);
1049  }
int * count
void InitCopy(const Element *array, size_t a_size)
template<typename Element>
testing::internal::NativeArray< Element >::NativeArray ( const NativeArray< Element > &  rhs)
inline

Definition at line 1052 of file gtest-internal.h.

References testing::internal::NativeArray< Element >::array_, testing::internal::NativeArray< Element >::clone_, and testing::internal::NativeArray< Element >::size_.

1052  {
1053  (this->*rhs.clone_)(rhs.array_, rhs.size_);
1054  }
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
template<typename Element>
testing::internal::NativeArray< Element >::~NativeArray ( )
inline

Definition at line 1056 of file gtest-internal.h.

1056  {
1057  if (clone_ != &NativeArray::InitRef)
1058  delete[] array_;
1059  }
void InitRef(const Element *array, size_t a_size)
void(NativeArray::* clone_)(const Element *, size_t)
template<typename Element>
testing::internal::NativeArray< Element >::NativeArray ( const Element *  array,
size_t  count,
RelationToSourceReference   
)
inline

Definition at line 1042 of file gtest-internal.h.

1042  {
1043  InitRef(array, count);
1044  }
void InitRef(const Element *array, size_t a_size)
int * count
template<typename Element>
testing::internal::NativeArray< Element >::NativeArray ( const Element *  array,
size_t  count,
RelationToSourceCopy   
)
inline

Definition at line 1047 of file gtest-internal.h.

1047  {
1048  InitCopy(array, count);
1049  }
int * count
void InitCopy(const Element *array, size_t a_size)
template<typename Element>
testing::internal::NativeArray< Element >::NativeArray ( const NativeArray< Element > &  rhs)
inline

Definition at line 1052 of file gtest-internal.h.

References testing::internal::NativeArray< Element >::array_, testing::internal::NativeArray< Element >::clone_, and testing::internal::NativeArray< Element >::size_.

1052  {
1053  (this->*rhs.clone_)(rhs.array_, rhs.size_);
1054  }
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
template<typename Element>
testing::internal::NativeArray< Element >::~NativeArray ( )
inline

Definition at line 1056 of file gtest-internal.h.

1056  {
1057  if (clone_ != &NativeArray::InitRef)
1058  delete[] array_;
1059  }
void InitRef(const Element *array, size_t a_size)
void(NativeArray::* clone_)(const Element *, size_t)

Member Function Documentation

template<typename Element>
const_iterator testing::internal::NativeArray< Element >::begin ( ) const
inline

Definition at line 1063 of file gtest-internal.h.

Referenced by testing::internal::NativeArray< Element >::operator==(), and TEST().

1063 { return array_; }
template<typename Element>
const_iterator testing::internal::NativeArray< Element >::begin ( ) const
inline

Definition at line 1063 of file gtest-internal.h.

1063 { return array_; }
template<typename Element>
const_iterator testing::internal::NativeArray< Element >::begin ( ) const
inline

Definition at line 1063 of file gtest-internal.h.

1063 { return array_; }
template<typename Element>
const_iterator testing::internal::NativeArray< Element >::end ( ) const
inline

Definition at line 1064 of file gtest-internal.h.

template<typename Element>
const_iterator testing::internal::NativeArray< Element >::end ( ) const
inline

Definition at line 1064 of file gtest-internal.h.

template<typename Element>
const_iterator testing::internal::NativeArray< Element >::end ( ) const
inline

Definition at line 1064 of file gtest-internal.h.

Referenced by TEST().

template<typename Element>
testing::internal::NativeArray< Element >::GTEST_DISALLOW_ASSIGN_ ( NativeArray< Element >  )
private
template<typename Element>
testing::internal::NativeArray< Element >::GTEST_DISALLOW_ASSIGN_ ( NativeArray< Element >  )
private
template<typename Element>
testing::internal::NativeArray< Element >::GTEST_DISALLOW_ASSIGN_ ( NativeArray< Element >  )
private
template<typename Element>
void testing::internal::NativeArray< Element >::InitCopy ( const Element *  array,
size_t  a_size 
)
inlineprivate

Definition at line 1077 of file gtest-internal.h.

References folly::copy(), and testing::internal::CopyArray().

1077  {
1078  Element* const copy = new Element[a_size];
1079  CopyArray(array, a_size, copy);
1080  array_ = copy;
1081  size_ = a_size;
1083  }
void(NativeArray::* clone_)(const Element *, size_t)
constexpr std::decay< T >::type copy(T &&value) noexcept(noexcept(typename std::decay< T >::type(std::forward< T >(value))))
Definition: Utility.h:72
void InitCopy(const Element *array, size_t a_size)
void CopyArray(const T *from, size_t size, U *to)
template<typename Element>
void testing::internal::NativeArray< Element >::InitCopy ( const Element *  array,
size_t  a_size 
)
inlineprivate

Definition at line 1077 of file gtest-internal.h.

References folly::copy(), and testing::internal::CopyArray().

1077  {
1078  Element* const copy = new Element[a_size];
1079  CopyArray(array, a_size, copy);
1080  array_ = copy;
1081  size_ = a_size;
1083  }
void(NativeArray::* clone_)(const Element *, size_t)
constexpr std::decay< T >::type copy(T &&value) noexcept(noexcept(typename std::decay< T >::type(std::forward< T >(value))))
Definition: Utility.h:72
void InitCopy(const Element *array, size_t a_size)
void CopyArray(const T *from, size_t size, U *to)
template<typename Element>
void testing::internal::NativeArray< Element >::InitCopy ( const Element *  array,
size_t  a_size 
)
inlineprivate

Definition at line 1077 of file gtest-internal.h.

References folly::copy(), and testing::internal::CopyArray().

1077  {
1078  Element* const copy = new Element[a_size];
1079  CopyArray(array, a_size, copy);
1080  array_ = copy;
1081  size_ = a_size;
1083  }
void(NativeArray::* clone_)(const Element *, size_t)
constexpr std::decay< T >::type copy(T &&value) noexcept(noexcept(typename std::decay< T >::type(std::forward< T >(value))))
Definition: Utility.h:72
void InitCopy(const Element *array, size_t a_size)
void CopyArray(const T *from, size_t size, U *to)
template<typename Element>
void testing::internal::NativeArray< Element >::InitRef ( const Element *  array,
size_t  a_size 
)
inlineprivate

Definition at line 1086 of file gtest-internal.h.

References GTEST_DISALLOW_ASSIGN_.

1086  {
1087  array_ = array;
1088  size_ = a_size;
1090  }
void InitRef(const Element *array, size_t a_size)
void(NativeArray::* clone_)(const Element *, size_t)
template<typename Element>
void testing::internal::NativeArray< Element >::InitRef ( const Element *  array,
size_t  a_size 
)
inlineprivate

Definition at line 1086 of file gtest-internal.h.

References GTEST_DISALLOW_ASSIGN_.

1086  {
1087  array_ = array;
1088  size_ = a_size;
1090  }
void InitRef(const Element *array, size_t a_size)
void(NativeArray::* clone_)(const Element *, size_t)
template<typename Element>
void testing::internal::NativeArray< Element >::InitRef ( const Element *  array,
size_t  a_size 
)
inlineprivate

Definition at line 1086 of file gtest-internal.h.

1086  {
1087  array_ = array;
1088  size_ = a_size;
1090  }
void InitRef(const Element *array, size_t a_size)
void(NativeArray::* clone_)(const Element *, size_t)
template<typename Element>
bool testing::internal::NativeArray< Element >::operator== ( const NativeArray< Element > &  rhs) const
inline

Definition at line 1065 of file gtest-internal.h.

References testing::internal::ArrayEq(), folly::test::begin(), testing::internal::NativeArray< Element >::begin(), folly::size(), and testing::internal::NativeArray< Element >::size().

1065  {
1066  return size() == rhs.size() &&
1067  ArrayEq(begin(), size(), rhs.begin());
1068  }
const_iterator begin() const
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
bool ArrayEq(const T *lhs, size_t size, const U *rhs)
template<typename Element>
bool testing::internal::NativeArray< Element >::operator== ( const NativeArray< Element > &  rhs) const
inline

Definition at line 1065 of file gtest-internal.h.

References testing::internal::ArrayEq(), folly::test::begin(), testing::internal::NativeArray< Element >::begin(), GTEST_REMOVE_REFERENCE_AND_CONST_, folly::size(), testing::internal::NativeArray< Element >::size(), and value.

1065  {
1066  return size() == rhs.size() &&
1067  ArrayEq(begin(), size(), rhs.begin());
1068  }
const_iterator begin() const
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
bool ArrayEq(const T *lhs, size_t size, const U *rhs)
template<typename Element>
bool testing::internal::NativeArray< Element >::operator== ( const NativeArray< Element > &  rhs) const
inline

Definition at line 1065 of file gtest-internal.h.

References testing::internal::ArrayEq(), folly::test::begin(), testing::internal::NativeArray< Element >::begin(), GTEST_REMOVE_REFERENCE_AND_CONST_, folly::size(), testing::internal::NativeArray< Element >::size(), and value.

1065  {
1066  return size() == rhs.size() &&
1067  ArrayEq(begin(), size(), rhs.begin());
1068  }
const_iterator begin() const
FOLLY_PUSH_WARNING RHS rhs
Definition: Traits.h:649
bool ArrayEq(const T *lhs, size_t size, const U *rhs)
template<typename Element>
size_t testing::internal::NativeArray< Element >::size ( ) const
inline

Definition at line 1062 of file gtest-internal.h.

Referenced by testing::internal::NativeArray< Element >::operator==(), and TEST().

1062 { return size_; }
template<typename Element>
size_t testing::internal::NativeArray< Element >::size ( ) const
inline

Definition at line 1062 of file gtest-internal.h.

1062 { return size_; }
template<typename Element>
size_t testing::internal::NativeArray< Element >::size ( ) const
inline

Definition at line 1062 of file gtest-internal.h.

1062 { return size_; }

Member Data Documentation

template<typename Element>
const Element * testing::internal::NativeArray< Element >::array_
private
template<typename Element>
void(NativeArray::* testing::internal::NativeArray< Element >::clone_)(const Element *, size_t)
private
template<typename Element>
size_t testing::internal::NativeArray< Element >::size_
private

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