scide: implement selectionLength for openDocument
[supercollider.git] / external_libraries / yaml-cpp-0.3.0 / src / nodeownership.h
blob69870814fe9d0f6f38b4589065f3965348094cde
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
5 #pragma once
6 #endif
9 #include "yaml-cpp/noncopyable.h"
10 #include "ptr_vector.h"
11 #include <set>
13 namespace YAML
15 class Node;
17 class NodeOwnership: private noncopyable
19 public:
20 explicit NodeOwnership(NodeOwnership *pOwner = 0);
21 ~NodeOwnership();
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); }
27 private:
28 Node& _Create();
29 void _MarkAsAliased(const Node& node);
30 bool _IsAliased(const Node& node) const;
32 private:
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