1 #ifndef VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 2 #define VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 4 #if defined(_MSC_VER) || \ 5 (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || \ 6 (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4 10 #include "yaml-cpp/dll.h" 11 #include "yaml-cpp/node/ptr.h" 12 #include "yaml-cpp/node/detail/node_iterator.h" 18 struct iterator_value;
21 class iterator_base :
public std::iterator<std::forward_iterator_tag, V,
22 std::ptrdiff_t, V*, V> {
31 explicit proxy(
const V& x) : m_ref(x) {}
32 V* operator->() {
return std::addressof(m_ref); }
33 operator V*() {
return std::addressof(m_ref); }
39 typedef typename iterator_base::value_type value_type;
43 explicit iterator_base(base_type rhs, shared_memory_holder pMemory)
44 : m_iterator(rhs), m_pMemory(pMemory) {}
48 typename std::enable_if<std::is_convertible<W*, V*>::value,
49 enabler>::type = enabler())
50 : m_iterator(rhs.m_iterator), m_pMemory(rhs.m_pMemory) {}
65 return m_iterator == rhs.m_iterator;
70 return m_iterator != rhs.m_iterator;
73 value_type operator*()
const {
76 return value_type(
Node(*v, m_pMemory));
77 if (v.first && v.second)
78 return value_type(
Node(*v.first, m_pMemory),
Node(*v.second, m_pMemory));
82 proxy operator->()
const {
return proxy(**
this); }
86 shared_memory_holder m_pMemory;
91 #endif // VALUE_DETAIL_ITERATOR_H_62B23520_7C8E_11DE_8A39_0800200C9A66 Definition: node_iterator.h:26
Definition: node_iterator.h:55
Definition: iterator.h:21
Definition: DrawableObjectLoader.h:10