79 Kernel(Data
const& data) {
89 pointer_ =
new Kernel;
93 pointer_ = b.pointer_;
98 if (pointer_->counter_ <= 0) {
102 int attatch() {
return ++counter_; }
103 int detatch() {
return --counter_; }
104 Data
const* access()
const {
return &(pointer_->data_); }
106 if (pointer_->counter_ > 1) {
107 pointer_->counter_--;
108 pointer_ =
new Kernel(pointer_->data_);
110 return &(pointer_->data_);
115 void clear(Body* body) {
117 if (body->detatch() <= 0) {
131 body_ = (create_body ?
new Body() : NULL);
144 return body_->access();
149 return body_->modify();
154 return *((
Self*)
this);
168 body_ =
new Body(*(s.body_));
184 if (body_ != s.body_) {
198 return (body_ == s.body_);
210 if (
same(s) || body_->access() == s.body_->access())
return true;
211 return (body_->access()->equal(*(s.body_->access())));
221 return (body_ < s.body_);