22 #ifndef NDN_CHANGE_COUNTER_HPP
23 #define NDN_CHANGE_COUNTER_HPP
25 #include "../common.hpp"
44 changeCount_ = target_.getChangeCount();
55 changeCount_ = target_.getChangeCount();
63 get()
const {
return target_; }
70 get() {
return target_; }
80 changeCount_ = target_.getChangeCount();
94 uint64_t targetChangeCount = target_.getChangeCount();
95 if (changeCount_ != targetChangeCount) {
106 uint64_t changeCount_;
136 changeCount_ = target_->getChangeCount();
146 get()
const {
return target_.get(); }
153 get() {
return target_.get(); }
160 set(
const ptr_lib::shared_ptr<T>& target)
164 changeCount_ = target_->getChangeCount();
182 uint64_t targetChangeCount = target_->getChangeCount();
183 if (changeCount_ != targetChangeCount) {
193 ptr_lib::shared_ptr<T> target_;
194 uint64_t changeCount_;
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
A ChangeCounter keeps a target object whose change count is tracked by a local change count...
Definition: change-counter.hpp:37
SharedPointerChangeCounter()
Create a new SharedPointerChangeCounter with a default a null shared_ptr for the target.
Definition: change-counter.hpp:123
void set(const T &target)
Set the target to the given target.
Definition: change-counter.hpp:77
ChangeCounter()
Create a new ChangeCounter with a default value for the target.
Definition: change-counter.hpp:42
ChangeCounter(const T &target)
Create a new ChangeCounter, calling the copy constructor on T with the given target.
Definition: change-counter.hpp:52
void set(const ptr_lib::shared_ptr< T > &target)
Set the shared_ptr to the target to the given value.
Definition: change-counter.hpp:160
A ChangeCounter keeps a shared_ptr to a target object whose change count is tracked by a local change...
Definition: change-counter.hpp:117
bool checkChanged() const
If the target's change count is different than the local change count, then update the local change c...
Definition: change-counter.hpp:177
SharedPointerChangeCounter(T *target)
Create a new SharedPointerChangeCounter with the given target.
Definition: change-counter.hpp:132
bool checkChanged() const
If the target's change count is different than the local change count, then update the local change c...
Definition: change-counter.hpp:92