summaryrefslogtreecommitdiff
path: root/graphs/cpp/doubly_linked_list/node.cc
blob: b6db962f1648bcdcf60a0bb8c0d9749345c0d0dd (plain)
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
#include "node.hh"

Node::Node(int v)
    : val_{ v }
{}
int Node::get_val() const
{
    return val_;
}
void Node::set_val(int val)
{
    val_ = val;
}
std::shared_ptr<Node> Node::get_next() const
{
    return next_;
}
void Node::set_next(std::shared_ptr<Node> next)
{
    next_ = next;
}
std::shared_ptr<Node> Node::get_prev() const
{
    return prev_.lock();
}
void Node::set_prev(std::shared_ptr<Node> prev)
{
    prev_ = prev;
}