1*78bc99aaSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*78bc99aaSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*78bc99aaSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*78bc99aaSAndrew Rist  * distributed with this work for additional information
6*78bc99aaSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*78bc99aaSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*78bc99aaSAndrew Rist  * "License"); you may not use this file except in compliance
9*78bc99aaSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*78bc99aaSAndrew Rist  *
11*78bc99aaSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*78bc99aaSAndrew Rist  *
13*78bc99aaSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*78bc99aaSAndrew Rist  * software distributed under the License is distributed on an
15*78bc99aaSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*78bc99aaSAndrew Rist  * KIND, either express or implied.  See the License for the
17*78bc99aaSAndrew Rist  * specific language governing permissions and limitations
18*78bc99aaSAndrew Rist  * under the License.
19*78bc99aaSAndrew Rist  *
20*78bc99aaSAndrew Rist  *************************************************************/
21cdf0e10cSrcweir 
22cdf0e10cSrcweir #include <precomp.h>
23cdf0e10cSrcweir #include <icprivow.hxx>
24cdf0e10cSrcweir 
25cdf0e10cSrcweir 
26cdf0e10cSrcweir // NOT FULLY DEFINED SERVICES
27cdf0e10cSrcweir #include <ary/cpp/c_namesp.hxx>
28cdf0e10cSrcweir #include <ary/cpp/c_class.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir 
31cdf0e10cSrcweir 
32cdf0e10cSrcweir namespace cpp
33cdf0e10cSrcweir {
34cdf0e10cSrcweir 
35cdf0e10cSrcweir 
36cdf0e10cSrcweir 
37cdf0e10cSrcweir //******************          Owner_Namespace          ********************//
Owner_Namespace()38cdf0e10cSrcweir Owner_Namespace::Owner_Namespace()
39cdf0e10cSrcweir     :   pScope(0)
40cdf0e10cSrcweir {
41cdf0e10cSrcweir }
42cdf0e10cSrcweir 
43cdf0e10cSrcweir void
SetAnotherNamespace(ary::cpp::Namespace & io_rScope)44cdf0e10cSrcweir Owner_Namespace::SetAnotherNamespace( ary::cpp::Namespace & io_rScope )
45cdf0e10cSrcweir {
46cdf0e10cSrcweir     pScope = &io_rScope;
47cdf0e10cSrcweir }
48cdf0e10cSrcweir 
49cdf0e10cSrcweir bool
HasClass(const String & i_sLocalName)50cdf0e10cSrcweir Owner_Namespace::HasClass( const String & i_sLocalName )
51cdf0e10cSrcweir {
52cdf0e10cSrcweir     return pScope->Search_LocalClass(i_sLocalName).IsValid();
53cdf0e10cSrcweir }
54cdf0e10cSrcweir 
55cdf0e10cSrcweir void
do_Add_Class(const String & i_sLocalName,Cid i_nId)56cdf0e10cSrcweir Owner_Namespace::do_Add_Class( const String  &     i_sLocalName,
57cdf0e10cSrcweir                                Cid                 i_nId )
58cdf0e10cSrcweir {
59cdf0e10cSrcweir     csv_assert(pScope != 0);
60cdf0e10cSrcweir     pScope->Add_LocalClass(i_sLocalName, i_nId);
61cdf0e10cSrcweir }
62cdf0e10cSrcweir 
63cdf0e10cSrcweir void
do_Add_Enum(const String & i_sLocalName,Cid i_nId)64cdf0e10cSrcweir Owner_Namespace::do_Add_Enum( const String  &     i_sLocalName,
65cdf0e10cSrcweir                               Cid                 i_nId )
66cdf0e10cSrcweir {
67cdf0e10cSrcweir     csv_assert(pScope != 0);
68cdf0e10cSrcweir     pScope->Add_LocalEnum(i_sLocalName, i_nId);
69cdf0e10cSrcweir }
70cdf0e10cSrcweir 
71cdf0e10cSrcweir void
do_Add_Typedef(const String & i_sLocalName,Cid i_nId)72cdf0e10cSrcweir Owner_Namespace::do_Add_Typedef( const String  &     i_sLocalName,
73cdf0e10cSrcweir                                  Cid                 i_nId )
74cdf0e10cSrcweir {
75cdf0e10cSrcweir     csv_assert(pScope != 0);
76cdf0e10cSrcweir     pScope->Add_LocalTypedef(i_sLocalName, i_nId);
77cdf0e10cSrcweir }
78cdf0e10cSrcweir 
79cdf0e10cSrcweir void
do_Add_Operation(const String & i_sLocalName,Cid i_nId,bool)80cdf0e10cSrcweir Owner_Namespace::do_Add_Operation( const String  &     i_sLocalName,
81cdf0e10cSrcweir                                    Cid                 i_nId,
82cdf0e10cSrcweir                                    bool                )
83cdf0e10cSrcweir {
84cdf0e10cSrcweir     csv_assert(pScope != 0);
85cdf0e10cSrcweir     pScope->Add_LocalOperation(i_sLocalName, i_nId);
86cdf0e10cSrcweir }
87cdf0e10cSrcweir 
88cdf0e10cSrcweir void
do_Add_Variable(const String & i_sLocalName,Cid i_nId,bool i_bIsConst,bool)89cdf0e10cSrcweir Owner_Namespace::do_Add_Variable( const String  &     i_sLocalName,
90cdf0e10cSrcweir                                   Cid                 i_nId,
91cdf0e10cSrcweir                                   bool                i_bIsConst,
92cdf0e10cSrcweir                                   bool                )
93cdf0e10cSrcweir {
94cdf0e10cSrcweir     csv_assert(pScope != 0);
95cdf0e10cSrcweir     if (i_bIsConst)
96cdf0e10cSrcweir         pScope->Add_LocalConstant(i_sLocalName, i_nId);
97cdf0e10cSrcweir     else
98cdf0e10cSrcweir         pScope->Add_LocalVariable(i_sLocalName, i_nId);
99cdf0e10cSrcweir }
100cdf0e10cSrcweir 
101cdf0e10cSrcweir 
102cdf0e10cSrcweir Cid
inq_CeId() const103cdf0e10cSrcweir Owner_Namespace::inq_CeId() const
104cdf0e10cSrcweir {
105cdf0e10cSrcweir     csv_assert(pScope != 0);
106cdf0e10cSrcweir     return pScope->CeId();
107cdf0e10cSrcweir }
108cdf0e10cSrcweir 
109cdf0e10cSrcweir 
110cdf0e10cSrcweir //******************            Owner_Class          ********************//
111cdf0e10cSrcweir 
Owner_Class()112cdf0e10cSrcweir Owner_Class::Owner_Class()
113cdf0e10cSrcweir     :   pScope(0)
114cdf0e10cSrcweir {
115cdf0e10cSrcweir }
116cdf0e10cSrcweir 
117cdf0e10cSrcweir void
SetAnotherClass(ary::cpp::Class & io_rScope)118cdf0e10cSrcweir Owner_Class::SetAnotherClass( ary::cpp::Class & io_rScope )
119cdf0e10cSrcweir {
120cdf0e10cSrcweir     pScope = &io_rScope;
121cdf0e10cSrcweir }
122cdf0e10cSrcweir 
123cdf0e10cSrcweir bool
HasClass(const String &)124cdf0e10cSrcweir Owner_Class::HasClass( const String  & )
125cdf0e10cSrcweir {
126cdf0e10cSrcweir     return false;
127cdf0e10cSrcweir }
128cdf0e10cSrcweir 
129cdf0e10cSrcweir void
do_Add_Class(const String & i_sLocalName,Cid i_nId)130cdf0e10cSrcweir Owner_Class::do_Add_Class( const String  &     i_sLocalName,
131cdf0e10cSrcweir                                Cid                 i_nId )
132cdf0e10cSrcweir {
133cdf0e10cSrcweir     csv_assert(pScope != 0);
134cdf0e10cSrcweir     pScope->Add_LocalClass(i_sLocalName, i_nId);
135cdf0e10cSrcweir }
136cdf0e10cSrcweir 
137cdf0e10cSrcweir void
do_Add_Enum(const String & i_sLocalName,Cid i_nId)138cdf0e10cSrcweir Owner_Class::do_Add_Enum( const String  &     i_sLocalName,
139cdf0e10cSrcweir                               Cid                 i_nId )
140cdf0e10cSrcweir {
141cdf0e10cSrcweir     csv_assert(pScope != 0);
142cdf0e10cSrcweir     pScope->Add_LocalEnum(i_sLocalName, i_nId);
143cdf0e10cSrcweir }
144cdf0e10cSrcweir 
145cdf0e10cSrcweir void
do_Add_Typedef(const String & i_sLocalName,Cid i_nId)146cdf0e10cSrcweir Owner_Class::do_Add_Typedef( const String  &     i_sLocalName,
147cdf0e10cSrcweir                              Cid                 i_nId )
148cdf0e10cSrcweir {
149cdf0e10cSrcweir     csv_assert(pScope != 0);
150cdf0e10cSrcweir     pScope->Add_LocalTypedef(i_sLocalName, i_nId);
151cdf0e10cSrcweir }
152cdf0e10cSrcweir 
153cdf0e10cSrcweir void
do_Add_Operation(const String & i_sLocalName,Cid i_nId,bool i_bIsStatic)154cdf0e10cSrcweir Owner_Class::do_Add_Operation( const String  &      i_sLocalName,
155cdf0e10cSrcweir                                Cid                  i_nId,
156cdf0e10cSrcweir                                bool                 i_bIsStatic )
157cdf0e10cSrcweir {
158cdf0e10cSrcweir     csv_assert(pScope != 0);
159cdf0e10cSrcweir     if (i_bIsStatic)
160cdf0e10cSrcweir         pScope->Add_LocalStaticOperation(i_sLocalName, i_nId);
161cdf0e10cSrcweir     else
162cdf0e10cSrcweir         pScope->Add_LocalOperation(i_sLocalName, i_nId);
163cdf0e10cSrcweir }
164cdf0e10cSrcweir 
165cdf0e10cSrcweir void
do_Add_Variable(const String & i_sLocalName,Cid i_nId,bool,bool i_bIsStatic)166cdf0e10cSrcweir Owner_Class::do_Add_Variable( const String  &     i_sLocalName,
167cdf0e10cSrcweir                               Cid                 i_nId,
168cdf0e10cSrcweir                               bool                ,
169cdf0e10cSrcweir                               bool                i_bIsStatic )
170cdf0e10cSrcweir {
171cdf0e10cSrcweir     csv_assert(pScope != 0);
172cdf0e10cSrcweir     if (i_bIsStatic)
173cdf0e10cSrcweir         pScope->Add_LocalStaticData(i_sLocalName, i_nId);
174cdf0e10cSrcweir     else
175cdf0e10cSrcweir         pScope->Add_LocalData(i_sLocalName, i_nId);
176cdf0e10cSrcweir }
177cdf0e10cSrcweir 
178cdf0e10cSrcweir Cid
inq_CeId() const179cdf0e10cSrcweir Owner_Class::inq_CeId() const
180cdf0e10cSrcweir {
181cdf0e10cSrcweir     csv_assert(pScope != 0);
182cdf0e10cSrcweir     return pScope->CeId();
183cdf0e10cSrcweir }
184cdf0e10cSrcweir 
185cdf0e10cSrcweir 
186cdf0e10cSrcweir }   // namespace cpp
187