1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef ARY_STDCONSTITER_HXX
21 #define ARY_STDCONSTITER_HXX
22 // KORR_DEPRECATED_3.0
36 class StdConstIterator
39 virtual ~StdConstIterator() {}
41 void operator++() { do_Advance(); }
42 const ELEM
& operator*() const { return *inq_CurElement(); }
43 operator bool() const { return inq_CurElement() != 0; }
45 /// Needed as replacement for operator bool() in gcc 2.95.
46 bool IsValid() const { return operator bool(); }
47 bool IsSorted() const { return inq_IsSorted(); }
54 virtual void do_Advance() = 0;
56 inq_CurElement() const = 0;
57 virtual bool inq_IsSorted() const = 0;
60 StdConstIterator(const StdConstIterator
<ELEM
>&);
61 StdConstIterator
<ELEM
> & operator=(const StdConstIterator
<ELEM
>&);
66 class Dyn_StdConstIterator
69 typedef StdConstIterator
<ELEM
> client_type
;
72 DYN client_type
* pass_dpIterator
= 0 )
73 : pClient(pass_dpIterator
) {}
74 Dyn_StdConstIterator
<ELEM
> &
76 DYN client_type
* pass_dpIterator
)
77 { pClient
= pass_dpIterator
;
79 client_type
& operator*() const { return *pClient
.MutablePtr(); }
82 Dyn
<client_type
> pClient
;
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */