proxygen
DataState< Vector > Class Template Reference

Public Member Functions

 DataState (const Vector &v)
 
 ~DataState ()
 
bool operator== (const DataState &o) const
 
int operator[] (size_type i)
 
size_type size ()
 

Private Types

typedef Vector::size_type size_type
 

Private Attributes

size_type size_
 
int * data_
 

Detailed Description

template<class Vector>
class DataState< Vector >

Definition at line 1545 of file StlVectorTest.cpp.

Member Typedef Documentation

template<class Vector>
typedef Vector::size_type DataState< Vector >::size_type
private

Definition at line 1546 of file StlVectorTest.cpp.

Constructor & Destructor Documentation

template<class Vector>
DataState< Vector >::DataState ( const Vector &  v)
inline

Definition at line 1551 of file StlVectorTest.cpp.

References convertToInt(), and i.

1551  {
1552  size_ = v.size();
1553  if (size_ != 0) {
1554  data_ = new int[size_];
1555  for (size_type i = 0; i < size_; ++i) {
1556  data_[i] = convertToInt(v.data()[i]);
1557  }
1558  } else {
1559  data_ = nullptr;
1560  }
1561  }
size_type size_
Vector::size_type size_type
int convertToInt(int t)
template<class Vector>
DataState< Vector >::~DataState ( )
inline

Definition at line 1562 of file StlVectorTest.cpp.

References data_.

1562  {
1563  delete[] data_;
1564  }

Member Function Documentation

template<class Vector>
bool DataState< Vector >::operator== ( const DataState< Vector > &  o) const
inline

Definition at line 1566 of file StlVectorTest.cpp.

References DataState< Vector >::data_, i, and DataState< Vector >::size_.

1566  {
1567  if (size_ != o.size_) {
1568  return false;
1569  }
1570  for (size_type i = 0; i < size_; ++i) {
1571  if (data_[i] != o.data_[i]) {
1572  return false;
1573  }
1574  }
1575  return true;
1576  }
size_type size_
Vector::size_type size_type
template<class Vector>
int DataState< Vector >::operator[] ( size_type  i)
inline

Definition at line 1578 of file StlVectorTest.cpp.

References i.

1578  {
1579  if (i >= size_) {
1580  cerr << "trying to access DataState out of bounds" << endl;
1581  exit(1);
1582  }
1583  return data_[i];
1584  }
size_type size_
template<class Vector>
size_type DataState< Vector >::size ( )
inline

Definition at line 1586 of file StlVectorTest.cpp.

Referenced by eraseCheck(), insertItCheck(), insertNTCheck(), test_I_emplaceBack3(), test_popBack3(), test_pushBack3(), and test_pushBackRV3().

1586  {
1587  return size_;
1588  }
size_type size_

Member Data Documentation

template<class Vector>
int* DataState< Vector >::data_
private

Definition at line 1548 of file StlVectorTest.cpp.

Referenced by DataState< Vector >::operator==().

template<class Vector>
size_type DataState< Vector >::size_
private

Definition at line 1547 of file StlVectorTest.cpp.

Referenced by DataState< Vector >::operator==().


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