Aleph-w  1.9
General library for algorithms and data structures
tpl_snode.H
1 
2 /* Aleph-w
3 
4  / \ | | ___ _ __ | |__ __ __
5  / _ \ | |/ _ \ '_ \| '_ \ ____\ \ /\ / / Data structures & Algorithms
6  / ___ \| | __/ |_) | | | |_____\ V V / version 1.9b
7  /_/ \_\_|\___| .__/|_| |_| \_/\_/ https://github.com/lrleon/Aleph-w
8  |_|
9 
10  This file is part of Aleph-w library
11 
12  Copyright (c) 2002-2018 Leandro Rabindranath Leon & Alejandro Mujica
13 
14  This program is free software: you can redistribute it and/or modify
15  it under the terms of the GNU General Public License as published by
16  the Free Software Foundation, either version 3 of the License, or
17  (at your option) any later version.
18 
19  This program is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  General Public License for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with this program. If not, see <https://www.gnu.org/licenses/>.
26 */
27 
28 # ifndef TPL_SNODE_H
29 # define TPL_SNODE_H
30 
31 # include <slink.H>
32 
33 using namespace Aleph;
34 
35 namespace Aleph {
36 
47 template <typename T>
48 class Snode : public Slink
49 {
50 private:
51 
52  T data;
53 
54 public:
55 
57  T & get_data() { return data; }
58 
60  Snode() { /* empty*/ }
61 
63  Snode(const T & _data) : data(_data) { /* empty */ }
64 
65  Snode(const T && _data) : data(_data) { /* empty */ }
66 
75 
77  Snode *& get_next() { return (Snode*&) Slink::get_next(); }
78 
87 
89  Snode *& get_first() const { return Snode::get_next(); }
90 };
91 
92 } // end namespace Aleph
93 
94 # endif /* TPL_SNODE_H */
95 
Snode * remove_next()
Definition: tpl_snode.H:74
Snode()
Constructor vacío.
Definition: tpl_snode.H:60
Definition: tpl_snode.H:48
Snode(const T &_data)
Constructor que copia dato.
Definition: tpl_snode.H:63
Snode *& get_first() const
Retorna el nodo siguiente a this.
Definition: tpl_snode.H:89
Snode *& get_next()
Retorna el nodo siguiente a this.
Definition: tpl_snode.H:77
Definition: ah-comb.H:35
Snode * remove_first()
Definition: tpl_snode.H:86
T & get_data()
Retorna una referencia al dato contenido en el nodo.
Definition: tpl_snode.H:57

Leandro Rabindranath León