Loading...
Searching...
No Matches
LeftvShallow Class Reference

This class wraps `leftv` by taking into account 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`.
| LeftvShallow (leftv data)
| Shallow copy the input data.
| LeftvShallow (const self &rhs)
| Construct (shallow) copy of `*this`.
| ~LeftvShallow ()
| Destruct.
self & | operator= (leftv rhs)
| Assign shallow copy of the input.
self & | operator= (const self &rhs)
| Assign (shallow) copy of `*this`.

## Private Types

typedef LeftvShallow | self

## Pointer-style access

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

## 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

This class wraps `leftv` by taking into account 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

typedef LeftvShallow LeftvShallow::self

private

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.

: m_data(allocate()) { }
LeftvHelper::allocate
static leftv allocate()
Definition countedref.h:273
LeftvShallow::m_data
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.

: m_data(shallowcpy(data)) { }
LeftvHelper::shallowcpy
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.

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

## ~LeftvShallow()

LeftvShallow::~LeftvShallow | ( |  | ) |

inline

Destruct.

Definition at line 297 of file countedref.h.

{
recursivekill(m_data->e);
omFree(m_data);
}
LeftvHelper::recursivekill
static void recursivekill(Type *current)
Definition countedref.h:268
omFree
#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.

{ return m_data; }

## operator->() [2/2]

leftv LeftvShallow::operator-> | ( |  | ) | const

inline

The actual data pointer.

Definition at line 313 of file countedref.h.

{ 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.

{ 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.

{
recursivekill(m_data->e);
shallowcpy(m_data, rhs);
return *this;
}

## 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:

- Singular/countedref.h