My Project
Loading...
Searching...
No Matches
Public Member Functions | Private Types
LeftvShallow Class Reference

Ths class wraps leftv by taking into acount memory allocation, destruction as well as shallowly copying of a given leftv, i.e. More...

#include <countedref.h>

Public Member Functions

 LeftvShallow ()
 Just allocate (all-zero) leftv. More...
 
 LeftvShallow (leftv data)
 Shallow copy the input data. More...
 
 LeftvShallow (const self &rhs)
 Construct (shallow) copy of *this. More...
 
 ~LeftvShallow ()
 Destruct. More...
 
selfoperator= (leftv rhs)
 Assign shallow copy of the input. More...
 
selfoperator= (const self &rhs)
 Assign (shallow) copy of *this. More...
 

Private Types

typedef LeftvShallow self
 

Pointer-style access

leftv m_data
 The actual data pointer. More...
 
leftv operator-> () const
 The actual data pointer. More...
 
leftv operator-> ()
 The actual data pointer. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from LeftvHelper
static leftv idify (leftv head, idhdl *root)
 
static idhdl newid (leftv head, idhdl *root)
 
static void clearid (idhdl handle, idhdl *root)
 
template<class Type >
static Type * cpy (Type *result, Type *data)
 
template<class Type >
static Type * cpy (Type *data)
 
template<class Type >
static Type * recursivecpy (Type *data)
 
template<class Type >
static Type * shallowcpy (Type *result, Type *data)
 
template<class Type >
static Type * shallowcpy (Type *data)
 
template<class Type >
static void recursivekill (Type *current)
 
static leftv allocate ()
 

Detailed Description

Ths class wraps leftv by taking into acount memory allocation, destruction as well as shallowly copying of a given leftv, i.e.

we just copy auxiliary information (like subexpressions), but not the actual data.

Note
This is useful to avoid invalidating leftv while operating on th

Definition at line 284 of file countedref.h.

Member Typedef Documentation

◆ self

Definition at line 286 of file countedref.h.

Constructor & Destructor Documentation

◆ LeftvShallow() [1/3]

LeftvShallow::LeftvShallow ( )
inline

Just allocate (all-zero) leftv.

Definition at line 290 of file countedref.h.

290: m_data(allocate()) { }
static leftv allocate()
Definition: countedref.h:273
leftv m_data
The actual data pointer.
Definition: countedref.h:320

◆ LeftvShallow() [2/3]

LeftvShallow::LeftvShallow ( leftv  data)
inline

Shallow copy the input data.

Definition at line 292 of file countedref.h.

292: m_data(shallowcpy(data)) { }
static Type * shallowcpy(Type *result, Type *data)
Definition: countedref.h:259

◆ LeftvShallow() [3/3]

LeftvShallow::LeftvShallow ( const self rhs)
inline

Construct (shallow) copy of *this.

Definition at line 294 of file countedref.h.

294: m_data(shallowcpy(rhs.m_data)) { }

◆ ~LeftvShallow()

LeftvShallow::~LeftvShallow ( )
inline

Destruct.

Definition at line 297 of file countedref.h.

297 {
299 omFree(m_data);
300 }
static void recursivekill(Type *current)
Definition: countedref.h:268
Subexpr e
Definition: subexpr.h:105
#define omFree(addr)
Definition: omAllocDecl.h:261

Member Function Documentation

◆ operator->() [1/2]

leftv LeftvShallow::operator-> ( )
inline

The actual data pointer.

Definition at line 315 of file countedref.h.

315{ return m_data; }

◆ operator->() [2/2]

leftv LeftvShallow::operator-> ( ) const
inline

The actual data pointer.

Definition at line 313 of file countedref.h.

313{ return m_data; }

◆ operator=() [1/2]

self & LeftvShallow::operator= ( const self rhs)
inline

Assign (shallow) copy of *this.

Definition at line 309 of file countedref.h.

309{ return (*this) = rhs.m_data; }

◆ operator=() [2/2]

self & LeftvShallow::operator= ( leftv  rhs)
inline

Assign shallow copy of the input.

Definition at line 303 of file countedref.h.

303 {
305 shallowcpy(m_data, rhs);
306 return *this;
307 }

Field Documentation

◆ m_data

leftv LeftvShallow::m_data
protected

The actual data pointer.

Definition at line 320 of file countedref.h.


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