Data Structures in C++
include
Node.hpp
Go to the documentation of this file.
1
/**
2
* @author Douglas De Rizzo Meneghetti (douglasrizzom@gmail.com)
3
* @date 2017-6-8
4
* @brief Node used inside other data structures
5
*/
6
7
#
ifndef
AULA1_NODE_HPP
8
#
define
AULA1_NODE_HPP
9
10
#
include
<
stddef
.
h
>
11
12
//! Node used inside other data structures. Uses templates to allow storing any kind of object.
13
//! \tparam T the type of object the node will store.
14
template
<
class
T>
15
class
Node
{
16
private
:
17
T
value
;
18
Node
*
next
;
19
Node
*
previous
;
20
public
:
21
22
Node
() {
23
next = previous = NULL;
24
}
25
26
~
Node
() {
27
// delete next;
28
// delete previous;
29
}
30
31
T
getValue
()
const
{
32
return
value
;
33
}
34
35
void
setValue
(T value) {
36
this
->value = value;
37
}
38
39
Node
*
getNext
()
const
{
40
return
next
;
41
}
42
43
void
setNext
(
Node
*next) {
44
this
->next = next;
45
}
46
47
Node
*
getPrevious
()
const
{
48
return
previous
;
49
}
50
51
void
setPrevious
(
Node
*previous) {
52
this
->previous = previous;
53
}
54
};
55
56
#
endif
Node
Node used inside other data structures.
Definition:
Node.hpp:15
Node::setPrevious
void setPrevious(Node *previous)
Definition:
Node.hpp:51
Node::Node
Node()
Definition:
Node.hpp:22
Node::next
Node * next
Definition:
Node.hpp:18
Node::previous
Node * previous
Definition:
Node.hpp:19
Node::setValue
void setValue(T value)
Definition:
Node.hpp:35
Node::getPrevious
Node * getPrevious() const
Definition:
Node.hpp:47
Node::setNext
void setNext(Node *next)
Definition:
Node.hpp:43
Node::getValue
T getValue() const
Definition:
Node.hpp:31
Node::~Node
~Node()
Definition:
Node.hpp:26
Node::getNext
Node * getNext() const
Definition:
Node.hpp:39
Node::value
T value
Definition:
Node.hpp:17
Generated by
1.8.13