forked from douglascraigschmidt/CPlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLeaf_Node.cpp
More file actions
51 lines (42 loc) · 717 Bytes
/
Copy pathLeaf_Node.cpp
File metadata and controls
51 lines (42 loc) · 717 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/* -*- C++ -*- */
#ifndef _LEAF_NODE_CPP_
#define _LEAF_NODE_CPP_
#include <iostream>
#include <stdlib.h>
#include "Component_Node.h"
#include "Visitor.h"
#include "Leaf_Node.h"
// Ctor
Leaf_Node::Leaf_Node (int item)
: Component_Node (),
item_ (item)
{
}
// Ctor
Leaf_Node::Leaf_Node (const std::string &item)
: Component_Node ()
{
item_ = ::atoi (item.c_str ());
}
// Ctor
Leaf_Node::Leaf_Node (const char *item)
: Component_Node ()
{
item_ = ::atoi (item);
}
// Dtor
Leaf_Node::~Leaf_Node (void)
{
}
// return the item
int
Leaf_Node::item (void) const
{
return item_;
}
void
Leaf_Node::accept (Visitor &visitor) const
{
visitor.visit (*this);
}
#endif /* _LEAF_NODE_CPP_ */