STK++ 0.9.13
STK::TRef<-1 > Struct Reference

#include <STK_IContainerRef.h>

Inheritance diagram for STK::TRef<-1 >:
Inheritance graph

Public Member Functions

bool isRef () const
 
bool ref () const
 
void exchange (TRef const &T)
 swap this with the container T.
 
void setRef (bool ref) const
 Modify the container : can become a reference or the owner of the data.
 

Protected Member Functions

 TRef (bool ref)
 Default constructor We have to specify the member ref_.
 
 ~TRef ()
 destructor.
 

Private Attributes

bool ref_
 Is it a "true" container or a wrapper ? ref_ should be false if this own its own data, true otherwise.
 

Detailed Description

Definition at line 69 of file STK_IContainerRef.h.

Constructor & Destructor Documentation

◆ TRef()

STK::TRef<-1 >::TRef ( bool  ref)
inlineexplicitprotected

Default constructor We have to specify the member ref_.

Parameters
ref: false if this own its own data.

Definition at line 75 of file STK_IContainerRef.h.

75: ref_(ref) {}
bool ref_
Is it a "true" container or a wrapper ? ref_ should be false if this own its own data,...

◆ ~TRef()

STK::TRef<-1 >::~TRef ( )
inlineprotected

destructor.

Definition at line 77 of file STK_IContainerRef.h.

77{}

Member Function Documentation

◆ exchange()

void STK::TRef<-1 >::exchange ( TRef<-1 > const T)
inline

swap this with the container T.

Parameters
Tthe container to swap with this

Definition at line 87 of file STK_IContainerRef.h.

87{ std::swap(ref_, T.ref_);}

Referenced by STK::MemAllocator< Type_, Size_ >::exchange(), and STK::MemSAllocator1D< Type_, NzMax_ >::exchange().

◆ isRef()

◆ ref()

◆ setRef()

void STK::TRef<-1 >::setRef ( bool  ref) const
inline

Modify the container : can become a reference or the owner of the data.

To use with care if we want to avoid memory leak.

Parameters
ref: false if this own its own data.

Definition at line 92 of file STK_IContainerRef.h.

92{ ref_ = ref;}

Member Data Documentation

◆ ref_

bool STK::TRef<-1 >::ref_
mutableprivate

Is it a "true" container or a wrapper ? ref_ should be false if this own its own data, true otherwise.

Definition at line 98 of file STK_IContainerRef.h.


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