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();
92 uint64_t targetChangeCount = target_.getChangeCount();
93 if (changeCount_ != targetChangeCount) {
104 uint64_t changeCount_;
134 changeCount_ = target_->getChangeCount();
144 get()
const {
return target_.get(); }
151 get() {
return target_.get(); }
158 set(
const ptr_lib::shared_ptr<T>& target)
162 changeCount_ = target_->getChangeCount();
180 uint64_t targetChangeCount = target_->getChangeCount();
181 if (changeCount_ != targetChangeCount) {
191 ptr_lib::shared_ptr<T> target_;
192 uint64_t changeCount_;
Copyright (C) 2013-2015 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:121
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:158
A ChangeCounter keeps a shared_ptr to a target object whose change count is tracked by a local change...
Definition: change-counter.hpp:115
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:175
SharedPointerChangeCounter(T *target)
Create a new SharedPointerChangeCounter with the given target.
Definition: change-counter.hpp:130
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:90