bump product version to 4.1.6.2
[LibreOffice.git] / autodoc / inc / ary / types.hxx
bloba92088a2a74e0c6f954aefa2adceb1dd3d6094b4
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_TYPES_HXX
21 #define ARY_TYPES_HXX
23 // USED SERVICES
24 // BASE CLASSES
25 // OTHER
28 namespace ary
32 typedef uintt Rid;
33 typedef uintt ClassId;
37 // Deprecated:
38 typedef Rid Gid; /// Group Id. Id of a group.
39 typedef UINT8 SlotAccessId; /// Access to a Slot
40 typedef std::set< Rid, std::less< Rid > > Set_Rid;
41 typedef std::vector<Rid> List_Rid;
47 /** This is a global id, providing as well an entity's class as its
48 id.
50 class GlobalId
52 public:
53 GlobalId()
54 : nClass(0),
55 nId(0) {}
56 GlobalId(
57 ClassId i_class,
58 Rid i_id )
59 : nClass(i_class),
60 nId(i_id) {}
61 ~GlobalId() {}
63 bool IsValid() const { return nClass != 0
64 AND
65 nId != 0; }
66 ClassId Class() const { return nClass; }
67 Rid Id() const { return nId; }
69 private:
70 // DATA
71 ClassId nClass;
72 Rid nId;
76 typedef std::vector<GlobalId> List_GlobalIds;
79 /** This is a typed repository id. It allows to get
80 an object of a specific type.
82 template <class IFC>
83 class TypedId
85 public:
86 typedef TypedId<IFC> self;
89 explicit TypedId(
90 Rid i_nId = 0 )
91 : nId(i_nId) {}
92 TypedId<IFC> & operator=(
93 Rid i_nId )
94 { nId = i_nId; return *this; }
95 bool operator==(
96 const TypedId<IFC> &
97 i_nId ) const
98 { return nId == i_nId.nId; }
99 bool operator!=(
100 const TypedId<IFC> &
101 i_nId ) const
102 { return NOT operator==(i_nId); }
103 bool operator<(
104 const TypedId<IFC> &
105 i_nId ) const
106 { return nId < i_nId.nId; }
108 bool IsValid() const { return nId != 0; }
109 Rid Value() const { return nId; }
111 static self Null_() { return self(0); }
113 private:
114 // DATA
115 Rid nId;
121 } // namespace ary
122 #endif
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */