0026377: Passing Handle objects as arguments to functions as non-const reference...
[occt.git] / src / IFSelect / IFSelect_SelectionIterator.hxx
CommitLineData
42cf5bc1 1// Created on: 1992-11-17
2// Created by: Christian CAILLET
3// Copyright (c) 1992-1999 Matra Datavision
4// Copyright (c) 1999-2014 OPEN CASCADE SAS
5//
6// This file is part of Open CASCADE Technology software library.
7//
8// This library is free software; you can redistribute it and/or modify it under
9// the terms of the GNU Lesser General Public License version 2.1 as published
10// by the Free Software Foundation, with special exception defined in the file
11// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12// distribution for complete text of the license and disclaimer of any warranty.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _IFSelect_SelectionIterator_HeaderFile
18#define _IFSelect_SelectionIterator_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_DefineAlloc.hxx>
22#include <Standard_Handle.hxx>
23
24#include <Standard_Integer.hxx>
25#include <IFSelect_HSeqOfSelection.hxx>
26#include <IFSelect_TSeqOfSelection.hxx>
27#include <Standard_Boolean.hxx>
28class Standard_NoSuchObject;
29class IFSelect_Selection;
30
31
32//! Defines an Iterator on a list of Selections
33class IFSelect_SelectionIterator
34{
35public:
36
37 DEFINE_STANDARD_ALLOC
38
39
40 //! Creates an empty iterator, ready to be filled
41 Standard_EXPORT IFSelect_SelectionIterator();
42
43 //! Creates an iterator from a Selection : it lists the Selections
44 //! from which <sel> depends (given by its method FillIterator)
45 Standard_EXPORT IFSelect_SelectionIterator(const Handle(IFSelect_Selection)& sel);
46
47 //! Adds to an iterator the content of another one
48 //! (each selection is present only once in the result)
49 Standard_EXPORT void AddFromIter (IFSelect_SelectionIterator& iter);
50
51 //! Adds a Selection to an iterator (if not yet noted)
52 Standard_EXPORT void AddItem (const Handle(IFSelect_Selection)& sel);
53
54 //! Adds a list of Selections to an iterator (this list comes
55 //! from the description of a Selection or a Dispatch, etc...)
56 Standard_EXPORT void AddList (const IFSelect_TSeqOfSelection& list);
57
58 //! Returns True if there are more Selections to get
59 Standard_EXPORT Standard_Boolean More() const;
60
61 //! Sets iterator to the next item
62 Standard_EXPORT void Next();
63
64 //! Returns the current Selction beeing iterated
65 //! Error if count of Selection has been passed
66 Standard_EXPORT const Handle(IFSelect_Selection)& Value() const;
67
68
69
70
71protected:
72
73
74
75
76
77private:
78
79
80
81 Standard_Integer thecurr;
82 Handle(IFSelect_HSeqOfSelection) thelist;
83
84
85};
86
87
88
89
90
91
92
93#endif // _IFSelect_SelectionIterator_HeaderFile