1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 24 #ifndef ARY_IDL_IA_CE_HXX 25 #define ARY_IDL_IA_CE_HXX 26 27 28 // USED SERVICES 29 // BASE CLASSES 30 #include <ary/idl/ip_ce.hxx> 31 // COMPONENTS 32 // PARAMETERS 33 34 35 namespace ary 36 { 37 namespace idl 38 { 39 40 class Ce_Storage; 41 class TypeAdmin; 42 43 44 /** @resp 45 Implements ::ary::idl::CePilot. Provides the access logic for all 46 IDL code entities. 47 48 @collab Ce_Storage 49 @collab TypeAdmin 50 51 @see CodeEntity 52 */ 53 class CeAdmin : public CePilot 54 { 55 public: 56 // LIFECYCLE 57 CeAdmin( 58 NameLookup & io_rNameDictionary, 59 TypeAdmin & io_rTypePilot ); 60 virtual ~CeAdmin(); 61 62 // OPERATIONS 63 64 // INQUIRY 65 const Ce_Storage & Storage() const; 66 67 // ACCESS 68 Ce_Storage & Storage(); 69 70 // INHERITED 71 // Interface ::ary::idl::CePilot: 72 virtual Module & CheckIn_Module( 73 Ce_id i_nParentId, 74 const String & i_sName ); 75 virtual Service & Store_Service( 76 Ce_id i_nOwner, 77 const String & i_sName ); 78 virtual SglIfcService & 79 Store_SglIfcService( 80 Ce_id i_nOwner, 81 const String & i_sName, 82 Type_id i_nBaseInterface ); 83 virtual Interface & Store_Interface( 84 Ce_id i_nOwner, 85 const String & i_sName, 86 Type_id i_nBase ); 87 virtual Struct & Store_Struct( 88 Ce_id i_nOwner, 89 const String & i_sName, 90 Type_id i_nBase, 91 const String & i_sTemplateParam ); 92 virtual Exception & Store_Exception( 93 Ce_id i_nOwner, 94 const String & i_sName, 95 Type_id i_nBase ); 96 virtual Enum & Store_Enum( 97 Ce_id i_nOwner, 98 const String & i_sName ); 99 virtual Typedef & Store_Typedef( 100 Ce_id i_nOwner, 101 const String & i_sName, 102 Type_id i_nDefiningType ); 103 virtual ConstantsGroup & 104 Store_ConstantsGroup( 105 Ce_id i_nOwner, 106 const String & i_sName ); 107 virtual Singleton & Store_Singleton( 108 Ce_id i_nOwner, 109 const String & i_sName ); 110 virtual SglIfcSingleton & 111 Store_SglIfcSingleton( 112 Ce_id i_nOwner, 113 const String & i_sName, 114 Type_id i_nBaseInterface ); 115 116 virtual Constant & Store_Constant( 117 Ce_id i_nOwner, 118 const String & i_sName, 119 Type_id i_nType, 120 const String & i_sValue ); 121 virtual Property & Store_Property( 122 Ce_id i_nOwner, 123 const String & i_sName, 124 Type_id i_nType, 125 Property::Stereotypes 126 i_stereotypes ); 127 virtual Function & Store_Function( 128 Ce_id i_nOwner, 129 const String & i_sName, 130 Type_id i_nReturnType, 131 bool i_bOneWay ); 132 virtual Function & Store_ServiceConstructor( 133 Ce_id i_nOwner, 134 const String & i_sName ); 135 virtual StructElement & 136 Store_StructMember( 137 Ce_id i_nOwner, 138 const String & i_sName, 139 Type_id i_nType ); 140 virtual StructElement & 141 Store_ExceptionMember( 142 Ce_id i_nOwner, 143 const String & i_sName, 144 Type_id i_nType ); 145 virtual EnumValue & Store_EnumValue( 146 Ce_id i_nOwner, 147 const String & i_sName, 148 const String & i_sValue ); 149 virtual Attribute & Store_Attribute( 150 Ce_id i_nOwner, 151 const String & i_sName, 152 Type_id i_nType, 153 bool i_bReadOnly, 154 bool i_bBound ); 155 156 virtual const Module & 157 GlobalNamespace() const; 158 virtual const CodeEntity & 159 Find_Ce( 160 Ce_id i_nId ) const; 161 virtual const Module & 162 Find_Module( 163 Ce_id i_nId ) const; 164 virtual const Module * 165 Search_Module( 166 Ce_id i_nId ) const; 167 virtual const Function & 168 Find_Function( 169 Ce_id i_nId ) const; 170 virtual const Property & 171 Find_Property( 172 Ce_id i_nId ) const; 173 virtual const EnumValue & 174 Find_EnumValue( 175 Ce_id i_nId ) const; 176 virtual const Constant & 177 Find_Constant( 178 Ce_id i_nId ) const; 179 virtual const StructElement & 180 Find_StructElement( 181 Ce_id i_nId ) const; 182 virtual void Get_Text( 183 StringVector & o_module, 184 String & o_ce, 185 String & o_member, 186 const CodeEntity & i_ce ) const; 187 virtual const NameLookup & 188 NameDictionary() const; 189 virtual void Get_AlphabeticalIndex( 190 std::vector<Ce_id> & 191 o_rResult, 192 alphabetical_index::E_Letter 193 i_cLetter) const; 194 // ACCESS 195 virtual Module & GlobalNamespace(); 196 virtual CodeEntity & 197 Find_Ce( 198 Ce_id i_nId ); 199 private: 200 // Locals 201 Module & lhf_Access_Module( 202 Ce_id i_nId ); 203 void lhf_Put2Storage_and_AssignId( 204 CodeEntity & pass_io_rCe ); 205 void lhf_Store_NewEntity( 206 DYN CodeEntity & pass_io_rCe, 207 Module & i_rOwner ); 208 void lhf_Store_NewEntity( 209 DYN CodeEntity & pass_io_rCe, 210 Ce_id i_nOwnerModule ); 211 void get_ModuleText( 212 StringVector & o_module, 213 const CodeEntity & i_ce ) const; 214 Struct & lhf_Store_TplStruct( 215 Ce_id i_nOwner, 216 const String & i_sName, 217 Type_id i_nBase, 218 const String & i_sTemplateParam ); 219 220 const Ce_Storage & my_Storage() const; 221 Ce_Storage & my_Storage(); 222 NameLookup & my_NameDictionary() { return *pNameDictionary; } 223 224 // DATA 225 Dyn<Ce_Storage> pStorage; /// @inv pStorage != 0; 226 Module * pGlobalNamespace; 227 NameLookup * pNameDictionary; 228 TypeAdmin * pTypePilot; 229 }; 230 231 232 // IMPLEMENTATION 233 inline const Ce_Storage & 234 CeAdmin::Storage() const 235 { 236 return *pStorage; 237 } 238 239 inline Ce_Storage & 240 CeAdmin::Storage() 241 { 242 return *pStorage; 243 } 244 245 246 247 } // namespace idl 248 } // namespace ary 249 #endif 250