Update ooo320-m1
[ooovba.git] / autodoc / inc / ary / cpp / c_namesp.hxx
blobb12932c4ab86d4214d674ac978b570f6cd7f628e
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: c_namesp.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ARY_CPP_C_NAMESP_HXX
32 #define ARY_CPP_C_NAMESP_HXX
36 // USED SERVICES
37 // BASE CLASSES
38 #include <ary/cpp/c_ce.hxx>
39 #include <ary/arygroup.hxx>
40 // OTHER
41 #include <ary/symtreenode.hxx>
42 #include <ary/cessentl.hxx>
43 #include <ary/cpp/c_types4cpp.hxx>
44 #include <ary/cpp/c_slntry.hxx>
46 namespace ary
48 namespace cpp
50 class Gate;
51 class OperationSignature;
57 namespace ary
59 namespace cpp
64 /** A C++ namespace.
66 class Namespace : public CodeEntity,
67 public AryGroup
69 public:
70 enum E_ClassId { class_id = 1000 };
72 enum E_Slots
74 SLOT_SubNamespaces = 1,
75 SLOT_Classes,
76 SLOT_Enums,
77 SLOT_Typedefs,
78 SLOT_Operations,
79 SLOT_Variables,
80 SLOT_Constants
83 typedef ::ary::symtree::Node<CeNode_Traits> node_t;
85 Namespace();
86 Namespace(
87 const String & i_sName,
88 Namespace & i_rParent );
89 ~Namespace();
90 // OPERATIONS
91 void Add_LocalNamespace(
92 Namespace & io_rLocalNamespace );
93 void Add_LocalClass(
94 const String & i_sLocalName,
95 Cid i_nId );
96 void Add_LocalEnum(
97 const String & i_sLocalName,
98 Cid i_nId );
99 void Add_LocalTypedef(
100 const String & i_sLocalName,
101 Cid i_nId );
102 void Add_LocalOperation(
103 const String & i_sLocalName,
104 Cid i_nId );
105 void Add_LocalVariable(
106 const String & i_sLocalName,
107 Cid i_nId );
108 void Add_LocalConstant(
109 const String & i_sLocalName,
110 Cid i_nId );
112 // INQUIRY
113 virtual uintt Depth() const;
114 Namespace * Parent() const;
116 Ce_id Search_Child(
117 const String & i_key ) const;
118 Namespace * Search_LocalNamespace(
119 const String & i_sLocalName ) const;
120 uintt Get_SubNamespaces(
121 std::vector< const Namespace* > &
122 o_rResultList ) const;
123 Ce_id Search_LocalClass(
124 const String & i_sName ) const;
125 void Search_LocalOperations(
126 std::vector<Ce_id> &
127 o_result,
128 const String & i_sName ) const;
129 const node_t & AsNode() const;
131 // ACCESS
132 node_t & AsNode();
134 private:
135 NON_COPYABLE(Namespace);
137 // Interface csv::ConstProcessorClient
138 virtual void do_Accept(
139 csv::ProcessorIfc & io_processor ) const;
141 // Interface CodeEntity
142 virtual const String &
143 inq_LocalName() const;
144 virtual Cid inq_Owner() const;
145 virtual Lid inq_Location() const;
147 // Interface ary::cpp::CppEntity
148 virtual ClassId get_AryClass() const;
150 // Interface AryGroup
151 virtual Gid inq_Id_Group() const;
152 virtual const cpp::CppEntity &
153 inq_RE_Group() const;
154 virtual const ary::group::SlotList &
155 inq_Slots() const;
156 virtual DYN Slot * inq_Create_Slot(
157 SlotAccessId i_nSlot ) const;
158 // Local
159 typedef std::multimap<String, Ce_id> Map_Operations;
161 // DATA
162 CeEssentials aEssentials;
163 node_t aAssignedNode;
165 Map_NamespacePtr aLocalNamespaces;
166 Map_LocalCe aLocalClasses;
167 Map_LocalCe aLocalEnums;
168 Map_LocalCe aLocalTypedefs;
169 Map_Operations aLocalOperations;
170 Map_LocalCe aLocalVariables;
171 Map_LocalCe aLocalConstants;
173 Namespace * pParent;
174 uintt nDepth;
179 // IMPLEMENTATION
180 inline const Namespace::node_t &
181 Namespace::AsNode() const
183 return aAssignedNode;
186 inline Namespace::node_t &
187 Namespace::AsNode()
189 return aAssignedNode;
195 } // namespace cpp
196 } // ary
197 #endif