18 WeakNodePath(
const NodePath &node_path) :
19 _head(node_path._head),
30 _backup_key(copy._backup_key)
44 INLINE
void WeakNodePath::
45 operator = (
const NodePath &node_path) {
46 _head = node_path._head;
53 INLINE
void WeakNodePath::
56 _backup_key = copy._backup_key;
73 operator bool ()
const {
74 return _head.is_valid_pointer();
82 return _head ==
nullptr || _head.was_deleted();
91 return _head !=
nullptr && _head.was_deleted();
101 result._head = _head.lock();
102 if (!_head.is_null() && result._head ==
nullptr) {
103 result._error_type = NodePath::ET_fail;
114 if (
auto head = _head.lock()) {
115 return head->get_node();
125 INLINE
bool WeakNodePath::
126 operator == (
const NodePath &other)
const {
127 return _head.get_orig() == other._head && !_head.was_deleted();
133 INLINE
bool WeakNodePath::
134 operator != (
const NodePath &other)
const {
144 INLINE
bool WeakNodePath::
145 operator < (
const NodePath &other)
const {
146 return _head.owner_before(other._head);
159 INLINE
int WeakNodePath::
160 compare_to(
const NodePath &other)
const {
161 if (
operator != (other)) {
162 return _head.owner_before(other._head) ? -1 : 1;
171 INLINE
bool WeakNodePath::
173 return !_head.owner_before(other._head) && !other._head.owner_before(_head);
179 INLINE
bool WeakNodePath::
181 return _head.owner_before(other._head) || other._head.owner_before(_head);
190 INLINE
bool WeakNodePath::
192 return _head.owner_before(other._head);
205 INLINE
int WeakNodePath::
207 return other._head.owner_before(_head) - _head.owner_before(other._head);
213 INLINE
int WeakNodePath::
215 if (
auto head = _head.lock()) {
216 _backup_key = head->get_key();
221 INLINE std::ostream &operator << (std::ostream &out,
const WeakNodePath &node_path) {
222 node_path.output(out);