Empirical
Public Member Functions | List of all members
emp::PtrInfo Class Reference

#include <Ptr.h>

Public Member Functions

 PtrInfo (const void *_ptr)
 
 PtrInfo (const void *_ptr, size_t _array_bytes)
 
 PtrInfo (const PtrInfo &)=default
 
 PtrInfo (PtrInfo &&)=default
 
PtrInfooperator= (const PtrInfo &)=default
 
PtrInfooperator= (PtrInfo &&)=default
 
 ~PtrInfo ()
 
const void * GetPtr () const noexcept
 What pointer does this one hold information about? More...
 
int GetCount () const noexcept
 How many Ptr objects point to the associated position? More...
 
size_t GetArrayBytes () const noexcept
 If this ptr is to an array, how many bytes large is the array (may be different from size!) More...
 
bool IsActive () const noexcept
 Is this pointer currently valid to access? More...
 
bool IsArray () const noexcept
 Is this pointer pointing to an array? More...
 
void SetArray (size_t bytes) noexcept
 Denote that this pointer is an array. More...
 
void Inc (size_t id)
 Add one more pointer. More...
 
void Dec (size_t id)
 Remove a pointer. More...
 
void MarkDeleted ()
 Indicate that the associated position has been deleted. More...
 
bool OK () const noexcept
 Debug utility to determine if everything looks okay with this pointer's information. More...
 

Constructor & Destructor Documentation

emp::PtrInfo::PtrInfo ( const void *  _ptr)
inline
emp::PtrInfo::PtrInfo ( const void *  _ptr,
size_t  _array_bytes 
)
inline
emp::PtrInfo::PtrInfo ( const PtrInfo )
default
emp::PtrInfo::PtrInfo ( PtrInfo &&  )
default
emp::PtrInfo::~PtrInfo ( )
inline

Member Function Documentation

void emp::PtrInfo::Dec ( size_t  id)
inline

Remove a pointer.

size_t emp::PtrInfo::GetArrayBytes ( ) const
inlinenoexcept

If this ptr is to an array, how many bytes large is the array (may be different from size!)

int emp::PtrInfo::GetCount ( ) const
inlinenoexcept

How many Ptr objects point to the associated position?

const void* emp::PtrInfo::GetPtr ( ) const
inlinenoexcept

What pointer does this one hold information about?

void emp::PtrInfo::Inc ( size_t  id)
inline

Add one more pointer.

bool emp::PtrInfo::IsActive ( ) const
inlinenoexcept

Is this pointer currently valid to access?

bool emp::PtrInfo::IsArray ( ) const
inlinenoexcept

Is this pointer pointing to an array?

void emp::PtrInfo::MarkDeleted ( )
inline

Indicate that the associated position has been deleted.

bool emp::PtrInfo::OK ( ) const
inlinenoexcept

Debug utility to determine if everything looks okay with this pointer's information.

PtrInfo& emp::PtrInfo::operator= ( const PtrInfo )
default
PtrInfo& emp::PtrInfo::operator= ( PtrInfo &&  )
default
void emp::PtrInfo::SetArray ( size_t  bytes)
inlinenoexcept

Denote that this pointer is an array.


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