proxygen
CopyMoveTracker Class Reference

Classes

struct  ConstructorTag
 

Public Member Functions

 CopyMoveTracker ()=delete
 
 CopyMoveTracker (ConstructorTag)
 
 CopyMoveTracker (CopyMoveTracker const &o) noexcept
 
CopyMoveTrackeroperator= (CopyMoveTracker const &o) noexcept
 
 CopyMoveTracker (CopyMoveTracker &&o) noexcept
 
CopyMoveTrackeroperator= (CopyMoveTracker &&o) noexcept
 
size_t copyCount () const
 
size_t moveCount () const
 
size_t refCount () const
 
void resetCounters ()
 

Private Attributes

std::shared_ptr< std::pair< size_t, size_t > > data_
 

Detailed Description

Definition at line 553 of file FunctionTest.cpp.

Constructor & Destructor Documentation

CopyMoveTracker::CopyMoveTracker ( )
delete
CopyMoveTracker::CopyMoveTracker ( ConstructorTag  )
inlineexplicit

Definition at line 558 of file FunctionTest.cpp.

559  : data_(std::make_shared<std::pair<size_t, size_t>>(0, 0)) {}
std::shared_ptr< std::pair< size_t, size_t > > data_
CopyMoveTracker::CopyMoveTracker ( CopyMoveTracker const &  o)
inlinenoexcept

Definition at line 561 of file FunctionTest.cpp.

References data_.

561  : data_(o.data_) {
562  ++data_->first;
563  }
std::shared_ptr< std::pair< size_t, size_t > > data_
CopyMoveTracker::CopyMoveTracker ( CopyMoveTracker &&  o)
inlinenoexcept

Definition at line 570 of file FunctionTest.cpp.

570  : data_(o.data_) {
571  ++data_->second;
572  }
std::shared_ptr< std::pair< size_t, size_t > > data_

Member Function Documentation

size_t CopyMoveTracker::copyCount ( ) const
inline

Definition at line 579 of file FunctionTest.cpp.

References data_.

579  {
580  return data_->first;
581  }
std::shared_ptr< std::pair< size_t, size_t > > data_
size_t CopyMoveTracker::moveCount ( ) const
inline

Definition at line 582 of file FunctionTest.cpp.

References data_.

582  {
583  return data_->second;
584  }
std::shared_ptr< std::pair< size_t, size_t > > data_
CopyMoveTracker& CopyMoveTracker::operator= ( CopyMoveTracker const &  o)
inlinenoexcept

Definition at line 564 of file FunctionTest.cpp.

References data_.

564  {
565  data_ = o.data_;
566  ++data_->first;
567  return *this;
568  }
std::shared_ptr< std::pair< size_t, size_t > > data_
CopyMoveTracker& CopyMoveTracker::operator= ( CopyMoveTracker &&  o)
inlinenoexcept

Definition at line 573 of file FunctionTest.cpp.

References data_.

573  {
574  data_ = o.data_;
575  ++data_->second;
576  return *this;
577  }
std::shared_ptr< std::pair< size_t, size_t > > data_
size_t CopyMoveTracker::refCount ( ) const
inline

Definition at line 585 of file FunctionTest.cpp.

References data_.

585  {
586  return data_.use_count();
587  }
std::shared_ptr< std::pair< size_t, size_t > > data_
void CopyMoveTracker::resetCounters ( )
inline

Definition at line 588 of file FunctionTest.cpp.

References data_.

588  {
589  data_->first = data_->second = 0;
590  }
std::shared_ptr< std::pair< size_t, size_t > > data_

Member Data Documentation

std::shared_ptr<std::pair<size_t, size_t> > CopyMoveTracker::data_
private

Definition at line 594 of file FunctionTest.cpp.


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