Enumerator.h
Go to the documentation of this file.
1 /****
2  * List.h
3  *
4  * Copyright 2019 mikee47 <mike@sillyhouse.net>
5  *
6  * This file is part of the Sming UPnP Library
7  *
8  * This library is free software: you can redistribute it and/or modify it under the terms of the
9  * GNU General Public License as published by the Free Software Foundation, version 3 or later.
10  *
11  * This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12  * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13  * See the GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License along with this library.
16  * If not, see <https://www.gnu.org/licenses/>.
17  *
18  ****/
19 
20 #pragma once
21 
22 #include "Item.h"
23 
24 namespace UPnP
25 {
37 template <typename ItemType, class EnumeratorType> class Enumerator
38 {
39 public:
40  virtual ~Enumerator()
41  {
42  }
43 
48  virtual EnumeratorType* clone() = 0;
49 
54  virtual void reset() = 0;
55 
60  virtual ItemType* current() = 0;
61 
66  virtual ItemType* next() = 0;
67 };
68 
69 } // namespace UPnP
Abstract class to enumerate items.
Definition: Enumerator.h:38
virtual ~Enumerator()
Definition: Enumerator.h:40
virtual ItemType * next()=0
Get next item.
virtual EnumeratorType * clone()=0
Make a copy of this enumerator.
virtual ItemType * current()=0
Get the current item.
virtual void reset()=0
Reset enumerator to start of list.
Definition: ActionRequest.h:25