28 # ifndef TPL_DYNSLIST_H 29 # define TPL_DYNSLIST_H 31 # include <tpl_slist.H> 33 using namespace Aleph;
54 throw std::out_of_range (
"position out of range");
56 if (pos < current_pos)
61 while (current_pos < pos)
63 current_node = current_node->
get_next();
72 DynSlist() : num_items(0), current_pos(0), current_node(this)
98 size_t size()
const {
return num_items; }
111 void insert(
const int & pos,
const T & data)
124 void remove(
const int & pos)
128 delete node_to_delete;
136 delete this->remove_first_ne();
162 # endif // TPL_DYNSLIST_H size_t size() const
Retorna la cantidad de elementos que tiene la lista.
Definition: tpl_dynSlist.H:98
Iterator(DynSlist &list)
Constructor.
Definition: tpl_dynSlist.H:153
Snode * remove_next()
Definition: tpl_snode.H:74
void insert_next(Slink *p)
Definition: slink.H:80
Node * get_curr()
Definition: tpl_slist.H:139
Definition: tpl_snode.H:48
void insert(const int &pos, const T &data)
Definition: tpl_dynSlist.H:111
Definition: tpl_dynSlist.H:46
Definition: tpl_dynSlist.H:144
DynSlist()
Constructor.
Definition: tpl_dynSlist.H:72
Definition: tpl_slist.H:46
Snode *& get_next()
Retorna el nodo siguiente a this.
Definition: tpl_snode.H:77
bool is_empty() const
Retorna true si this está vacÃo (apunta a sà mismo)
Definition: slink.H:62
T & get_data()
Retorna una referencia al dato contenido en el nodo.
Definition: tpl_snode.H:57
T Item_Type
El tipo de elemento que retorna get_curr().
Definition: tpl_dynSlist.H:150
T & get_curr()
retorna una referencia al elemento actual.
Definition: tpl_dynSlist.H:156
virtual ~DynSlist()
Destructor.
Definition: tpl_dynSlist.H:133
T & operator[](const size_t &i)
Definition: tpl_dynSlist.H:92
Slist< T > Set_Type
El tipo de conjunto sobre el cual se itera.
Definition: tpl_dynSlist.H:148