fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / autodoc / inc / ary / stdconstiter.hxx
blob0f7c00146bafd912c33b04fa7bbe324737823231
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
25 // USED SERVICES
26 // BASE CLASSES
27 // COMPONENTS
28 // PARAMETERS
31 namespace ary
34 template <class ELEM>
36 class StdConstIterator
38 public:
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(); }
49 protected:
50 StdConstIterator() {}
52 private:
53 //Locals
54 virtual void do_Advance() = 0;
55 virtual const ELEM *
56 inq_CurElement() const = 0;
57 virtual bool inq_IsSorted() const = 0;
59 // Forbidden:
60 StdConstIterator(const StdConstIterator<ELEM>&);
61 StdConstIterator<ELEM> & operator=(const StdConstIterator<ELEM>&);
65 template <class ELEM>
66 class Dyn_StdConstIterator
68 public:
69 typedef StdConstIterator<ELEM> client_type;
71 Dyn_StdConstIterator(
72 DYN client_type * pass_dpIterator = 0 )
73 : pClient(pass_dpIterator) {}
74 Dyn_StdConstIterator<ELEM> &
75 operator=(
76 DYN client_type * pass_dpIterator )
77 { pClient = pass_dpIterator;
78 return *this; }
79 client_type & operator*() const { return *pClient.MutablePtr(); }
81 private:
82 Dyn<client_type> pClient;
89 } // namespace ary
90 #endif
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */