1 #ifndef NODE_OWNERSHIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66
2 #define NODE_OWNERSHIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66
4 #if defined(_MSC_VER) || (defined(__GNUC__) && (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) || (__GNUC__ >= 4)) // GCC supports "pragma once" correctly since 3.4
9 #include "yaml-cpp/noncopyable.h"
10 #include "ptr_vector.h"
17 class NodeOwnership
: private noncopyable
20 explicit NodeOwnership(NodeOwnership
*pOwner
= 0);
23 Node
& Create() { return m_pOwner
->_Create(); }
24 void MarkAsAliased(const Node
& node
) { m_pOwner
->_MarkAsAliased(node
); }
25 bool IsAliased(const Node
& node
) const { return m_pOwner
->_IsAliased(node
); }
29 void _MarkAsAliased(const Node
& node
);
30 bool _IsAliased(const Node
& node
) const;
33 ptr_vector
<Node
> m_nodes
;
34 std::set
<const Node
*> m_aliasedNodes
;
35 NodeOwnership
*m_pOwner
;
39 #endif // NODE_OWNERSHIP_H_62B23520_7C8E_11DE_8A39_0800200C9A66