1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir #ifndef ARY_IDL_IA_CE_HXX 29*cdf0e10cSrcweir #define ARY_IDL_IA_CE_HXX 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir // USED SERVICES 33*cdf0e10cSrcweir // BASE CLASSES 34*cdf0e10cSrcweir #include <ary/idl/ip_ce.hxx> 35*cdf0e10cSrcweir // COMPONENTS 36*cdf0e10cSrcweir // PARAMETERS 37*cdf0e10cSrcweir 38*cdf0e10cSrcweir 39*cdf0e10cSrcweir namespace ary 40*cdf0e10cSrcweir { 41*cdf0e10cSrcweir namespace idl 42*cdf0e10cSrcweir { 43*cdf0e10cSrcweir 44*cdf0e10cSrcweir class Ce_Storage; 45*cdf0e10cSrcweir class TypeAdmin; 46*cdf0e10cSrcweir 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir /** @resp 49*cdf0e10cSrcweir Implements ::ary::idl::CePilot. Provides the access logic for all 50*cdf0e10cSrcweir IDL code entities. 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir @collab Ce_Storage 53*cdf0e10cSrcweir @collab TypeAdmin 54*cdf0e10cSrcweir 55*cdf0e10cSrcweir @see CodeEntity 56*cdf0e10cSrcweir */ 57*cdf0e10cSrcweir class CeAdmin : public CePilot 58*cdf0e10cSrcweir { 59*cdf0e10cSrcweir public: 60*cdf0e10cSrcweir // LIFECYCLE 61*cdf0e10cSrcweir CeAdmin( 62*cdf0e10cSrcweir NameLookup & io_rNameDictionary, 63*cdf0e10cSrcweir TypeAdmin & io_rTypePilot ); 64*cdf0e10cSrcweir virtual ~CeAdmin(); 65*cdf0e10cSrcweir 66*cdf0e10cSrcweir // OPERATIONS 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir // INQUIRY 69*cdf0e10cSrcweir const Ce_Storage & Storage() const; 70*cdf0e10cSrcweir 71*cdf0e10cSrcweir // ACCESS 72*cdf0e10cSrcweir Ce_Storage & Storage(); 73*cdf0e10cSrcweir 74*cdf0e10cSrcweir // INHERITED 75*cdf0e10cSrcweir // Interface ::ary::idl::CePilot: 76*cdf0e10cSrcweir virtual Module & CheckIn_Module( 77*cdf0e10cSrcweir Ce_id i_nParentId, 78*cdf0e10cSrcweir const String & i_sName ); 79*cdf0e10cSrcweir virtual Service & Store_Service( 80*cdf0e10cSrcweir Ce_id i_nOwner, 81*cdf0e10cSrcweir const String & i_sName ); 82*cdf0e10cSrcweir virtual SglIfcService & 83*cdf0e10cSrcweir Store_SglIfcService( 84*cdf0e10cSrcweir Ce_id i_nOwner, 85*cdf0e10cSrcweir const String & i_sName, 86*cdf0e10cSrcweir Type_id i_nBaseInterface ); 87*cdf0e10cSrcweir virtual Interface & Store_Interface( 88*cdf0e10cSrcweir Ce_id i_nOwner, 89*cdf0e10cSrcweir const String & i_sName, 90*cdf0e10cSrcweir Type_id i_nBase ); 91*cdf0e10cSrcweir virtual Struct & Store_Struct( 92*cdf0e10cSrcweir Ce_id i_nOwner, 93*cdf0e10cSrcweir const String & i_sName, 94*cdf0e10cSrcweir Type_id i_nBase, 95*cdf0e10cSrcweir const String & i_sTemplateParam ); 96*cdf0e10cSrcweir virtual Exception & Store_Exception( 97*cdf0e10cSrcweir Ce_id i_nOwner, 98*cdf0e10cSrcweir const String & i_sName, 99*cdf0e10cSrcweir Type_id i_nBase ); 100*cdf0e10cSrcweir virtual Enum & Store_Enum( 101*cdf0e10cSrcweir Ce_id i_nOwner, 102*cdf0e10cSrcweir const String & i_sName ); 103*cdf0e10cSrcweir virtual Typedef & Store_Typedef( 104*cdf0e10cSrcweir Ce_id i_nOwner, 105*cdf0e10cSrcweir const String & i_sName, 106*cdf0e10cSrcweir Type_id i_nDefiningType ); 107*cdf0e10cSrcweir virtual ConstantsGroup & 108*cdf0e10cSrcweir Store_ConstantsGroup( 109*cdf0e10cSrcweir Ce_id i_nOwner, 110*cdf0e10cSrcweir const String & i_sName ); 111*cdf0e10cSrcweir virtual Singleton & Store_Singleton( 112*cdf0e10cSrcweir Ce_id i_nOwner, 113*cdf0e10cSrcweir const String & i_sName ); 114*cdf0e10cSrcweir virtual SglIfcSingleton & 115*cdf0e10cSrcweir Store_SglIfcSingleton( 116*cdf0e10cSrcweir Ce_id i_nOwner, 117*cdf0e10cSrcweir const String & i_sName, 118*cdf0e10cSrcweir Type_id i_nBaseInterface ); 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir virtual Constant & Store_Constant( 121*cdf0e10cSrcweir Ce_id i_nOwner, 122*cdf0e10cSrcweir const String & i_sName, 123*cdf0e10cSrcweir Type_id i_nType, 124*cdf0e10cSrcweir const String & i_sValue ); 125*cdf0e10cSrcweir virtual Property & Store_Property( 126*cdf0e10cSrcweir Ce_id i_nOwner, 127*cdf0e10cSrcweir const String & i_sName, 128*cdf0e10cSrcweir Type_id i_nType, 129*cdf0e10cSrcweir Property::Stereotypes 130*cdf0e10cSrcweir i_stereotypes ); 131*cdf0e10cSrcweir virtual Function & Store_Function( 132*cdf0e10cSrcweir Ce_id i_nOwner, 133*cdf0e10cSrcweir const String & i_sName, 134*cdf0e10cSrcweir Type_id i_nReturnType, 135*cdf0e10cSrcweir bool i_bOneWay ); 136*cdf0e10cSrcweir virtual Function & Store_ServiceConstructor( 137*cdf0e10cSrcweir Ce_id i_nOwner, 138*cdf0e10cSrcweir const String & i_sName ); 139*cdf0e10cSrcweir virtual StructElement & 140*cdf0e10cSrcweir Store_StructMember( 141*cdf0e10cSrcweir Ce_id i_nOwner, 142*cdf0e10cSrcweir const String & i_sName, 143*cdf0e10cSrcweir Type_id i_nType ); 144*cdf0e10cSrcweir virtual StructElement & 145*cdf0e10cSrcweir Store_ExceptionMember( 146*cdf0e10cSrcweir Ce_id i_nOwner, 147*cdf0e10cSrcweir const String & i_sName, 148*cdf0e10cSrcweir Type_id i_nType ); 149*cdf0e10cSrcweir virtual EnumValue & Store_EnumValue( 150*cdf0e10cSrcweir Ce_id i_nOwner, 151*cdf0e10cSrcweir const String & i_sName, 152*cdf0e10cSrcweir const String & i_sValue ); 153*cdf0e10cSrcweir virtual Attribute & Store_Attribute( 154*cdf0e10cSrcweir Ce_id i_nOwner, 155*cdf0e10cSrcweir const String & i_sName, 156*cdf0e10cSrcweir Type_id i_nType, 157*cdf0e10cSrcweir bool i_bReadOnly, 158*cdf0e10cSrcweir bool i_bBound ); 159*cdf0e10cSrcweir 160*cdf0e10cSrcweir virtual const Module & 161*cdf0e10cSrcweir GlobalNamespace() const; 162*cdf0e10cSrcweir virtual const CodeEntity & 163*cdf0e10cSrcweir Find_Ce( 164*cdf0e10cSrcweir Ce_id i_nId ) const; 165*cdf0e10cSrcweir virtual const Module & 166*cdf0e10cSrcweir Find_Module( 167*cdf0e10cSrcweir Ce_id i_nId ) const; 168*cdf0e10cSrcweir virtual const Module * 169*cdf0e10cSrcweir Search_Module( 170*cdf0e10cSrcweir Ce_id i_nId ) const; 171*cdf0e10cSrcweir virtual const Function & 172*cdf0e10cSrcweir Find_Function( 173*cdf0e10cSrcweir Ce_id i_nId ) const; 174*cdf0e10cSrcweir virtual const Property & 175*cdf0e10cSrcweir Find_Property( 176*cdf0e10cSrcweir Ce_id i_nId ) const; 177*cdf0e10cSrcweir virtual const EnumValue & 178*cdf0e10cSrcweir Find_EnumValue( 179*cdf0e10cSrcweir Ce_id i_nId ) const; 180*cdf0e10cSrcweir virtual const Constant & 181*cdf0e10cSrcweir Find_Constant( 182*cdf0e10cSrcweir Ce_id i_nId ) const; 183*cdf0e10cSrcweir virtual const StructElement & 184*cdf0e10cSrcweir Find_StructElement( 185*cdf0e10cSrcweir Ce_id i_nId ) const; 186*cdf0e10cSrcweir virtual void Get_Text( 187*cdf0e10cSrcweir StringVector & o_module, 188*cdf0e10cSrcweir String & o_ce, 189*cdf0e10cSrcweir String & o_member, 190*cdf0e10cSrcweir const CodeEntity & i_ce ) const; 191*cdf0e10cSrcweir virtual const NameLookup & 192*cdf0e10cSrcweir NameDictionary() const; 193*cdf0e10cSrcweir virtual void Get_AlphabeticalIndex( 194*cdf0e10cSrcweir std::vector<Ce_id> & 195*cdf0e10cSrcweir o_rResult, 196*cdf0e10cSrcweir alphabetical_index::E_Letter 197*cdf0e10cSrcweir i_cLetter) const; 198*cdf0e10cSrcweir // ACCESS 199*cdf0e10cSrcweir virtual Module & GlobalNamespace(); 200*cdf0e10cSrcweir virtual CodeEntity & 201*cdf0e10cSrcweir Find_Ce( 202*cdf0e10cSrcweir Ce_id i_nId ); 203*cdf0e10cSrcweir private: 204*cdf0e10cSrcweir // Locals 205*cdf0e10cSrcweir Module & lhf_Access_Module( 206*cdf0e10cSrcweir Ce_id i_nId ); 207*cdf0e10cSrcweir void lhf_Put2Storage_and_AssignId( 208*cdf0e10cSrcweir CodeEntity & pass_io_rCe ); 209*cdf0e10cSrcweir void lhf_Store_NewEntity( 210*cdf0e10cSrcweir DYN CodeEntity & pass_io_rCe, 211*cdf0e10cSrcweir Module & i_rOwner ); 212*cdf0e10cSrcweir void lhf_Store_NewEntity( 213*cdf0e10cSrcweir DYN CodeEntity & pass_io_rCe, 214*cdf0e10cSrcweir Ce_id i_nOwnerModule ); 215*cdf0e10cSrcweir void get_ModuleText( 216*cdf0e10cSrcweir StringVector & o_module, 217*cdf0e10cSrcweir const CodeEntity & i_ce ) const; 218*cdf0e10cSrcweir Struct & lhf_Store_TplStruct( 219*cdf0e10cSrcweir Ce_id i_nOwner, 220*cdf0e10cSrcweir const String & i_sName, 221*cdf0e10cSrcweir Type_id i_nBase, 222*cdf0e10cSrcweir const String & i_sTemplateParam ); 223*cdf0e10cSrcweir 224*cdf0e10cSrcweir const Ce_Storage & my_Storage() const; 225*cdf0e10cSrcweir Ce_Storage & my_Storage(); 226*cdf0e10cSrcweir NameLookup & my_NameDictionary() { return *pNameDictionary; } 227*cdf0e10cSrcweir 228*cdf0e10cSrcweir // DATA 229*cdf0e10cSrcweir Dyn<Ce_Storage> pStorage; /// @inv pStorage != 0; 230*cdf0e10cSrcweir Module * pGlobalNamespace; 231*cdf0e10cSrcweir NameLookup * pNameDictionary; 232*cdf0e10cSrcweir TypeAdmin * pTypePilot; 233*cdf0e10cSrcweir }; 234*cdf0e10cSrcweir 235*cdf0e10cSrcweir 236*cdf0e10cSrcweir // IMPLEMENTATION 237*cdf0e10cSrcweir inline const Ce_Storage & 238*cdf0e10cSrcweir CeAdmin::Storage() const 239*cdf0e10cSrcweir { 240*cdf0e10cSrcweir return *pStorage; 241*cdf0e10cSrcweir } 242*cdf0e10cSrcweir 243*cdf0e10cSrcweir inline Ce_Storage & 244*cdf0e10cSrcweir CeAdmin::Storage() 245*cdf0e10cSrcweir { 246*cdf0e10cSrcweir return *pStorage; 247*cdf0e10cSrcweir } 248*cdf0e10cSrcweir 249*cdf0e10cSrcweir 250*cdf0e10cSrcweir 251*cdf0e10cSrcweir } // namespace idl 252*cdf0e10cSrcweir } // namespace ary 253*cdf0e10cSrcweir #endif 254