-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathElement.tpp
57 lines (46 loc) · 914 Bytes
/
Element.tpp
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
52
53
54
55
56
57
/*
Archive: Element.tpp
Author: David T. Montoya
<davidtovarmontoya@gmail.com>
start date: 2020-11-20
last date modified 2021-3-13
Version: 0.1
licence: GPL
*/
template<class TIPO>
Element<TIPO>::Element(TIPO item,Element<TIPO> *next)
{
this->Value=item;
this->next=next;
}
template<class TIPO>
Element<TIPO>::~Element()
{
}
template<class TIPO>
TIPO Element<TIPO>::valueNext()
{
if(next==nullptr)
throw string(" you are calling '.valueNext' of last element. Next is nullptr, value not found");
return next->value();
}
template<class TIPO>
TIPO Element<TIPO>::value()
{
return Value;
}
template<class TIPO>
void Element<TIPO>::changeNext(Element<TIPO> *replacer)
{
next=replacer;
}
template<class TIPO>
Element<TIPO> *Element<TIPO>::pointerNext()
{
return next;
}
template<class TIPO>
void Element<TIPO>:: operator = (const TIPO &newValue)
{
Value=newValue;
}