Safir SDK Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EntityIterator.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Copyright Saab AB, 2007-2013 (http://safir.sourceforge.net)
4 *
5 * Created by: Anders Widén / stawi
6 *
7 *******************************************************************************
8 *
9 * This file is part of Safir SDK Core.
10 *
11 * Safir SDK Core is free software: you can redistribute it and/or modify
12 * it under the terms of version 3 of the GNU General Public License as
13 * published by the Free Software Foundation.
14 *
15 * Safir SDK Core is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with Safir SDK Core. If not, see <http://www.gnu.org/licenses/>.
22 *
23 ******************************************************************************/
24 
25 #ifndef _SAFIR_DOB_ENTITYITERATOR_H
26 #define _SAFIR_DOB_ENTITYITERATOR_H
27 
29 #include <Safir/Dob/EntityProxy.h>
32 #include <boost/iterator/iterator_facade.hpp>
33 
34 namespace Safir
35 {
36 namespace Dob
37 {
42  public boost::iterator_facade
43  <
44  EntityIterator,
45  const EntityProxy,
46  boost::single_pass_traversal_tag
47  >
48  {
49  public:
53 
55  DOSE_CPP_API EntityIterator(const EntityIterator & other);
56 
60 
62  DOSE_CPP_API EntityIterator & operator=(const EntityIterator& other);
63 
72  using boost::iterator_facade<EntityIterator,
73  const EntityProxy,
74  boost::single_pass_traversal_tag>::operator++;
75  private:
77  friend class ConnectionBase;
78 
79  //Disable postincrement iterator
80  //Use preincrement, i.e. ++it, instead.
81  const EntityIterator operator++(int);
82 
83  DOSE_CPP_API EntityIterator(const long ctrl,
84  const Typesystem::TypeId typeId,
85  const bool includeSubclasses);
86 
87  DOSE_CPP_API const EntityProxy& dereference() const;
88  DOSE_CPP_API void increment();
89  DOSE_CPP_API bool equal(const EntityIterator& other) const;
90 
91  long m_ctrl;
92  Safir::Dob::Typesystem::Int32 m_iteratorId;
93 
94  mutable boost::shared_ptr<EntityProxy> m_dereferenced;
95  };
96 }
97 }
98 
99 #endif
DOSE_CPP_API EntityIterator()
Constructs an "end" iterator.
A STL conformant forward iterator used to traverse entity instances.
Definition: EntityIterator.h:41
DotsC_TypeId TypeId
A unique type identifier.
Definition: Defs.h:219
friend class boost::iterator_core_access
Definition: EntityIterator.h:76
Common base class for connections to the DOB.
Definition: ConnectionBase.h:52
#define DOSE_CPP_API
Definition: DoseCppExportDefs.h:33
DOSE_CPP_API ~EntityIterator()
Destructor.
DotsC_Int32 Int32
32 bit integer type.
Definition: Defs.h:67
DOSE_CPP_API EntityIterator & operator=(const EntityIterator &other)
Copy assignment operator.
Proxy class for an entity.
Definition: EntityProxy.h:53