HoverRace  2.0
Node.h
Go to the documentation of this file.
1 
2 // Node.h
3 //
4 // Copyright (c) 2008, 2009, 2015 Michael Imamura.
5 //
6 // Licensed under GrokkSoft HoverRace SourceCode License v1.0(the "License");
7 // you may not use this file except in compliance with the License.
8 //
9 // A copy of the license should have been attached to the package from which
10 // you have taken this file. If you can not find the license you can not use
11 // this file.
12 //
13 //
14 // The author makes no representations about the suitability of
15 // this software for any purpose. It is provided "as is" "AS IS",
16 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
17 // implied.
18 //
19 // See the License for the specific language governing permissions
20 // and limitations under the License.
21 
22 #pragma once
23 
24 #include <yaml.h>
25 
26 namespace HoverRace {
27 namespace Util {
28 namespace yaml {
29 
31 class Node
32 {
33 private:
34  Node() : doc(nullptr), node(nullptr) { }
35 public:
36  Node(yaml_document_t *doc, yaml_node_t *node) :
37  doc(doc), node(node) { };
38  virtual ~Node() { }
39 
40 protected:
41  yaml_document_t *GetDocument() const { return doc; }
42  yaml_node_t *GetNode() const { return node; }
43 
44 private:
45  yaml_document_t *doc;
46  yaml_node_t *node;
47 };
48 
49 } // namespace yaml
50 } // namespace Util
51 } // namespace HoverRace
Base class for LibYAML document nodes.
Definition: Node.h:31
yaml_node_t * GetNode() const
Definition: Node.h:42
yaml_document_t * doc
Definition: Node.h:45
Node(yaml_document_t *doc, yaml_node_t *node)
Definition: Node.h:36
Node()
Definition: Node.h:34
yaml_document_t * GetDocument() const
Definition: Node.h:41
yaml_node_t * node
Definition: Node.h:46
Definition: Announcement.h:24
virtual ~Node()
Definition: Node.h:38