19 #ifndef PAGESPEED_KERNEL_UTIL_COPY_ON_WRITE_H_
20 #define PAGESPEED_KERNEL_UTIL_COPY_ON_WRITE_H_
24 namespace net_instaweb {
45 const T*
get()
const {
return reference_.get(); }
46 const T* operator->()
const {
return reference_.get(); }
47 const T& operator*()
const {
return *reference_.get(); }
54 if (!reference_.
unique()) {
55 reference_.
reset(*
get());
57 return reference_.get();
62 reference_ = src.reference_;
75 if ((*this)->empty()) {
T * MakeWriteable()
Definition: copy_on_write.h:53
bool unique() const
Definition: ref_counted_ptr.h:170
void reset(const T &val)
Definition: ref_counted_ptr.h:182
void MergeOrShare(const CopyOnWrite &src)
Definition: copy_on_write.h:71
Definition: copy_on_write.h:34
CopyOnWrite()
Definition: copy_on_write.h:38
CopyOnWrite(const T &obj)
Definition: copy_on_write.h:42
Definition: ref_counted_ptr.h:162