mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Added api sketch
This commit is contained in:
31
src/nodeownership.cpp
Normal file
31
src/nodeownership.cpp
Normal file
@@ -0,0 +1,31 @@
|
||||
#include "nodeownership.h"
|
||||
#include "yaml-cpp/node.h"
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
NodeOwnership::NodeOwnership(NodeOwnership *pOwner): m_pOwner(pOwner)
|
||||
{
|
||||
if(!m_pOwner)
|
||||
m_pOwner = this;
|
||||
}
|
||||
|
||||
NodeOwnership::~NodeOwnership()
|
||||
{
|
||||
}
|
||||
|
||||
Node& NodeOwnership::_Create()
|
||||
{
|
||||
m_nodes.push_back(std::auto_ptr<Node>(new Node));
|
||||
return m_nodes.back();
|
||||
}
|
||||
|
||||
void NodeOwnership::_MarkAsAliased(const Node& node)
|
||||
{
|
||||
m_aliasedNodes.insert(&node);
|
||||
}
|
||||
|
||||
bool NodeOwnership::_IsAliased(const Node& node) const
|
||||
{
|
||||
return m_aliasedNodes.count(&node) > 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user