|
CBMC
|
A utility class for writing types with copy-on-write behaviour (like irep). More...
#include <cow.h>
Public Member Functions | |
| template<typename... Ts> | |
| copy_on_writet (Ts &&... ts) | |
| copy_on_writet (const copy_on_writet &rhs) | |
| copy_on_writet & | operator= (const copy_on_writet &rhs) |
| copy_on_writet (copy_on_writet &&rhs) | |
| copy_on_writet & | operator= (copy_on_writet &&rhs) |
| void | swap (copy_on_writet &rhs) |
| const T & | read () const |
| T & | write (bool mark_shareable) |
| template<typename U > | |
| bool | operator== (const copy_on_writet< U > &rhs) const |
| template<typename U > | |
| bool | operator!= (const copy_on_writet< U > &rhs) const |
| template<typename U > | |
| bool | operator< (const copy_on_writet< U > &rhs) const |
| template<typename U > | |
| bool | operator> (const copy_on_writet< U > &rhs) const |
| template<typename U > | |
| bool | operator<= (const copy_on_writet< U > &rhs) const |
| template<typename U > | |
| bool | operator>= (const copy_on_writet< U > &rhs) const |
Private Attributes | |
| small_shared_ptrt< T > | t_ |
A utility class for writing types with copy-on-write behaviour (like irep).
This is a thin wrapper over a shared pointer, but instead of a single getter for the pointer value, we supply a separate 'read' and 'write' method. 'read' returns a reference to the owned object, while 'write' will create a copy of the owned object if more than one copy_on_write instance points to it.
|
inlineexplicit |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |