diff options
Diffstat (limited to 'autodoc/source/ary/idl')
50 files changed, 7498 insertions, 0 deletions
diff --git a/autodoc/source/ary/idl/i2s_calculator.cxx b/autodoc/source/ary/idl/i2s_calculator.cxx new file mode 100644 index 000000000000..111e9548b941 --- /dev/null +++ b/autodoc/source/ary/idl/i2s_calculator.cxx @@ -0,0 +1,992 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include "i2s_calculator.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <algorithm> +#include <string.h> +#include <cosv/file.hxx> +//#include <adc_manager.hxx> +//#include <adc_options.hxx> +#include <ary/qualiname.hxx> +#include <ary/idl/i_enum.hxx> +#include <ary/idl/i_exception.hxx> +#include <ary/idl/i_function.hxx> +#include <ary/idl/i_gate.hxx> +#include <ary/idl/i_interface.hxx> +#include <ary/idl/ik_interface.hxx> +#include <ary/idl/i_module.hxx> +#include <ary/idl/i_property.hxx> +#include <ary/idl/i_service.hxx> +#include <ary/idl/i_singleton.hxx> +#include <ary/idl/i_siservice.hxx> +#include <ary/idl/i_sisingleton.hxx> +#include <ary/idl/i_struct.hxx> +#include <ary/idl/i_structelem.hxx> +#include <ary/idl/i_typedef.hxx> +#include <ary/idl/ip_ce.hxx> +#include <ary/idl/ip_type.hxx> +#include <ary/namesort.hxx> +#include <nametreenode.hxx> +#include "i_nnfinder.hxx" +#include "ia_ce.hxx" +#include "ia_type.hxx" +#include "is_ce.hxx" +#include "is_type.hxx" +#include "it_ce.hxx" +#include "it_explicit.hxx" +#include "it_sequence.hxx" +#include "it_xnameroom.hxx" + + + +namespace ary +{ +namespace idl +{ + +template <class DEST> +DEST * +SecondariesCalculator::SearchCe4Type(Type_id i_type) +{ + Ce_id + ce = lhf_Search_CeFromTypeId(i_type); + if (ce.IsValid()) + return ary_cast<DEST>(& my_CeStorage()[ce]); + return 0; +} + + +typedef stg::const_iterator<CodeEntity> stg_citerator; +typedef stg::iterator<CodeEntity> stg_iterator; + +typedef stg::filter_iterator<CodeEntity,Interface> + interface_iterator; + +typedef stg::filter_iterator<Type,ExplicitType> + explicittype_iterator; + +typedef ary::stg::const_filter_iterator<CodeEntity,Typedef> + typedef_citerator; + + +inline Service * +SecondariesCalculator::lhf_SearchService( Type_id i_nType ) +{ + return SearchCe4Type<Service>(i_nType); +} + +inline Interface * +SecondariesCalculator::lhf_SearchInterface( Type_id i_nType ) +{ + return SearchCe4Type<Interface>(i_nType); +} + +inline Struct * +SecondariesCalculator::lhf_SearchStruct( Type_id i_nType ) +{ + return SearchCe4Type<Struct>(i_nType); +} + +inline Exception * +SecondariesCalculator::lhf_SearchException( Type_id i_nType ) +{ + return SearchCe4Type<Exception>(i_nType); +} + +inline const Ce_Storage & +SecondariesCalculator::my_CeStorage() const +{ + csv_assert(pCes != 0); + return pCes->Storage(); +} + +inline const Type_Storage & +SecondariesCalculator::my_TypeStorage() const +{ + csv_assert(pTypes != 0); + return pTypes->Storage(); +} + +inline Ce_Storage & +SecondariesCalculator::my_CeStorage() +{ + csv_assert(pCes != 0); + return pCes->Storage(); +} + +inline Type_Storage & +SecondariesCalculator::my_TypeStorage() +{ + csv_assert(pTypes != 0); + return pTypes->Storage(); +} + +inline void +SecondariesCalculator::insert_into2sList( CodeEntity & o_out, + int i_listIndex, + Ce_id i_nCe ) + { o_out.Secondaries().Access_List(i_listIndex).push_back(i_nCe); } + + +SecondariesCalculator::SecondariesCalculator( CeAdmin & i_ces, + TypeAdmin & i_types ) + : pCes(&i_ces), + pTypes(&i_types) +{ +} + +SecondariesCalculator::~SecondariesCalculator() +{ +} + + +void +SecondariesCalculator::CheckAllInterfaceBases() +{ + Module & + rGlobalNamespace = pCes->GlobalNamespace(); + QualifiedName + aXInterface("::com::sun::star::uno::XInterface","::"); + + const Type & + rType = pTypes->CheckIn_Type( aXInterface, + 0, + rGlobalNamespace.CeId(), + 0 ); + Type_id + nTypeXInterface = rType.TypeId(); + const ExplicitType & + rExplType = ary_cast<ExplicitType>(rType); + Ce_id + nCeXInterface = lhf_Search_CeForType(rExplType); + + interface_iterator itEnd( my_CeStorage().End() ); + for ( interface_iterator it( my_CeStorage().BeginUnreserved() ); + it != itEnd; + ++it ) + { + if (NOT it.IsValid()) + continue; + + Interface & + rInterface = *it; + if ( NOT rInterface.HasBase() // According to UNO IDL syntax, an interface without base has com::sun::star::uno::XInterface as base. + AND rInterface.CeId() != nCeXInterface ) // XInterface must not be base of itself. + { + rInterface.Add_Base(nTypeXInterface, 0); + } + } // end for +} + +void +SecondariesCalculator::Connect_Types2Ces() +{ + explicittype_iterator itEnd( my_TypeStorage().End() ); + for ( explicittype_iterator it( my_TypeStorage().BeginUnreserved() ); + it != itEnd; + ++it ) + { + if (NOT it.IsValid()) + continue; + + ExplicitType & + rType = ary_cast<ExplicitType>(*it); + Ce_id + nRelatedCe = lhf_Search_CeForType(rType); + if (nRelatedCe.IsValid()) + { + Ce_Type * + pNew = new Ce_Type(nRelatedCe, rType.TemplateParameters()); + my_TypeStorage().Replace_Entity( rType.TypeId(), + *pNew ); + } + } // end for +} + +void +SecondariesCalculator::Gather_CrossReferences() +{ + gather_Synonyms(); + + for ( stg_iterator it = my_CeStorage().Begin(); + it != my_CeStorage().End(); + ++it ) + { + (*it).Accept( static_cast< SPInst_asHost& >(*this) ); + + } // end for + + sort_All2s(); +} + +void +SecondariesCalculator::Make_Links2DeveloperManual( + const String & i_devman_reffilepath ) +{ +// const autodoc::Options & +// rOptions = TheAutodocManager().TheOptions(); +// +// const String & +// rDeveloperManual_URL +// = rOptions.Get_Extra(autodoc::OPT_developer_guide); +// const String +// rDeveloperManual_ReferenceFile +// = rOptions.Get_Extra(autodoc::OPT_developer_guide_refs_file); + +// if ( rDeveloperManual_URL.length() == 0 +// OR +// rDeveloperManual_ReferenceFile.length() == 0 ) +// { +// return; +// } + + csv::File + aFile(i_devman_reffilepath, csv::CFM_READ); + csv::OpenCloseGuard + aFileOpener(aFile); + if (aFileOpener) + { + Read_Links2DevManual(aFile); + } +} + +namespace +{ + +enum E_LinkMode +{ + link2descr, + link2ref +}; + +struct OrderCeIdsByName +{ + OrderCeIdsByName( + const Ce_Storage & i_storage ) + : rStorage(i_storage), + aNameComparison() {} + bool operator()( + Ce_id i_ce1, + Ce_id i_ce2 ) const + { + return aNameComparison( rStorage[i_ce1].LocalName(), + rStorage[i_ce2].LocalName() ); + } + + private: + const Ce_Storage & rStorage; + LesserName aNameComparison; +}; + + +} + + + +void +SecondariesCalculator::do_Process( const Service & i_rData ) +{ + const Service & + rService = ary_cast<Service>(i_rData); + + // Interfaces: + assignImplementation_toAServicesInterfaces( rService.CeId(), + rService.CeId(), + interface_2s_ExportingServices ); + // Services and their interfaces: + recursive_AssignIncludingService(rService.CeId(), rService); +} + +void +SecondariesCalculator::do_Process( const Interface & i_rData ) +{ + assign_AsDerivedInterface( ary_cast<Interface>(i_rData) ); +} + +void +SecondariesCalculator::do_Process( const Struct & i_rData ) +{ + assign_AsDerivedStruct( ary_cast<Struct>(i_rData) ); +} + +void +SecondariesCalculator::do_Process( const Exception & i_rData ) +{ + assign_AsDerivedException( ary_cast<Exception>(i_rData) ); +} + +void +SecondariesCalculator::do_Process( const Typedef & ) +{ + // KORR_FUTURE + // Find out what was meant here ??? + +// const Typedef & +// rTypedef = ary_cast<Typedef>(i_rData); +} + +void +SecondariesCalculator::do_Process( const Singleton & i_rData ) +{ + const Singleton & + rSingleton = ary_cast<Singleton>(i_rData); + + Service * + pServ = lhf_SearchService(rSingleton.AssociatedService()); + if (pServ != 0) + { + insert_into2sUnique( *pServ, + service_2s_InstantiatingSingletons, + rSingleton.CeId() ); + } + + // Interfaces: + assignImplementation_toAServicesInterfaces( rSingleton.CeId(), + lhf_Search_CeFromTypeId(rSingleton.AssociatedService()), + interface_2s_ExportingSingletons ); +} + +void +SecondariesCalculator::do_Process( const SglIfcService & i_rData ) +{ + const SglIfcService & + rSglIfcService = ary_cast<SglIfcService>(i_rData); + + assignImplementation_toAServicesInterfaces( rSglIfcService.CeId(), + rSglIfcService.CeId(), + interface_2s_ExportingServices ); +} + +void +SecondariesCalculator::do_Process( const SglIfcSingleton & i_rData ) +{ + const SglIfcSingleton & + rSglIfcSingleton = ary_cast<SglIfcSingleton>(i_rData); + + Type_id nBase = rSglIfcSingleton.BaseInterface(); + recursive_AssignImplementation_toExportedInterface( rSglIfcSingleton.CeId(), + nBase, + interface_2s_ExportingSingletons ); +} + +void +SecondariesCalculator::do_Process( const Function & i_rData ) +{ + const Function & + rFunction = ary_cast<Function>(i_rData); + + recursive_AssignFunction_toCeAsReturn(rFunction.CeId(), rFunction.ReturnType()); + + for ( Function::ParamList::const_iterator itp = rFunction.Parameters().begin(); + itp != rFunction.Parameters().end(); + ++itp ) + { + recursive_AssignFunction_toCeAsParameter(rFunction.CeId(), (*itp).Type()); + } // end for (itp) + + for ( Function::ExceptionList::const_iterator itx = rFunction.Exceptions().begin(); + itx != rFunction.Exceptions().end(); + ++itx ) + { + Exception * + pX = lhf_SearchException(*itx); + if (pX != 0) + { + insert_into2sUnique(*pX, exception_2s_RaisingFunctions, rFunction.CeId()); + } + } // end for (itx) +} + +void +SecondariesCalculator::do_Process( const StructElement & i_rData ) +{ + const StructElement & + rStructElement = ary_cast<StructElement>(i_rData); + + recursive_AssignStructElement_toCeAsDataType(rStructElement.CeId(), rStructElement.Type()); +} + +void +SecondariesCalculator::do_Process( const Property & i_rData ) +{ + const Property & + rProperty = ary_cast<Property>(i_rData); + + recursive_AssignStructElement_toCeAsDataType(rProperty.CeId(), rProperty.Type()); +} + +Ce_id +SecondariesCalculator::lhf_Search_CeForType( const ExplicitType & i_rType ) const +{ + const ExplicitNameRoom & + rExplicitNameRoom = ary_cast<ExplicitNameRoom>( + my_TypeStorage()[i_rType.NameRoom()] ); + Find_ModuleNode + rNodeFinder( my_CeStorage(), + rExplicitNameRoom.NameChain_Begin(), + rExplicitNameRoom.NameChain_End(), + i_rType.Name() ); + + if ( rExplicitNameRoom.IsAbsolute() ) + { + const Module & + rGlobalNamespace = ary_cast<Module>( + my_CeStorage()[predefined::ce_GlobalNamespace]); + return Search_SubTree( rGlobalNamespace, + rNodeFinder ); + } + else + { + const Module & + rStartModule = ary_cast<Module>( + my_CeStorage()[i_rType.ModuleOfOccurrence()]); + Ce_id ret = Search_SubTree_UpTillRoot( rStartModule, + rNodeFinder ); + return ret; + } // endif (rExplicitNameRoom.IsAbsolute()) else +} + +Ce_id +SecondariesCalculator::lhf_Search_CeFromTypeId( Type_id i_nType ) const +{ + if (NOT i_nType.IsValid()) + return Ce_id(0); + const Ce_Type * + pType = ary_cast<Ce_Type>( & my_TypeStorage()[i_nType] ); + return pType != 0 + ? pType->RelatedCe() + : Ce_id_Null(); +} + +void +SecondariesCalculator::assign_CurLink( char * i_text, + const String & i_link, + const String & i_linkUI, + bool i_isDescr, + int i_lineCount ) +{ + csv_assert(i_text != 0); + + const ary::idl::Module * + pModule = & ary_cast<Module>( + my_CeStorage()[predefined::ce_GlobalNamespace]); + + char * pPastNext = 0; + char * pNext = i_text; + for ( ; + (pPastNext = strstr(pNext,".")) != 0; + pNext = pPastNext + 1 ) + { + String sNext(pNext, pPastNext-pNext); + Ce_id nModule = pModule->Search_Name(sNext); + if (nModule.IsValid()) + { + pModule = ary_cast<Module>( & my_CeStorage()[nModule] ); + } + else + { + pModule = 0; + } + + if (pModule == 0) + { + Cerr() << "Warning: Invalid line nr. " + << i_lineCount + << " in DevelopersGuide reference file:\n" + << reinterpret_cast< const char* >(i_text) + << "\n" + << Endl(); + return; + } + } // end for + + pPastNext = strchr(pNext,':'); + bool bMember = pPastNext != 0; + String sCe( pNext, (bMember ? csv::str::size(pPastNext-pNext) : csv::str::maxsize) ); + +// KORR_FUTURE +// String sMember(bMember ? pPastNext+1, ""); + + Ce_id nCe = pModule->Search_Name(sCe); + if (NOT nCe.IsValid()) + { + Cerr() << "Warning: Invalid line nr. " + << i_lineCount + << " in DevelopersGuide reference file:\n" + << reinterpret_cast< const char* >(i_text) + << "\n" + << Endl(); + return; + } + + CodeEntity & + rCe = my_CeStorage()[nCe]; + if (NOT bMember) + { + if (i_isDescr) + rCe.Secondaries().Add_Link2DescriptionInManual(i_link, i_linkUI); + else + rCe.Secondaries().Add_Link2RefInManual(i_link, i_linkUI); + return; + } + else + { + // KORR_FUTURE + // Provisorial just doing nothing (or may be + // adding a link at main Ces lists). +// if (i_isDescr) +// rCe.Secondaries().Add_Link2DescriptionInManual(i_link); +// else +// rCe.Secondaries().Add_Link2RefInManual(i_link); + } +} + +void +SecondariesCalculator::gather_Synonyms() +{ + const Ce_Storage & + cstrg = my_CeStorage(); + typedef_citerator itEnd(cstrg.End()); + for ( typedef_citerator it(cstrg.Begin()); + it != itEnd; + ++it ) + { + if (NOT it.IsValid()) + continue; + + const Typedef & + rTypedef = *it; + recursive_AssignAsSynonym(rTypedef.CeId(), rTypedef); + } // end for (itTd) +} + +void +SecondariesCalculator::recursive_AssignAsSynonym( Ce_id i_synonymousTypedefsId, + const Typedef & i_TypedefToCheck ) +{ + Ce_id + nCe = lhf_Search_CeFromTypeId(i_TypedefToCheck.DefiningType()); + if (NOT nCe.IsValid()) + return; + CodeEntity & + rCe = my_CeStorage()[nCe]; + + switch (rCe.AryClass()) // KORR_FUTURE: make this faster, remove switch. + { + case Interface::class_id: + insert_into2sList( rCe, + interface_2s_SynonymTypedefs, + i_synonymousTypedefsId ); + break; + case Struct::class_id: + insert_into2sList( rCe, + struct_2s_SynonymTypedefs, + i_synonymousTypedefsId ); + break; + case Enum::class_id: + insert_into2sList( rCe, + enum_2s_SynonymTypedefs, + i_synonymousTypedefsId ); + break; + case Typedef::class_id: + insert_into2sList( rCe, + typedef_2s_SynonymTypedefs, + i_synonymousTypedefsId ); + recursive_AssignAsSynonym( i_synonymousTypedefsId, + static_cast< Typedef& >(rCe) ); + break; + // default: do nothing. + } +} + +void +SecondariesCalculator::recursive_AssignIncludingService( Ce_id i_includingServicesId, + const Service & i_ServiceToCheckItsIncludes ) +{ + Dyn_StdConstIterator<CommentedRelation> + pIncludedServices; + i_ServiceToCheckItsIncludes.Get_IncludedServices(pIncludedServices); + + for ( StdConstIterator<CommentedRelation> & + itServ = *pIncludedServices; + itServ; + ++itServ ) + { + Service * + pServ = lhf_SearchService((*itServ).Type()); + if (pServ != 0) + { + insert_into2sUnique( *pServ, + service_2s_IncludingServices, + i_includingServicesId + ); + recursive_AssignIncludingService(i_includingServicesId, *pServ); + + } // end if + + assignImplementation_toAServicesInterfaces( i_includingServicesId, + lhf_Search_CeFromTypeId( (*itServ).Type() ), + interface_2s_ExportingServices ); + } // end for +} + +void +SecondariesCalculator::assign_AsDerivedInterface( const Interface & i_rDerived ) +{ + ary::Dyn_StdConstIterator<ary::idl::CommentedRelation> + pHelp; + ary::idl::ifc_interface::attr::Get_Bases(pHelp, i_rDerived); + + for ( ary::StdConstIterator<ary::idl::CommentedRelation> & it = *pHelp; + it.operator bool(); + ++it ) + { + Interface * + pIfc = lhf_SearchInterface( (*it).Type() ); + if (pIfc == 0) + continue; + + insert_into2sList( *pIfc, + interface_2s_Derivations, + i_rDerived.CeId() ); + } // end for +} + +void +SecondariesCalculator::assign_AsDerivedStruct( const Struct & i_rDerived ) +{ + Type_id + nBase = i_rDerived.Base(); + if (nBase.IsValid()) + { + Struct * + pParent = lhf_SearchStruct(nBase); + if (pParent != 0) + { + insert_into2sList( *pParent, + struct_2s_Derivations, + i_rDerived.CeId() ); + } + } +} + +void +SecondariesCalculator::assign_AsDerivedException( const Exception & i_rDerived ) +{ + Type_id + nBase = i_rDerived.Base(); + if (nBase.IsValid()) + { + Exception * + pParent = lhf_SearchException(nBase); + if (pParent != 0) + { + insert_into2sList( *pParent, + exception_2s_Derivations, + i_rDerived.CeId() ); + } // end if + } // end if +} + +void +SecondariesCalculator::assignImplementation_toAServicesInterfaces( + Ce_id i_nImpl, + Ce_id i_nService, + E_2s_of_Interface i_eList ) +{ + if (NOT i_nService.IsValid()) + return; + Service * + pService = ary_cast<Service>( & my_CeStorage()[i_nService] ); + SglIfcService * + pSglIfcService = ary_cast<SglIfcService>( & my_CeStorage()[i_nService] ); + + if (pService != 0) + { + Dyn_StdConstIterator<CommentedRelation> + pSupportedInterfaces; + pService->Get_SupportedInterfaces(pSupportedInterfaces); + + for ( StdConstIterator<CommentedRelation> & + itInfc = *pSupportedInterfaces; + itInfc.operator bool(); + ++itInfc ) + { + recursive_AssignImplementation_toExportedInterface( i_nImpl, + (*itInfc).Type(), + i_eList ); + } // end for + } + else if (pSglIfcService != 0) + { + Type_id nBase = pSglIfcService->BaseInterface(); + recursive_AssignImplementation_toExportedInterface( i_nImpl, + nBase, + i_eList ); + } // end if +} + +void +SecondariesCalculator::recursive_AssignImplementation_toExportedInterface( + Ce_id i_nService, + Type_id i_nExportedInterface, + E_2s_of_Interface i_eList ) +{ + Interface * + pIfc = lhf_SearchInterface(i_nExportedInterface); + if (pIfc == 0) + return; + + insert_into2sUnique( *pIfc, + i_eList, + i_nService ); + Dyn_StdConstIterator<CommentedRelation> + pBases; + ary::idl::ifc_interface::attr::Get_Bases(pBases, *pIfc); + for ( StdConstIterator<CommentedRelation> & it = *pBases; + it.operator bool(); + ++it ) + { + recursive_AssignImplementation_toExportedInterface(i_nService, (*it).Type(), i_eList); + } +} + +void +SecondariesCalculator::recursive_AssignFunction_toCeAsReturn( Ce_id i_nFunction, + Type_id i_nReturnType ) +{ + Ce_id + nCe = lhf_Search_CeFromTypeId(i_nReturnType); + if (NOT nCe.IsValid()) + return; + + CodeEntity & + rCe = my_CeStorage()[nCe]; + switch (rCe.AryClass()) // KORR_FUTURE: make this faster, remove switch. + { + case Interface::class_id: + insert_into2sList( rCe, + interface_2s_AsReturns, + i_nFunction ); + break; + case Struct::class_id: + insert_into2sList( rCe, + struct_2s_AsReturns, + i_nFunction ); + break; + case Enum::class_id: + insert_into2sList( rCe, + enum_2s_AsReturns, + i_nFunction ); + break; + case Typedef::class_id: + insert_into2sList( rCe, + typedef_2s_AsReturns, + i_nFunction ); + recursive_AssignFunction_toCeAsReturn( i_nFunction, + static_cast< Typedef& >(rCe).DefiningType() ); + break; + // default: do nothing. + } +} + +void +SecondariesCalculator::recursive_AssignFunction_toCeAsParameter( Ce_id i_nFunction, + Type_id i_nParameterType ) +{ + Ce_id + nCe = lhf_Search_CeFromTypeId(i_nParameterType); + if (NOT nCe.IsValid()) + return; + + CodeEntity & + rCe = my_CeStorage()[nCe]; + switch (rCe.AryClass()) // KORR_FUTURE: make this faster, remove switch. + { + case Interface::class_id: + insert_into2sList( rCe, + interface_2s_AsParameters, + i_nFunction ); + break; + case Struct::class_id: + insert_into2sList( rCe, + struct_2s_AsParameters, + i_nFunction ); + break; + case Enum::class_id: + insert_into2sList( rCe, + enum_2s_AsParameters, + i_nFunction ); + break; + case Typedef::class_id: + insert_into2sList( rCe, + typedef_2s_AsParameters, + i_nFunction ); + recursive_AssignFunction_toCeAsParameter( i_nFunction, + static_cast< Typedef& >(rCe).DefiningType() ); + break; + // default: do nothing. + } +} + +void +SecondariesCalculator::recursive_AssignStructElement_toCeAsDataType( Ce_id i_nDataElement, + Type_id i_nDataType ) +{ + Ce_id + nCe = lhf_Search_CeFromTypeId(i_nDataType); + if (NOT nCe.IsValid()) + return; + + CodeEntity & + rCe = my_CeStorage()[nCe]; + switch (rCe.AryClass()) // KORR_FUTURE: make this faster, remove switch. + { + case Interface::class_id: + insert_into2sList( rCe, + interface_2s_AsDataTypes, + i_nDataElement ); + break; + case Struct::class_id: + insert_into2sList( rCe, + struct_2s_AsDataTypes, + i_nDataElement ); + break; + case Enum::class_id: + insert_into2sList( rCe, + enum_2s_AsDataTypes, + i_nDataElement ); + break; + case Typedef::class_id: + insert_into2sList( rCe, + typedef_2s_AsDataTypes, + i_nDataElement ); + recursive_AssignFunction_toCeAsParameter( i_nDataElement, + static_cast< Typedef& >(rCe).DefiningType() ); + break; + // default: do nothing. + } // end switch +} + +void +SecondariesCalculator::insert_into2sUnique( CodeEntity & o_out, + int i_listIndex, + Ce_id i_nCe ) +{ + std::vector<Ce_id> & + rOut = o_out.Secondaries().Access_List(i_listIndex); + if (std::find(rOut.begin(),rOut.end(),i_nCe) != rOut.end()) + return; + rOut.push_back(i_nCe); +} + +void +SecondariesCalculator::sort_All2s() +{ + OrderCeIdsByName + aIdOrdering(my_CeStorage()); + + for ( stg_iterator it = my_CeStorage().Begin(); + it != my_CeStorage().End(); + ++it ) + { + Ce_2s & + r2s = (*it).Secondaries(); + int iCount = r2s.CountXrefLists(); + for (int i = 0; i < iCount; ++i) + { + std::sort( r2s.Access_List(i).begin(), + r2s.Access_List(i).end(), + aIdOrdering ); + } // end for (i) + } // end for (it) +} + +void +SecondariesCalculator::Read_Links2DevManual( csv::bstream & i_file ) +{ + StreamLock aLine(300); + StreamStr & rLine = aLine(); + + + String sCurLink; + String sCurLinkUI; + E_LinkMode eCurMode = link2ref; + + int lineCount = 0; + const char * sLink = "LINK:"; + const char * sDescr = "DESCR:"; + const char * sTopic = "TOPIC:"; + const char * sRef = "REF:"; + const UINT8 cMaxASCIINumWhiteSpace = 32; + + while (NOT i_file.eod()) + { + ++lineCount; + + rLine.reset(); + rLine.operator_read_line(i_file); + + if ( *rLine.c_str() >= 'a' ) + { + assign_CurLink(rLine.begin(), sCurLink, sCurLinkUI, eCurMode == link2descr, lineCount); + } + else if ( strncmp(rLine.c_str(), sLink, strlen(sLink)) == 0 ) + { + sCurLink = rLine.c_str()+5; + sCurLinkUI.clear(); + } + else if ( strncmp(rLine.c_str(), sDescr, strlen(sDescr)) == 0 ) + { + sCurLinkUI = rLine.c_str()+6; + } + else if ( strncmp(rLine.c_str(), sTopic, strlen(sTopic)) == 0 ) + { + eCurMode = link2descr; + } + else if ( strncmp(rLine.c_str(), sRef, strlen(sRef)) == 0 ) + { + eCurMode = link2ref; + } + else if (static_cast<UINT8>(*rLine.c_str()) > cMaxASCIINumWhiteSpace) + { + assign_CurLink(rLine.begin(), sCurLink, sCurLinkUI, eCurMode == link2descr, lineCount); + } + // else + // Ignore empty line. + + } // end while +} + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i2s_calculator.hxx b/autodoc/source/ary/idl/i2s_calculator.hxx new file mode 100644 index 000000000000..2ebde4d9400c --- /dev/null +++ b/autodoc/source/ary/idl/i2s_calculator.hxx @@ -0,0 +1,295 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_I2S_CALCULATOR_HXX +#define ARY_IDL_I2S_CALCULATOR_HXX + + +// USED SERVICES + // BASE CLASSES +#include <cosv/tpl/processor.hxx> + // PARAMETERS +#include <ary/idl/i_types4idl.hxx> + + +namespace ary +{ +namespace idl +{ + class CeAdmin; + class Ce_Storage; + class TypeAdmin; + class Type_Storage; + class Module; + class ExplicitType; + class Function; + class Interface; + class Property; + class Typedef; + class Service; + class Singleton; + class SglIfcService; + class SglIfcSingleton; + class Struct; + class StructElement; + class Exception; + class Ce_2s; +} +} + + + + + + +namespace ary +{ +namespace idl +{ + + +enum E_2s_of_Service +{ + service_2s_IncludingServices, + service_2s_InstantiatingSingletons +}; + +enum E_2s_of_Interface +{ + interface_2s_Derivations, + interface_2s_ExportingServices, + interface_2s_ExportingSingletons, + interface_2s_SynonymTypedefs, +// interface_2s_UsingTypedefs, + interface_2s_AsReturns, +// interface_2s_AsIndirectReturns, + interface_2s_AsParameters, +// interface_2s_AsIndirectParameters, + interface_2s_AsDataTypes +}; + +enum E_2s_of_Struct +{ + struct_2s_Derivations, + struct_2s_SynonymTypedefs, +// struct_2s_UsingTypedefs, + struct_2s_AsReturns, +// struct_2s_AsIndirectReturns, + struct_2s_AsParameters, +// struct_2s_AsIndirectParameters, + struct_2s_AsDataTypes +}; + +enum E_2s_of_Enum +{ + enum_2s_SynonymTypedefs, +// enum_2s_UsingTypedefs, + enum_2s_AsReturns, +// enum_2s_AsIndirectReturns, + enum_2s_AsParameters, +// enum_2s_AsIndirectParameters, + enum_2s_AsDataTypes +}; + +enum E_2s_of_Typedef +{ + typedef_2s_SynonymTypedefs, +// typedef_2s_UsingTypedefs, + typedef_2s_AsReturns, +// typedef_2s_AsIndirectReturns, + typedef_2s_AsParameters, +// typedef_2s_AsIndirectParameters, + typedef_2s_AsDataTypes +}; + +enum E_2s_of_Exceptions +{ + exception_2s_Derivations, + exception_2s_RaisingFunctions +}; + + + +class SPInst_asHost : public csv::ProcessorIfc, + public csv::ConstProcessor<Service>, + public csv::ConstProcessor<Interface>, + public csv::ConstProcessor<Struct>, + public csv::ConstProcessor<Exception>, + public csv::ConstProcessor<Typedef>, + public csv::ConstProcessor<Singleton>, + public csv::ConstProcessor<Function>, + public csv::ConstProcessor<StructElement>, + public csv::ConstProcessor<Property>, + public csv::ConstProcessor<SglIfcService>, + public csv::ConstProcessor<SglIfcSingleton> +{ +}; + + + + +/** This class scans the parsed data and produces several + secondary data like cross references and alphabetical indices. + + In this declaration "Secondaries" or "2s" mean those secondary data. + + @see Ce_2s +*/ +class SecondariesCalculator : public SPInst_asHost +{ + public: + // LIFECYCLE + SecondariesCalculator( + CeAdmin & i_ces, + TypeAdmin & i_types ); + virtual ~SecondariesCalculator(); + + // OPERATIONS + void CheckAllInterfaceBases(); + void Connect_Types2Ces(); + void Gather_CrossReferences(); + void Make_Links2DeveloperManual( + const String & i_devman_reffilepath ); + + private: + // Interface CeHost These are the points to gather cross + // references: + virtual void do_Process( + const Service & i_rData ); + virtual void do_Process( + const Interface & i_rData ); + virtual void do_Process( + const Struct & i_rData ); + virtual void do_Process( + const Exception & i_rData ); + virtual void do_Process( + const Typedef & i_rData ); + virtual void do_Process( + const Singleton & i_rData ); + virtual void do_Process( + const Function & i_rData ); + virtual void do_Process( + const StructElement & + i_rData ); + virtual void do_Process( + const Property & i_rData ); + virtual void do_Process( + const SglIfcService & + i_rData ); + virtual void do_Process( + const SglIfcSingleton & + i_rData ); + + // Locals + const Ce_Storage & my_CeStorage() const; + const Type_Storage & + my_TypeStorage() const; + Ce_Storage & my_CeStorage(); + Type_Storage & my_TypeStorage(); + + template <class DEST> + DEST * SearchCe4Type( + Type_id i_type ); + Ce_id lhf_Search_CeForType( + const ExplicitType & + i_rType ) const; + Ce_id lhf_Search_CeFromTypeId( + Type_id i_nType ) const; + Service * lhf_SearchService( + Type_id i_nServ ); + Interface * lhf_SearchInterface( + Type_id i_nIfc ); + Struct * lhf_SearchStruct( + Type_id i_nIfc ); + Exception * lhf_SearchException( + Type_id i_nIfc ); + void assign_CurLink( + char * i_text, + const String & i_link, + const String & i_linkUI, + bool i_isDescr, /// @descr true: description, false: reference. + int i_lineCount ); + void gather_Synonyms(); + void recursive_AssignAsSynonym( + Ce_id i_synonymousTypedefsId, + const Typedef & i_TypedefToCheck ); + void recursive_AssignIncludingService( + Ce_id i_includingServicesId, + const Service & i_ServiceToCheckItsIncludes ); + void assign_AsDerivedInterface( + const Interface & i_rDerived ); + void assign_AsDerivedStruct( + const Struct & i_rDerived ); + void assign_AsDerivedException( + const Exception & i_rDerived ); + void assignImplementation_toAServicesInterfaces( + Ce_id i_nImpl, + Ce_id i_nService, + E_2s_of_Interface i_eList ); + void recursive_AssignImplementation_toExportedInterface( + Ce_id i_nService, + Type_id i_nExportedInterface, + E_2s_of_Interface i_eList ); + void recursive_AssignFunction_toCeAsReturn( + Ce_id i_nFunction, + Type_id i_nReturnType ); + void recursive_AssignFunction_toCeAsParameter( + Ce_id i_nFunction, + Type_id i_nParameterType ); + + /** @param i_nDataElement + May be the ID of an struct element as well as an exception element + or a property. + */ + void recursive_AssignStructElement_toCeAsDataType( + Ce_id i_nDataElement, + Type_id i_nDataType ); + void insert_into2sList( + CodeEntity & o_out, + int i_listIndex, + Ce_id i_nCe ); + void insert_into2sUnique( + CodeEntity & o_out, + int i_listIndex, + Ce_id i_nCe ); + /// Sorts secondary production lists alphabetical. + void sort_All2s(); + + void Read_Links2DevManual( + csv::bstream & i_file ); + + // DATA + CeAdmin * pCes; + TypeAdmin * pTypes; +}; + + + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/i_attribute.cxx b/autodoc/source/ary/idl/i_attribute.cxx new file mode 100644 index 000000000000..ec78a58bd758 --- /dev/null +++ b/autodoc/source/ary/idl/i_attribute.cxx @@ -0,0 +1,159 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_attribute.hxx> +#include <ary/idl/ik_attribute.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <ary/getncast.hxx> +#include <sci_impl.hxx> + + +namespace ary +{ +namespace idl +{ + + +Attribute::Attribute( const String & i_sName, + Ce_id i_nService, + Ce_id i_nModule, + Type_id i_nType, + bool i_bReadonly, + bool i_bBound ) + : sName(i_sName), + nOwner(i_nService), + nNameRoom(i_nModule), + nType(i_nType), + aGetExceptions(), + aSetExceptions(), + bReadonly(i_bReadonly), + bBound(i_bBound) +{ +} + +Attribute::~Attribute() +{ +} + + +void +Attribute::do_Accept(csv::ProcessorIfc & io_processor) const +{ + csv::CheckedCall(io_processor,*this); +} + +ClassId +Attribute::get_AryClass() const +{ + return class_id; +} + +const String & +Attribute::inq_LocalName() const +{ + return sName; +} + +Ce_id +Attribute::inq_NameRoom() const +{ + return nNameRoom; +} + +Ce_id +Attribute::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +Attribute::inq_SightLevel() const +{ + return sl_Member; +} + +namespace ifc_attribute +{ + +inline const Attribute & +attribute_cast( const CodeEntity & i_ce ) +{ + csv_assert( is_type<Attribute>(i_ce) ); + return static_cast< const Attribute& >(i_ce); +} + +bool +attr::HasAnyStereotype( const CodeEntity & i_ce ) +{ + const Attribute & rAttr = attribute_cast(i_ce); + return rAttr.bReadonly OR rAttr.bBound; +} + +bool +attr::IsReadOnly( const CodeEntity & i_ce ) +{ + return attribute_cast(i_ce).bReadonly; +} + +bool +attr::IsBound( const CodeEntity & i_ce ) +{ + return attribute_cast(i_ce).bBound; +} + +Type_id +attr::Type( const CodeEntity & i_ce ) +{ + return attribute_cast(i_ce).nType; +} + +void +attr::Get_GetExceptions( Dyn_TypeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result + = new SCI_Vector<Type_id>( attribute_cast(i_ce).aGetExceptions ); +} + +void +attr::Get_SetExceptions( Dyn_TypeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result + = new SCI_Vector<Type_id>( attribute_cast(i_ce).aSetExceptions ); +} + + +} // namespace ifc_attribute + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_ce.cxx b/autodoc/source/ary/idl/i_ce.cxx new file mode 100644 index 000000000000..783e3a9b93f7 --- /dev/null +++ b/autodoc/source/ary/idl/i_ce.cxx @@ -0,0 +1,80 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_ce.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary/doc/d_oldidldocu.hxx> +#include <ary/getncast.hxx> + + +namespace ary +{ +namespace idl +{ + +namespace +{ + const Ce_2s aConstCe2sDummy; +} + + + +CodeEntity::CodeEntity() + : aDocu(), + p2s(0) +{ +} + +CodeEntity::~CodeEntity() +{ +} + +const Ce_2s & +CodeEntity::Secondaries() const +{ + if (p2s) + return *p2s; + return aConstCe2sDummy; +} + +Ce_2s & +CodeEntity::Secondaries() +{ + if (p2s) + return *p2s; + p2s = Ce_2s::Create_(AryClass()); + return *p2s; +} + + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_ce2s.cxx b/autodoc/source/ary/idl/i_ce2s.cxx new file mode 100644 index 000000000000..0898b7867086 --- /dev/null +++ b/autodoc/source/ary/idl/i_ce2s.cxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_ce.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <cosv/tpl/tpltools.hxx> +#include <ary/doc/d_oldidldocu.hxx> +#include <ary/getncast.hxx> + + +namespace ary +{ +namespace idl +{ + +namespace +{ +const std::vector<Ce_id> C_sNullVector_Ce_ids; +} + + +Ce_2s::~Ce_2s() +{ + csv::erase_container_of_heap_ptrs(aXrefLists); +} + +DYN Ce_2s * +Ce_2s::Create_( ClassId ) +{ + return new Ce_2s; +} + + +std::vector<Ce_id> & +Ce_2s::Access_List( int i_indexOfList ) +{ + csv_assert(i_indexOfList >= 0 AND i_indexOfList < 1000); + + while (i_indexOfList >= (int) aXrefLists.size()) + { + aXrefLists.push_back(new std::vector<Ce_id>); + } + return *aXrefLists[i_indexOfList]; +} + +const std::vector<Ce_id> & +Ce_2s::List( int i_indexOfList ) const +{ + if (uintt(i_indexOfList) < aXrefLists.size()) + return *aXrefLists[i_indexOfList]; + else + return C_sNullVector_Ce_ids; +} + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_comrela.cxx b/autodoc/source/ary/idl/i_comrela.cxx new file mode 100644 index 000000000000..8f5d164b5479 --- /dev/null +++ b/autodoc/source/ary/idl/i_comrela.cxx @@ -0,0 +1,47 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_comrela.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary/ary.hxx> +#include <ary/idl/i_gate.hxx> +#include <ary/idl/ip_ce.hxx> +#include <ary/idl/ip_type.hxx> + + +namespace ary +{ +namespace idl +{ + +// KORR_FUTURE Currently unneeded file. May become useful later. + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_constant.cxx b/autodoc/source/ary/idl/i_constant.cxx new file mode 100644 index 000000000000..ac6a7124935f --- /dev/null +++ b/autodoc/source/ary/idl/i_constant.cxx @@ -0,0 +1,123 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_constant.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <ary/idl/ik_constant.hxx> + + +namespace ary +{ +namespace idl +{ + +Constant::Constant( const String & i_sName, + Ce_id i_nOwner, + Ce_id i_nNameRoom, + Type_id i_nType, + const String & i_sInitValue ) + : sName(i_sName), + nNameRoom(i_nNameRoom), + nOwner(i_nOwner), + nType(i_nType), + sInitValue(i_sInitValue) +{ +} + +Constant::~Constant() +{ +} + +void +Constant::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + + +ClassId +Constant::get_AryClass() const +{ + return class_id; +} + +const String & +Constant::inq_LocalName() const +{ + return sName; +} + +Ce_id +Constant::inq_NameRoom() const +{ + return nNameRoom; +} + +Ce_id +Constant::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +Constant::inq_SightLevel() const +{ + return sl_Member; +} + + +namespace ifc_constant +{ + +inline const Constant & +constant_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == Constant::class_id ); + return static_cast< const Constant& >(i_ce); +} + +Type_id +attr::Type( const CodeEntity & i_ce ) +{ + return constant_cast(i_ce).nType; +} + +const String & +attr::Value( const CodeEntity & i_ce ) +{ + return constant_cast(i_ce).sInitValue; +} + +} // namespace ifc_constant + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_constgroup.cxx b/autodoc/source/ary/idl/i_constgroup.cxx new file mode 100644 index 000000000000..434b054ea3f1 --- /dev/null +++ b/autodoc/source/ary/idl/i_constgroup.cxx @@ -0,0 +1,114 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_constgroup.hxx> +#include <ary/idl/ik_constgroup.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <sci_impl.hxx> + + +namespace ary +{ +namespace idl +{ + + +ConstantsGroup::ConstantsGroup( const String & i_sName, + Ce_id i_nModule ) + : sName(i_sName), + nModule(i_nModule), + aConstants() +{ +} + +ConstantsGroup::~ConstantsGroup() +{ +} + +void +ConstantsGroup::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +ConstantsGroup::get_AryClass() const +{ + return class_id; +} + +const String & +ConstantsGroup::inq_LocalName() const +{ + return sName; +} + +Ce_id +ConstantsGroup::inq_NameRoom() const +{ + return nModule; +} + +Ce_id +ConstantsGroup::inq_Owner() const +{ + return nModule; +} + +E_SightLevel +ConstantsGroup::inq_SightLevel() const +{ + return sl_File; +} + + +namespace ifc_constgroup +{ + +inline const ConstantsGroup & +constgroup_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == ConstantsGroup::class_id ); + return static_cast< const ConstantsGroup& >(i_ce); +} + +void +attr::Get_Constants( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(constgroup_cast(i_ce).aConstants); +} + +} // namespace ifc_constgroup + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_enum.cxx b/autodoc/source/ary/idl/i_enum.cxx new file mode 100644 index 000000000000..30ee8e39e146 --- /dev/null +++ b/autodoc/source/ary/idl/i_enum.cxx @@ -0,0 +1,143 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_enum.hxx> +#include <ary/idl/ik_enum.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <sci_impl.hxx> +#include "i2s_calculator.hxx" + + +namespace ary +{ +namespace idl +{ + +Enum::Enum( const String & i_sName, + Ce_id i_nOwner ) + : sName(i_sName), + nOwner(i_nOwner), + aValues() +{ +} + +Enum::~Enum() +{ +} + +void +Enum::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +Enum::get_AryClass() const +{ + return class_id; +} + +const String & +Enum::inq_LocalName() const +{ + return sName; +} + +Ce_id +Enum::inq_NameRoom() const +{ + return nOwner; +} + +Ce_id +Enum::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +Enum::inq_SightLevel() const +{ + return sl_File; +} + + +namespace ifc_enum +{ + +inline const Enum & +enum_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == Enum::class_id ); + return static_cast< const Enum& >(i_ce); +} + +void +attr::Get_Values( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(enum_cast(i_ce).aValues); +} + + +void +xref::Get_SynonymTypedefs( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(enum_2s_SynonymTypedefs)); +} + +void +xref::Get_AsReturns( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(enum_2s_AsReturns)); +} + +void +xref::Get_AsParameters( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(enum_2s_AsParameters)); +} + +void +xref::Get_AsDataTypes( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(enum_2s_AsDataTypes)); +} + +} // namespace ifc_enum + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_enumvalue.cxx b/autodoc/source/ary/idl/i_enumvalue.cxx new file mode 100644 index 000000000000..7ee139f9ba4c --- /dev/null +++ b/autodoc/source/ary/idl/i_enumvalue.cxx @@ -0,0 +1,116 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_enumvalue.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <ary/idl/ik_enumvalue.hxx> + + +namespace ary +{ +namespace idl +{ + +EnumValue::EnumValue( const String & i_sName, + Ce_id i_nOwner, + Ce_id i_nNameRoom, + const String & i_sInitValue ) + : sName(i_sName), + nOwner(i_nOwner), + nNameRoom(i_nNameRoom), + sValue(i_sInitValue) +{ +} + +EnumValue::~EnumValue() +{ +} + +void +EnumValue::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +EnumValue::get_AryClass() const +{ + return class_id; +} + +const String & +EnumValue::inq_LocalName() const +{ + return sName; +} + +Ce_id +EnumValue::inq_NameRoom() const +{ + return nNameRoom; +} + +Ce_id +EnumValue::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +EnumValue::inq_SightLevel() const +{ + return sl_Member; +} + + + +namespace ifc_enumvalue +{ + +inline const EnumValue & +enumvalue_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == EnumValue::class_id ); + return static_cast< const EnumValue& >(i_ce); +} + +const String & +attr::Value( const CodeEntity & i_ce ) +{ + return enumvalue_cast(i_ce).sValue; +} + + +} // namespace ifc_enumvalue + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_exception.cxx b/autodoc/source/ary/idl/i_exception.cxx new file mode 100644 index 000000000000..cf98da1719a7 --- /dev/null +++ b/autodoc/source/ary/idl/i_exception.cxx @@ -0,0 +1,139 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_exception.hxx> +#include <ary/idl/ik_exception.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <sci_impl.hxx> +#include "i2s_calculator.hxx" + + + +namespace ary +{ +namespace idl +{ + +Exception::Exception( const String & i_sName, + Ce_id i_nOwner, + Type_id i_nBase ) + : sName(i_sName), + nOwner(i_nOwner), + nBase(i_nBase), + aElements() +{ +} + +Exception::~Exception() +{ +} + +void +Exception::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +Exception::get_AryClass() const +{ + return class_id; +} + +const String & +Exception::inq_LocalName() const +{ + return sName; +} + +Ce_id +Exception::inq_NameRoom() const +{ + return nOwner; +} + +Ce_id +Exception::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +Exception::inq_SightLevel() const +{ + return sl_File; +} + + +namespace ifc_exception +{ + +inline const Exception & +exception_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == Exception::class_id ); + return static_cast< const Exception& >(i_ce); +} + +Type_id +attr::Base( const CodeEntity & i_ce ) +{ + return exception_cast(i_ce).nBase; +} + +void +attr::Get_Elements( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>( exception_cast(i_ce).aElements ); +} + + +void +xref::Get_Derivations( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(exception_2s_Derivations)); +} + +void +xref::Get_RaisingFunctions( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(exception_2s_RaisingFunctions)); +} + + +} // namespace ifc_exception + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_function.cxx b/autodoc/source/ary/idl/i_function.cxx new file mode 100644 index 000000000000..141ebb084c32 --- /dev/null +++ b/autodoc/source/ary/idl/i_function.cxx @@ -0,0 +1,165 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_function.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <sci_impl.hxx> + + + +namespace ary +{ +namespace idl +{ + +Function::Function( const String & i_sName, + Ce_id i_nOwner, + Ce_id i_nNameRoom, + Type_id i_nReturnType, + bool i_bOneWay ) + : sName(i_sName), + nOwner(i_nOwner), + nNameRoom(i_nNameRoom), + nReturnType(i_nReturnType), + aParameters(), + aExceptions(), + bOneWay(i_bOneWay), + bEllipse(false) +{ +} + +Function::Function( const String & i_sName, + Ce_id i_nOwner, + Ce_id i_nNameRoom ) + : sName(i_sName), + nOwner(i_nOwner), + nNameRoom(i_nNameRoom), + nReturnType(0), + aParameters(), + aExceptions(), + bOneWay(false), + bEllipse(false) +{ +} + +Function::~Function() +{ +} + +void +Function::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +Function::get_AryClass() const +{ + return class_id; +} + +const String & +Function::inq_LocalName() const +{ + return sName; +} + +Ce_id +Function::inq_NameRoom() const +{ + return nNameRoom; +} + +Ce_id +Function::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +Function::inq_SightLevel() const +{ + return sl_Member; +} + + +namespace ifc_function +{ + +inline const Function & +function_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == Function::class_id ); + return static_cast< const Function& >(i_ce); +} + +Type_id +attr::ReturnType( const CodeEntity & i_ce ) +{ + return function_cast(i_ce).nReturnType; +} + +bool +attr::IsOneway( const CodeEntity & i_ce ) +{ + return function_cast(i_ce).bOneWay; +} + +bool +attr::HasEllipse( const CodeEntity & i_ce ) +{ + return function_cast(i_ce).bEllipse; +} + +void +attr::Get_Parameters( Dyn_StdConstIterator<ary::idl::Parameter> & o_result, + const CodeEntity & i_ce ) +{ + o_result + = new SCI_Vector<Parameter>( function_cast(i_ce).aParameters ); +} + +void +attr::Get_Exceptions( Dyn_TypeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result + = new SCI_Vector<Type_id>( function_cast(i_ce).aExceptions ); +} + + + + + +} // namespace ifc_function + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_interface.cxx b/autodoc/source/ary/idl/i_interface.cxx new file mode 100644 index 000000000000..4e4b61a071eb --- /dev/null +++ b/autodoc/source/ary/idl/i_interface.cxx @@ -0,0 +1,196 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_interface.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <ary/idl/ik_interface.hxx> +#include <ary/doc/d_oldidldocu.hxx> +#include <sci_impl.hxx> +#include "i2s_calculator.hxx" + + +namespace ary +{ +namespace idl +{ + + +class Interface_2s +{ +}; + + +Interface::Interface( const String & i_sName, + Ce_id i_nOwner ) + : sName(i_sName), + nOwner(i_nOwner), + aBases(), + aFunctions(), + aAttributes(), + p2s() +{ +} + +Interface::~Interface() +{ + for ( RelationList::iterator it = aBases.begin(); + it != aBases.end(); + ++it ) + { + delete (*it).Info(); + } +} + +void +Interface::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +Interface::get_AryClass() const +{ + return class_id; +} + +const String & +Interface::inq_LocalName() const +{ + return sName; +} + +Ce_id +Interface::inq_NameRoom() const +{ + return nOwner; +} + +Ce_id +Interface::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +Interface::inq_SightLevel() const +{ + return sl_File; +} + + +namespace ifc_interface +{ + +inline const Interface & +interface_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == Interface::class_id ); + return static_cast< const Interface& >(i_ce); +} + +void +attr::Get_Bases( Dyn_StdConstIterator<CommentedRelation> & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<CommentedRelation>(interface_cast(i_ce).aBases); +} + +void +attr::Get_Functions( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(interface_cast(i_ce).aFunctions); +} + +void +attr::Get_Attributes( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(interface_cast(i_ce).aAttributes); +} + +void +xref::Get_Derivations( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_Derivations)); +} + +void +xref::Get_SynonymTypedefs( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_SynonymTypedefs)); +} + +void +xref::Get_ExportingServices( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_ExportingServices)); +} + +void +xref::Get_ExportingSingletons( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_ExportingSingletons)); +} + +void +xref::Get_AsReturns( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_AsReturns)); +} + +void +xref::Get_AsParameters( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_AsParameters)); +} + +void +xref::Get_AsDataTypes( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(interface_2s_AsDataTypes)); +} + + + + +} // namespace ifc_interface + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_module.cxx b/autodoc/source/ary/idl/i_module.cxx new file mode 100644 index 000000000000..b5b7453fa3b0 --- /dev/null +++ b/autodoc/source/ary/idl/i_module.cxx @@ -0,0 +1,204 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_module.hxx> +#include <ary/idl/ik_module.hxx> + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <ary/idl/i_gate.hxx> +#include <ary/idl/i_module.hxx> +#include <ary/idl/i_service.hxx> +#include <ary/idl/i_interface.hxx> +#include <ary/idl/i_struct.hxx> +#include <ary/idl/i_exception.hxx> +#include <ary/idl/i_enum.hxx> +#include <ary/idl/i_typedef.hxx> +#include <ary/idl/i_constgroup.hxx> +#include <ary/idl/i_singleton.hxx> +#include <ary/idl/i_siservice.hxx> +#include <ary/idl/i_sisingleton.hxx> +#include <ary/idl/ip_ce.hxx> +#include <nametreenode.hxx> + + +namespace ary +{ +namespace idl +{ + +Module::Module() + : pImpl( new NameTreeNode<Ce_id> ) +{ +} + +Module::Module( const String & i_sName, + const Module & i_rParent ) + : pImpl( new NameTreeNode<Ce_id>( i_sName, + *i_rParent.pImpl, + i_rParent.CeId() ) ) +{ +} + +Module::~Module() +{ +} + +void +Module::Add_Name( const String & i_sName, + Ce_id i_nCodeEntity ) +{ + pImpl->Add_Name(i_sName, i_nCodeEntity); +} + +Ce_id +Module::Search_Name( const String & i_sName ) const +{ + return pImpl->Search_Name(i_sName); +} + +void +Module::Get_Names( Dyn_StdConstIterator<Ce_id> & o_rResult ) const +{ + pImpl->Get_Names( o_rResult ); +} + +void +Module::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +Module::get_AryClass() const +{ + return class_id; +} + +const String & +Module::inq_LocalName() const +{ + return pImpl->Name(); +} + +Ce_id +Module::inq_NameRoom() const +{ + return pImpl->Parent(); +} + +Ce_id +Module::inq_Owner() const +{ + return pImpl->Parent(); +} + +E_SightLevel +Module::inq_SightLevel() const +{ + return sl_Module; +} + + +namespace ifc_module +{ + +inline const Module & +module_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == Module::class_id ); + return static_cast< const Module& >(i_ce); +} + +typedef NameTreeNode<Ce_id>::Map_LocalNames NameMap; + +void +attr::Get_AllChildrenSeparated( std::vector< const CodeEntity* > & o_nestedModules, + std::vector< const CodeEntity* > & o_services, + std::vector< const CodeEntity* > & o_interfaces, + std::vector< const CodeEntity* > & o_structs, + std::vector< const CodeEntity* > & o_exceptions, + std::vector< const CodeEntity* > & o_enums, + std::vector< const CodeEntity* > & o_typedefs, + std::vector< const CodeEntity* > & o_constantGroups, + std::vector< const CodeEntity* > & o_singletons, + const CePilot & i_pilot, + const CodeEntity & i_ce ) +{ + const CodeEntity * + pCe = 0; + NameMap::const_iterator + itEnd = module_cast(i_ce).pImpl->LocalNames().end(); + for ( NameMap::const_iterator + it = module_cast(i_ce).pImpl->LocalNames().begin(); + it != itEnd; + ++it ) + { + pCe = &i_pilot.Find_Ce( (*it).second ); + switch (pCe->AryClass()) + { + case Module::class_id: + o_nestedModules.push_back(pCe); + break; + case SglIfcService::class_id: + case Service::class_id: + o_services.push_back(pCe); + break; + case Interface::class_id: + o_interfaces.push_back(pCe); + break; + case Struct::class_id: + o_structs.push_back(pCe); + break; + case Exception::class_id: + o_exceptions.push_back(pCe); + break; + case Enum::class_id: + o_enums.push_back(pCe); + break; + case Typedef::class_id: + o_typedefs.push_back(pCe); + break; + case ConstantsGroup::class_id: + o_constantGroups.push_back(pCe); + break; + case SglIfcSingleton::class_id: + case Singleton::class_id: + o_singletons.push_back(pCe); + break; + } + } // end for +} + + +} // namespace ifc_module + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_namelookup.cxx b/autodoc/source/ary/idl/i_namelookup.cxx new file mode 100644 index 000000000000..5b07d5a73c16 --- /dev/null +++ b/autodoc/source/ary/idl/i_namelookup.cxx @@ -0,0 +1,62 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_namelookup.hxx> + +// NOT FULLY DECLARED SERVICES +#include <sci_impl.hxx> + +namespace ary +{ +namespace idl +{ + +NameLookup::NameLookup() + : aNames() +{ +} + +NameLookup::~NameLookup() +{ +} + +void +NameLookup::Add_Name( const String & i_name, + Ce_id i_id, + ClassId i_class, + Ce_id i_owner ) +{ + aNames.insert( std::pair< const String, NameProperties>( + i_name, + NameProperties( i_id, + i_class, + i_owner ))); +} + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_nnfinder.hxx b/autodoc/source/ary/idl/i_nnfinder.hxx new file mode 100644 index 000000000000..3355a5f89030 --- /dev/null +++ b/autodoc/source/ary/idl/i_nnfinder.hxx @@ -0,0 +1,118 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_NNFINDER_HXX +#define ARY_IDL_NNFINDER_HXX + +// USED SERVICES +#include "is_ce.hxx" + + + + +namespace ary +{ +namespace idl +{ + + +/** Gives context info for tree search functions. + + @collab ->ary::Search_SubTree<>() + @collab ->ary::Search_SubTree_UpTillRoot<>() +*/ +class Find_ModuleNode +{ + public: + typedef Ce_id id_type; + typedef StringVector::const_iterator name_iterator; + + // LIFECYCLE + Find_ModuleNode( + const Ce_Storage & i_rStorage, + name_iterator it_begin, + name_iterator it_end, + const String & i_sName ) + : rStorage(i_rStorage), + itBegin(it_begin), + itEnd(it_end), + sName2Search(i_sName) { if (itBegin != itEnd ? (*itBegin).empty() : false) ++itBegin; } + // OPERATIONS + const Module * operator()( + id_type i_id ) const + { return i_id.IsValid() + ? & ary_cast<Module>(rStorage[i_id]) + : 0; } + + name_iterator Begin() const { return itBegin; } + name_iterator End() const { return itEnd; } + const String & Name2Search() const { return sName2Search; } + + private: + // DATA + const Ce_Storage & rStorage; + name_iterator itBegin; + name_iterator itEnd; + String sName2Search; +}; + + + + +class Types_forSetCe_Id +{ + public: + typedef Ce_id element_type; + typedef Ce_Storage find_type; + + // KORR_FUTURE: Check, if this sorting is right or the ary standard + // sorting should be used. + struct sort_type + { + sort_type( + const find_type & i_rFinder ) + : rFinder(i_rFinder) {} + bool operator()( + const element_type & + i_r1, + const element_type & + i_r2 ) const + { + return rFinder[i_r1].LocalName() + < rFinder[i_r2].LocalName(); + } + + private: + const find_type & rFinder; + + }; +}; + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/i_param.cxx b/autodoc/source/ary/idl/i_param.cxx new file mode 100644 index 000000000000..bdaadeee0964 --- /dev/null +++ b/autodoc/source/ary/idl/i_param.cxx @@ -0,0 +1,57 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_param.hxx> + + +// NOT FULLY DEFINED SERVICES + + + +namespace ary +{ +namespace idl +{ + +Parameter::Parameter( const String & i_sName, + Type_id i_nType, + E_ParameterDirection i_eDirection ) + : sName(i_sName), + nType(i_nType), + eDirection(i_eDirection) +{ +} + +Parameter::~Parameter() +{ +} + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_property.cxx b/autodoc/source/ary/idl/i_property.cxx new file mode 100644 index 000000000000..852e06f4ced0 --- /dev/null +++ b/autodoc/source/ary/idl/i_property.cxx @@ -0,0 +1,171 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_property.hxx> +#include <ary/idl/ik_property.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> + + +namespace ary +{ +namespace idl +{ + + +Property::Property( const String & i_sName, + Ce_id i_nService, + Ce_id i_nModule, + Type_id i_nType, + Stereotypes i_stereotypes ) + : sName(i_sName), + nOwner(i_nService), + nNameRoom(i_nModule), + nType(i_nType), + aStereotypes(i_stereotypes) +{ +} + +Property::~Property() +{ +} + + +void +Property::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +Property::get_AryClass() const +{ + return class_id; +} + +const String & +Property::inq_LocalName() const +{ + return sName; +} + +Ce_id +Property::inq_NameRoom() const +{ + return nNameRoom; +} + +Ce_id +Property::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +Property::inq_SightLevel() const +{ + return sl_Member; +} + +namespace ifc_property +{ + +inline const Property & +property_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == Property::class_id ); + return static_cast< const Property& >(i_ce); +} + +bool +attr::HasAnyStereotype( const CodeEntity & i_ce ) +{ + return property_cast(i_ce).aStereotypes.HasAny(); +} + +bool +attr::IsReadOnly( const CodeEntity & i_ce ) +{ + return property_cast(i_ce).aStereotypes.IsReadOnly(); +} + +bool +attr::IsBound( const CodeEntity & i_ce ) +{ + return property_cast(i_ce).aStereotypes.IsBound(); +} + +bool +attr::IsConstrained( const CodeEntity & i_ce ) +{ + return property_cast(i_ce).aStereotypes.IsConstrained(); +} + +bool +attr::IsMayBeAmbiguous( const CodeEntity & i_ce ) +{ + return property_cast(i_ce).aStereotypes.IsMayBeAmbiguous(); +} + +bool +attr::IsMayBeDefault( const CodeEntity & i_ce ) +{ + return property_cast(i_ce).aStereotypes.IsMayBeDefault(); +} + +bool +attr::IsMayBeVoid( const CodeEntity & i_ce ) +{ + return property_cast(i_ce).aStereotypes.IsMayBeVoid(); +} + +bool +attr::IsRemovable( const CodeEntity & i_ce ) +{ + return property_cast(i_ce).aStereotypes.IsRemovable(); +} + +bool +attr::IsTransient( const CodeEntity & i_ce ) +{ + return property_cast(i_ce).aStereotypes.IsTransient(); +} + +Type_id +attr::Type( const CodeEntity & i_ce ) +{ + return property_cast(i_ce).nType; +} + +} // namespace ifc_property + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_reposypart.cxx b/autodoc/source/ary/idl/i_reposypart.cxx new file mode 100644 index 000000000000..c0edd33feeb7 --- /dev/null +++ b/autodoc/source/ary/idl/i_reposypart.cxx @@ -0,0 +1,119 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include "i_reposypart.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/idl/i_namelookup.hxx> +#include <idl_internalgate.hxx> +#include "ia_ce.hxx" +#include "ia_type.hxx" +#include "i2s_calculator.hxx" +#include "is_ce.hxx" +#include "is_type.hxx" + + + + +namespace ary +{ +namespace idl +{ + + +DYN InternalGate & +InternalGate::Create_Partition_(RepositoryCenter & i_center) +{ + return *new RepositoryPartition(i_center); +} + + + +RepositoryPartition::RepositoryPartition( RepositoryCenter & i_repository ) + : pCenter(&i_repository), + pCes(0), + pTypes(0), + pNamesDictionary(new NameLookup) +{ + pTypes = new TypeAdmin; + pCes = new CeAdmin(*pNamesDictionary, *pTypes); +} + +RepositoryPartition::~RepositoryPartition() +{ +} + +void +RepositoryPartition::Calculate_AllSecondaryInformation( + const String & i_devman_reffilepath ) +{ + // KORR_FUTURE + // Forward the options from here. + + SecondariesCalculator + secalc(*pCes,*pTypes); + + secalc.CheckAllInterfaceBases(); + secalc.Connect_Types2Ces(); + secalc.Gather_CrossReferences(); + + if ( NOT i_devman_reffilepath.empty() ) + { + secalc.Make_Links2DeveloperManual(i_devman_reffilepath); + } +} + +const CePilot & +RepositoryPartition::Ces() const +{ + return *pCes; +} + +const TypePilot & +RepositoryPartition::Types() const +{ + return *pTypes; +} + +CePilot & +RepositoryPartition::Ces() +{ + return *pCes; +} + +TypePilot & +RepositoryPartition::Types() +{ + return *pTypes; +} + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_reposypart.hxx b/autodoc/source/ary/idl/i_reposypart.hxx new file mode 100644 index 000000000000..f28e1f1364d7 --- /dev/null +++ b/autodoc/source/ary/idl/i_reposypart.hxx @@ -0,0 +1,96 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_I_REPOSYPART_HXX +#define ARY_IDL_I_REPOSYPART_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <idl_internalgate.hxx> + // OTHER + + +namespace ary +{ +namespace idl +{ + class CeAdmin; + class TypeAdmin; + class NameLookup; +} +} + + + + + +namespace ary +{ +namespace idl +{ + + + +/** The idl part of the Autodoc repository. +*/ +class RepositoryPartition : public InternalGate +{ + public: + // LIFECYCLE + RepositoryPartition( + RepositoryCenter & i_repository ); + ~RepositoryPartition(); + // INHERITED + // Interface Gate: + virtual void Calculate_AllSecondaryInformation( + const String & i_devman_reffilepath ); +// const ::autodoc::Options & +// i_options ); + virtual const CePilot & + Ces() const; + virtual const TypePilot & + Types() const; + virtual CePilot & Ces(); + virtual TypePilot & Types(); + + private: + // DATA + RepositoryCenter * pCenter; + + Dyn<CeAdmin> pCes; + Dyn<TypeAdmin> pTypes; + Dyn<NameLookup> pNamesDictionary; +}; + + + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/i_service.cxx b/autodoc/source/ary/idl/i_service.cxx new file mode 100644 index 000000000000..14eb20a1096d --- /dev/null +++ b/autodoc/source/ary/idl/i_service.cxx @@ -0,0 +1,171 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_service.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <ary/idl/ik_service.hxx> +#include <ary/doc/d_oldidldocu.hxx> +#include <sci_impl.hxx> +#include "i2s_calculator.hxx" + + +namespace ary +{ +namespace idl +{ + +Service::Service( const String & i_sName, + Ce_id i_nOwner ) + : sName(i_sName), + nOwner(i_nOwner), + aIncludedServices(), + aSupportedInterfaces(), + aProperties() +{ +} + +Service::~Service() +{ + for ( RelationList::iterator it = aIncludedServices.begin(); + it != aIncludedServices.end(); + ++it ) + { + delete (*it).Info(); + } + + for ( RelationList::iterator it = aSupportedInterfaces.begin(); + it != aSupportedInterfaces.end(); + ++it ) + { + delete (*it).Info(); + } +} + +void +Service::Get_SupportedInterfaces( Dyn_StdConstIterator<CommentedRelation> & o_rResult ) const +{ + o_rResult = new SCI_Vector<CommentedRelation>(aSupportedInterfaces); +} + +void +Service::Get_IncludedServices( Dyn_StdConstIterator<CommentedRelation> & o_rResult ) const +{ + o_rResult = new SCI_Vector<CommentedRelation>(aIncludedServices); +} + +void +Service::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +Service::get_AryClass() const +{ + return class_id; +} + +const String & +Service::inq_LocalName() const +{ + return sName; +} + +Ce_id +Service::inq_NameRoom() const +{ + return nOwner; +} + +Ce_id +Service::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +Service::inq_SightLevel() const +{ + return sl_File; +} + + +namespace ifc_service +{ + +inline const Service & +service_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == Service::class_id ); + return static_cast< const Service& >(i_ce); +} + +void +attr::Get_IncludedServices( Dyn_StdConstIterator<CommentedRelation> & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<CommentedRelation>( service_cast(i_ce).aIncludedServices ); +} + +void +attr::Get_ExportedInterfaces( Dyn_StdConstIterator<CommentedRelation> & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<CommentedRelation>( service_cast(i_ce).aSupportedInterfaces ); +} + +void +attr::Get_Properties( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>( service_cast(i_ce).aProperties ); +} + +void +xref::Get_IncludingServices( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(service_2s_IncludingServices)); +} + +void +xref::Get_InstantiatingSingletons( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(service_2s_InstantiatingSingletons)); +} + + +} // namespace ifc_service + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_singleton.cxx b/autodoc/source/ary/idl/i_singleton.cxx new file mode 100644 index 000000000000..fcc6ef580756 --- /dev/null +++ b/autodoc/source/ary/idl/i_singleton.cxx @@ -0,0 +1,112 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_singleton.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <ary/idl/ik_singleton.hxx> +#include <sci_impl.hxx> + + +namespace ary +{ +namespace idl +{ + +Singleton::Singleton( const String & i_sName, + Ce_id i_nOwner ) + : sName(i_sName), + nOwner(i_nOwner), + nService() +{ +} + +Singleton::~Singleton() +{ +} + +void +Singleton::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +Singleton::get_AryClass() const +{ + return class_id; +} + +const String & +Singleton::inq_LocalName() const +{ + return sName; +} + +Ce_id +Singleton::inq_NameRoom() const +{ + return nOwner; +} + +Ce_id +Singleton::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +Singleton::inq_SightLevel() const +{ + return sl_File; +} + + +namespace ifc_singleton +{ + +inline const Singleton & +singleton_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == Singleton::class_id ); + return static_cast< const Singleton& >(i_ce); +} + +Type_id +attr::AssociatedService( const CodeEntity & i_ce ) +{ + return singleton_cast(i_ce).nService; +} + +} // namespace ifc_singleton + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_siservice.cxx b/autodoc/source/ary/idl/i_siservice.cxx new file mode 100644 index 000000000000..2aff0288cec3 --- /dev/null +++ b/autodoc/source/ary/idl/i_siservice.cxx @@ -0,0 +1,121 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_siservice.hxx> +#include <ary/idl/ik_siservice.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <sci_impl.hxx> + + +namespace ary +{ +namespace idl +{ + +SglIfcService::SglIfcService( const String & i_sName, + Ce_id i_nOwner, + Type_id i_nBaseInterface ) + : sName(i_sName), + nOwner(i_nOwner), + nBaseInterface(i_nBaseInterface), + aConstructors() +{ +} + +SglIfcService::~SglIfcService() +{ +} + +void +SglIfcService::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +SglIfcService::get_AryClass() const +{ + return class_id; +} + +const String & +SglIfcService::inq_LocalName() const +{ + return sName; +} + +Ce_id +SglIfcService::inq_NameRoom() const +{ + return nOwner; +} + +Ce_id +SglIfcService::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +SglIfcService::inq_SightLevel() const +{ + return sl_File; +} + + +namespace ifc_sglifcservice +{ + +inline const SglIfcService & +sglifcservice_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == SglIfcService::class_id ); + return static_cast< const SglIfcService& >(i_ce); +} + +Type_id +attr::BaseInterface( const CodeEntity & i_ce ) +{ + return sglifcservice_cast(i_ce).nBaseInterface; +} + +void +attr::Get_Constructors( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>( sglifcservice_cast(i_ce).aConstructors ); +} + +} // namespace ifc_sglifcservice + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_sisingleton.cxx b/autodoc/source/ary/idl/i_sisingleton.cxx new file mode 100644 index 000000000000..d731f341153b --- /dev/null +++ b/autodoc/source/ary/idl/i_sisingleton.cxx @@ -0,0 +1,113 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_sisingleton.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <ary/idl/ik_sisingleton.hxx> + + + +namespace ary +{ +namespace idl +{ + +SglIfcSingleton::SglIfcSingleton( const String & i_sName, + Ce_id i_nOwner, + Type_id i_nBaseInterface ) + : sName(i_sName), + nOwner(i_nOwner), + nBaseInterface(i_nBaseInterface) +{ +} + +SglIfcSingleton::~SglIfcSingleton() +{ +} + +void +SglIfcSingleton::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +SglIfcSingleton::get_AryClass() const +{ + return class_id; +} + +const String & +SglIfcSingleton::inq_LocalName() const +{ + return sName; +} + +Ce_id +SglIfcSingleton::inq_NameRoom() const +{ + return nOwner; +} + +Ce_id +SglIfcSingleton::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +SglIfcSingleton::inq_SightLevel() const +{ + return sl_File; +} + +namespace ifc_sglifcsingleton +{ + +inline const SglIfcSingleton & +sglifcsingleton_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == SglIfcSingleton::class_id ); + return static_cast< const SglIfcSingleton& >(i_ce); +} + +Type_id +attr::BaseInterface( const CodeEntity & i_ce ) +{ + return sglifcsingleton_cast(i_ce).nBaseInterface; +} + + +} // namespace ifc_sglifcsingleton + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_struct.cxx b/autodoc/source/ary/idl/i_struct.cxx new file mode 100644 index 000000000000..dfffa3522813 --- /dev/null +++ b/autodoc/source/ary/idl/i_struct.cxx @@ -0,0 +1,163 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_struct.hxx> +#include <ary/idl/ik_struct.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <sci_impl.hxx> +#include "i2s_calculator.hxx" + + +namespace ary +{ +namespace idl +{ + +Struct::Struct( const String & i_sName, + Ce_id i_nOwner, + Type_id i_nBase, + const String & i_sTemplateParameter, + Type_id i_nTemplateParameterType ) + : sName(i_sName), + nOwner(i_nOwner), + nBase(i_nBase), + sTemplateParameter(i_sTemplateParameter), + nTemplateParameterType(i_nTemplateParameterType), + aElements() +{ +} + +Struct::~Struct() +{ +} + +void +Struct::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +Struct::get_AryClass() const +{ + return class_id; +} + +const String & +Struct::inq_LocalName() const +{ + return sName; +} + +Ce_id +Struct::inq_NameRoom() const +{ + return nOwner; +} + +Ce_id +Struct::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +Struct::inq_SightLevel() const +{ + return sl_File; +} + + +namespace ifc_struct +{ + +inline const Struct & +struct_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == Struct::class_id ); + return static_cast< const Struct& >(i_ce); +} + +Type_id +attr::Base( const CodeEntity & i_ce ) +{ + return struct_cast(i_ce).nBase; +} + +void +attr::Get_Elements( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>( struct_cast(i_ce).aElements ); +} + + +void +xref::Get_Derivations( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(struct_2s_Derivations)); +} + +void +xref::Get_SynonymTypedefs( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(struct_2s_SynonymTypedefs)); +} + +void +xref::Get_AsReturns( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(struct_2s_AsReturns)); +} + +void +xref::Get_AsParameters( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(struct_2s_AsParameters)); +} + +void +xref::Get_AsDataTypes( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(struct_2s_AsDataTypes)); +} + +} // namespace ifc_struct + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_structelem.cxx b/autodoc/source/ary/idl/i_structelem.cxx new file mode 100644 index 000000000000..1a19d195f457 --- /dev/null +++ b/autodoc/source/ary/idl/i_structelem.cxx @@ -0,0 +1,117 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_structelem.hxx> +#include <ary/idl/ik_structelem.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <sci_impl.hxx> + + +namespace ary +{ +namespace idl +{ + + +StructElement::StructElement( const String & i_sName, + Ce_id i_nOwner, + Ce_id i_nNameRoom, + Type_id i_nType ) + : sName(i_sName), + nOwner(i_nOwner), + nNameRoom(i_nNameRoom), + nType(i_nType) +{ +} + +StructElement::~StructElement() +{ +} + +void +StructElement::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +StructElement::get_AryClass() const +{ + return class_id; +} + +const String & +StructElement::inq_LocalName() const +{ + return sName; +} + +Ce_id +StructElement::inq_NameRoom() const +{ + return nNameRoom; +} + +Ce_id +StructElement::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +StructElement::inq_SightLevel() const +{ + return sl_Member; +} + + +namespace ifc_structelement +{ + +inline const StructElement & +selem_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == StructElement::class_id ); + return static_cast< const StructElement& >(i_ce); +} + +Type_id +attr::Type( const CodeEntity & i_ce ) +{ + return selem_cast(i_ce).nType; +} + +} // namespace ifc_structelement + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_traits.cxx b/autodoc/source/ary/idl/i_traits.cxx new file mode 100644 index 000000000000..1c12c5bc996f --- /dev/null +++ b/autodoc/source/ary/idl/i_traits.cxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_traits.hxx> + + +// NOT FULLY DEFINED SERVICES +#include <ary/namesort.hxx> +#include "is_ce.hxx" + + + +namespace ary +{ +namespace idl +{ + + + +//******************** Ce_Traits ********************// +Ce_Traits::entity_base_type & +Ce_Traits::EntityOf_(id_type i_id) +{ + csv_assert(i_id.IsValid()); + return Ce_Storage::Instance_()[i_id]; +} + +//******************** Ce_Compare ********************// +const Ce_Compare::key_type & +Ce_Compare::KeyOf_(const entity_base_type & i_entity) +{ + return i_entity.LocalName(); +} + +bool +Ce_Compare::Lesser_( const key_type & i_1, + const key_type & i_2 ) +{ + static ::ary::LesserName less_; + return less_(i_1,i_2); +} + + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/i_typedef.cxx b/autodoc/source/ary/idl/i_typedef.cxx new file mode 100644 index 000000000000..f33ef60921ca --- /dev/null +++ b/autodoc/source/ary/idl/i_typedef.cxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include <ary/idl/i_typedef.hxx> +#include <ary/idl/ik_typedef.hxx> + + +// NOT FULLY DECLARED SERVICES +#include <cosv/tpl/processor.hxx> +#include <sci_impl.hxx> +#include "i2s_calculator.hxx" + + +namespace ary +{ +namespace idl +{ + + +Typedef::Typedef( const String & i_sName, + Ce_id i_nOwner, + Type_id i_nDefiningType ) + : sName(i_sName), + nOwner(i_nOwner), + nDefiningType(i_nDefiningType) +{ +} + +Typedef::~Typedef() +{ +} + +void +Typedef::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +ClassId +Typedef::get_AryClass() const +{ + return class_id; +} + +const String & +Typedef::inq_LocalName() const +{ + return sName; +} + +Ce_id +Typedef::inq_NameRoom() const +{ + return nOwner; +} + +Ce_id +Typedef::inq_Owner() const +{ + return nOwner; +} + +E_SightLevel +Typedef::inq_SightLevel() const +{ + return sl_File; +} + + +namespace ifc_typedef +{ + +inline const Typedef & +typedef_cast( const CodeEntity & i_ce ) +{ + csv_assert( i_ce.AryClass() == Typedef::class_id ); + return static_cast< const Typedef& >(i_ce); +} + +Type_id +attr::DefiningType( const CodeEntity & i_ce ) +{ + return typedef_cast(i_ce).nDefiningType; +} + + +void +xref::Get_SynonymTypedefs( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(typedef_2s_SynonymTypedefs)); +} + +void +xref::Get_AsReturns( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(typedef_2s_AsReturns)); +} + +void +xref::Get_AsParameters( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(typedef_2s_AsParameters)); +} + +void +xref::Get_AsDataTypes( Dyn_CeIterator & o_result, + const CodeEntity & i_ce ) +{ + o_result = new SCI_Vector<Ce_id>(i_ce.Secondaries().List(typedef_2s_AsDataTypes)); +} + +} // namespace ifc_typedef + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/ia_ce.cxx b/autodoc/source/ary/idl/ia_ce.cxx new file mode 100644 index 000000000000..f78f5050a7db --- /dev/null +++ b/autodoc/source/ary/idl/ia_ce.cxx @@ -0,0 +1,581 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include "ia_ce.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <algorithm> +#include <cosv/tpl/tpltools.hxx> +#include <ary/idl/i_attribute.hxx> +#include <ary/idl/i_constant.hxx> +#include <ary/idl/i_constgroup.hxx> +#include <ary/idl/i_enum.hxx> +#include <ary/idl/i_enumvalue.hxx> +#include <ary/idl/i_exception.hxx> +#include <ary/idl/i_function.hxx> +#include <ary/idl/i_interface.hxx> +#include <ary/idl/i_module.hxx> +#include <ary/idl/i_namelookup.hxx> +#include <ary/idl/i_property.hxx> +#include <ary/idl/i_service.hxx> +#include <ary/idl/i_singleton.hxx> +#include <ary/idl/i_siservice.hxx> +#include <ary/idl/i_sisingleton.hxx> +#include <ary/idl/i_struct.hxx> +#include <ary/idl/i_structelem.hxx> +#include <ary/idl/i_traits.hxx> +#include <ary/idl/i_typedef.hxx> +#include <idsort.hxx> +#include "ia_type.hxx" +#include "is_ce.hxx" +#include "it_tplparam.hxx" + + + + +namespace ary +{ +namespace idl +{ + +inline Module & +CeAdmin::lhf_Access_Module( Ce_id i_nId ) + { return ary_cast<Module>(Storage()[i_nId]); } + +inline void +CeAdmin::lhf_Put2Storage_and_AssignId( CodeEntity & pass_io_rCe ) + { // This also assigns an ID to pass_io_rCe: + Storage().Store_Entity(pass_io_rCe); + my_NameDictionary().Add_Name( pass_io_rCe.LocalName(), + pass_io_rCe.CeId(), + pass_io_rCe.AryClass(), + pass_io_rCe.Owner() ); + } + +inline void +CeAdmin::lhf_Store_NewEntity( DYN CodeEntity & pass_io_rCe, + Module & i_rOwner ) +{ + lhf_Put2Storage_and_AssignId(pass_io_rCe); + i_rOwner.Add_Name(pass_io_rCe.LocalName(), pass_io_rCe.CeId()); +} + +inline void +CeAdmin::lhf_Store_NewEntity( DYN CodeEntity & pass_io_rCe, + Ce_id i_nOwnerModule ) +{ + lhf_Store_NewEntity(pass_io_rCe, lhf_Access_Module(i_nOwnerModule)); +} + + + +CeAdmin::CeAdmin( NameLookup & io_rNameDictionary, + TypeAdmin & io_rTypePilot ) + : pStorage(new Ce_Storage), + pGlobalNamespace(0), + pNameDictionary(&io_rNameDictionary), + pTypePilot(&io_rTypePilot) +{ + Storage().Set_Reserved( + predefined::ce_GlobalNamespace, + *new Module ); + pGlobalNamespace = &lhf_Access_Module(Ce_id(predefined::ce_GlobalNamespace)); +} + +CeAdmin::~CeAdmin() +{ +} + + + +Module & +CeAdmin::CheckIn_Module( Ce_id i_nParentId, + const String & i_sName ) +{ + Module & rOwner = lhf_Access_Module(i_nParentId); + Ce_id nId = rOwner.Search_Name(i_sName); + if (nId.IsValid()) + { + return lhf_Access_Module(nId); + } + + Module & ret = *new Module( i_sName, + rOwner ); + lhf_Store_NewEntity(ret, rOwner); + return ret; +} + +Service & +CeAdmin::Store_Service( Ce_id i_nOwner, + const String & i_sName ) +{ + Service & ret = *new Service( i_sName, + i_nOwner ); + lhf_Store_NewEntity(ret, i_nOwner); + return ret; +} + +SglIfcService & +CeAdmin::Store_SglIfcService( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nBaseInterface ) +{ + SglIfcService & + ret = *new SglIfcService( i_sName, + i_nOwner, + i_nBaseInterface ); + lhf_Store_NewEntity(ret, i_nOwner); + return ret; +} + +Interface & +CeAdmin::Store_Interface( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nBase ) +{ + Interface & ret = *new Interface( i_sName, + i_nOwner ); + lhf_Store_NewEntity(ret, i_nOwner); + if (i_nBase.IsValid()) + ret.Add_Base(i_nBase, 0); + return ret; +} + +Struct & +CeAdmin::Store_Struct( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nBase, + const String & i_sTemplateParam ) +{ + if (NOT i_sTemplateParam.empty()) + { + return lhf_Store_TplStruct( i_nOwner, + i_sName, + i_nBase, + i_sTemplateParam ); + } + + Struct & ret = *new Struct( i_sName, + i_nOwner, + i_nBase, + String::Null_(), + Type_id::Null_() ); + lhf_Store_NewEntity(ret, i_nOwner); + + return ret; +} + +Exception & +CeAdmin::Store_Exception( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nBase ) +{ + Exception & ret = *new Exception( i_sName, + i_nOwner, + i_nBase ); + lhf_Store_NewEntity(ret, i_nOwner); + return ret; +} + +Enum & +CeAdmin::Store_Enum( Ce_id i_nOwner, + const String & i_sName ) +{ + Enum & ret = *new Enum( i_sName, + i_nOwner ); + lhf_Store_NewEntity(ret, i_nOwner); + return ret; +} + +Typedef & +CeAdmin::Store_Typedef( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nDefiningType ) +{ + Typedef & ret = *new Typedef( i_sName, + i_nOwner, + i_nDefiningType ); + lhf_Store_NewEntity(ret, i_nOwner); + return ret; +} + + +ConstantsGroup & +CeAdmin::Store_ConstantsGroup( Ce_id i_nOwner, + const String & i_sName ) +{ + ConstantsGroup & ret = *new ConstantsGroup( i_sName, + i_nOwner ); + lhf_Store_NewEntity(ret, i_nOwner); + return ret; +} + +Singleton & +CeAdmin::Store_Singleton( Ce_id i_nOwner, + const String & i_sName ) +{ + Singleton & ret = *new Singleton( i_sName, + i_nOwner ); + lhf_Store_NewEntity(ret, i_nOwner); + return ret; +} + +SglIfcSingleton & +CeAdmin::Store_SglIfcSingleton( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nBaseInterface ) +{ + SglIfcSingleton & + ret = *new SglIfcSingleton( i_sName, + i_nOwner, + i_nBaseInterface ); + lhf_Store_NewEntity(ret, i_nOwner); + return ret; +} + +Constant & +CeAdmin::Store_Constant( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nType, + const String & i_sValue ) +{ + ConstantsGroup & + rOwner = ary_cast<ConstantsGroup>(Storage()[i_nOwner]); + Constant & ret = *new Constant( i_sName, + i_nOwner, + rOwner.NameRoom(), + i_nType, + i_sValue ); + lhf_Put2Storage_and_AssignId(ret); + rOwner.Add_Constant(ret.CeId()); + return ret; +} + +Property & +CeAdmin::Store_Property( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nType, + Property::Stereotypes i_stereotypes ) +{ + Service & + rOwner = ary_cast<Service>(Storage()[i_nOwner]); + Property & ret = *new Property( i_sName, + i_nOwner, + rOwner.NameRoom(), + i_nType, + i_stereotypes ); + lhf_Put2Storage_and_AssignId(ret); + rOwner.Add_Property(ret.CeId()); + return ret; +} + +Function & +CeAdmin::Store_Function( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nReturnType, + bool i_bOneWay ) +{ + Interface & + rOwner = ary_cast<Interface>(Storage()[i_nOwner]); + Function & ret = *new Function( i_sName, + i_nOwner, + rOwner.NameRoom(), + i_nReturnType, + i_bOneWay); + lhf_Put2Storage_and_AssignId(ret); + rOwner.Add_Function(ret.CeId()); + return ret; +} + +Function & +CeAdmin::Store_ServiceConstructor( Ce_id i_nOwner, + const String & i_sName ) +{ + SglIfcService & + rOwner = ary_cast<SglIfcService>(Storage()[i_nOwner]); + Function & ret = *new Function( i_sName, + i_nOwner, + rOwner.NameRoom() ); + lhf_Put2Storage_and_AssignId(ret); + rOwner.Add_Constructor(ret.CeId()); + return ret; +} + +StructElement & +CeAdmin::Store_StructMember( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nType ) +{ + Struct & + rOwner = ary_cast<Struct>(Storage()[i_nOwner]); + StructElement & ret = *new StructElement( i_sName, + i_nOwner, + rOwner.NameRoom(), + i_nType ); + lhf_Put2Storage_and_AssignId(ret); + rOwner.Add_Member(ret.CeId()); + return ret; +} + +StructElement & +CeAdmin::Store_ExceptionMember( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nType ) +{ + Exception & + rOwner = ary_cast<Exception>(Storage()[i_nOwner]); + StructElement & ret = *new StructElement( i_sName, + i_nOwner, + rOwner.NameRoom(), + i_nType ); + lhf_Put2Storage_and_AssignId(ret); + rOwner.Add_Member(ret.CeId()); + return ret; +} + +EnumValue & +CeAdmin::Store_EnumValue( Ce_id i_nOwner, + const String & i_sName, + const String & i_sValue ) +{ + Enum & + rOwner = ary_cast<Enum>(Storage()[i_nOwner]); + EnumValue & ret = *new EnumValue( i_sName, + i_nOwner, + rOwner.NameRoom(), + i_sValue ); + lhf_Put2Storage_and_AssignId(ret); + rOwner.Add_Value(ret.CeId()); + return ret; +} + +Attribute & +CeAdmin::Store_Attribute( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nType, + bool i_bReadOnly, + bool i_bBound ) +{ + Interface & + rOwner = ary_cast<Interface>(Storage()[i_nOwner]); + + Attribute & ret = *new Attribute ( i_sName, + i_nOwner, + rOwner.NameRoom(), + i_nType, + i_bReadOnly, + i_bBound ); + lhf_Put2Storage_and_AssignId(ret); + rOwner.Add_Attribute(ret.CeId()); + return ret; +} + +const Module & +CeAdmin::GlobalNamespace() const +{ + csv_assert(pGlobalNamespace); + return *pGlobalNamespace; +} + +const CodeEntity & +CeAdmin::Find_Ce( Ce_id i_nId ) const +{ + return Storage()[i_nId]; + +} + +const Module & +CeAdmin::Find_Module( Ce_id i_nId ) const +{ + return ary_cast<Module>(Storage()[i_nId]); +} + +const Module * +CeAdmin::Search_Module( Ce_id i_nId ) const +{ + if (NOT i_nId.IsValid()) + return 0; + return ary_cast<Module>( & Storage()[i_nId] ); +} + +const Function & +CeAdmin::Find_Function( Ce_id i_nId ) const +{ + return ary_cast<Function>(Storage()[i_nId]); +} + +const Property & +CeAdmin::Find_Property( Ce_id i_nId ) const +{ + return ary_cast<Property>(Storage()[i_nId]); +} + +const EnumValue & +CeAdmin::Find_EnumValue( Ce_id i_nId ) const +{ + return ary_cast<EnumValue>(Storage()[i_nId]); +} + +const Constant & +CeAdmin::Find_Constant( Ce_id i_nId ) const +{ + return ary_cast<Constant>(Storage()[i_nId]); +} + +const StructElement & +CeAdmin::Find_StructElement( Ce_id i_nId ) const +{ + return ary_cast<StructElement>(Storage()[i_nId]); +} + +void +CeAdmin::Get_Text( StringVector & o_module, + String & o_ce, + String & o_member, + const CodeEntity & i_ce ) const +{ + const CodeEntity * pCe = &i_ce; + csv::erase_container(o_module); + o_ce.clear(); + o_member.clear(); + + switch ( pCe->SightLevel() ) + { + // Here are intentionally no breaks! + case sl_Member: + if ( is_type<Function>(*pCe) ) + o_member = StreamLock(200)() + << pCe->LocalName() + << "()" + << c_str; + else + o_member = pCe->LocalName(); + pCe = & Storage()[pCe->Owner()]; + case sl_File: + o_ce = pCe->LocalName(); + pCe = & Storage()[pCe->NameRoom()]; + case sl_Module: + get_ModuleText(o_module,*pCe); + break; + default: + csv_assert(false); + } // end switch +} + +const NameLookup & +CeAdmin::NameDictionary() const +{ + return *pNameDictionary; +} + + +void +CeAdmin::Get_AlphabeticalIndex( std::vector<Ce_id> & o_rResult, + alphabetical_index::E_Letter i_cLetter ) const +{ + const int C_nLowerUpperDiff = 'a'-'A'; + + // Establishing filter: + UINT8 filter[256]; + + UINT8 nLetter = static_cast<UINT8>(i_cLetter); + memset(filter, 0, 256); + filter[nLetter] = 1; + if ( i_cLetter != alphabetical_index::non_alpha ) + filter[nLetter - C_nLowerUpperDiff] = 1; + + // Gather entities which start with i_cLetter: + o_rResult.reserve(1000); + idl::Ce_Storage::c_iter + itEnd = Storage().End(); + for ( idl::Ce_Storage::c_iter it = Storage().BeginUnreserved(); + it != itEnd; + ++it ) + { + if ( filter[ static_cast<UINT8>(*(*it).LocalName().c_str()) ] == 1 ) + o_rResult.push_back( (*it).CeId() ); + } + + std::sort( o_rResult.begin(), + o_rResult.end(), + IdSorter<Ce_Compare>() ); +} + + +Module & +CeAdmin::GlobalNamespace() +{ + csv_assert(pGlobalNamespace); + return *pGlobalNamespace; +} + +CodeEntity & +CeAdmin::Find_Ce( Ce_id i_nId ) +{ + return Storage()[i_nId]; +} + +void +CeAdmin::get_ModuleText( StringVector & o_module, + const CodeEntity & i_ce ) const +{ + if (i_ce.NameRoom().IsValid()) + { + const CodeEntity & + rParent = Storage()[i_ce.NameRoom()]; + get_ModuleText(o_module, rParent); + o_module.push_back(i_ce.LocalName()); + } +} + +Struct & +CeAdmin::lhf_Store_TplStruct( Ce_id i_nOwner, + const String & i_sName, + Type_id i_nBase, + const String & i_sTemplateParam ) +{ + csv_assert(NOT i_sTemplateParam.empty()); + + TemplateParamType & + rTpt = pTypePilot->Store_TemplateParamType(i_sTemplateParam); + + Struct & ret = *new Struct( i_sName, + i_nOwner, + i_nBase, + i_sTemplateParam, + rTpt.TypeId() ); + lhf_Store_NewEntity(ret, i_nOwner); + rTpt.Set_StructId(ret.CeId()); + + return ret; +} + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/ia_ce.hxx b/autodoc/source/ary/idl/ia_ce.hxx new file mode 100644 index 000000000000..48d8907eb3a3 --- /dev/null +++ b/autodoc/source/ary/idl/ia_ce.hxx @@ -0,0 +1,253 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_IA_CE_HXX +#define ARY_IDL_IA_CE_HXX + + +// USED SERVICES + // BASE CLASSES +#include <ary/idl/ip_ce.hxx> + // COMPONENTS + // PARAMETERS + + +namespace ary +{ +namespace idl +{ + +class Ce_Storage; +class TypeAdmin; + + +/** @resp + Implements ::ary::idl::CePilot. Provides the access logic for all + IDL code entities. + + @collab Ce_Storage + @collab TypeAdmin + + @see CodeEntity +*/ +class CeAdmin : public CePilot +{ + public: + // LIFECYCLE + CeAdmin( + NameLookup & io_rNameDictionary, + TypeAdmin & io_rTypePilot ); + virtual ~CeAdmin(); + + // OPERATIONS + + // INQUIRY + const Ce_Storage & Storage() const; + + // ACCESS + Ce_Storage & Storage(); + + // INHERITED + // Interface ::ary::idl::CePilot: + virtual Module & CheckIn_Module( + Ce_id i_nParentId, + const String & i_sName ); + virtual Service & Store_Service( + Ce_id i_nOwner, + const String & i_sName ); + virtual SglIfcService & + Store_SglIfcService( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nBaseInterface ); + virtual Interface & Store_Interface( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nBase ); + virtual Struct & Store_Struct( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nBase, + const String & i_sTemplateParam ); + virtual Exception & Store_Exception( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nBase ); + virtual Enum & Store_Enum( + Ce_id i_nOwner, + const String & i_sName ); + virtual Typedef & Store_Typedef( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nDefiningType ); + virtual ConstantsGroup & + Store_ConstantsGroup( + Ce_id i_nOwner, + const String & i_sName ); + virtual Singleton & Store_Singleton( + Ce_id i_nOwner, + const String & i_sName ); + virtual SglIfcSingleton & + Store_SglIfcSingleton( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nBaseInterface ); + + virtual Constant & Store_Constant( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nType, + const String & i_sValue ); + virtual Property & Store_Property( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nType, + Property::Stereotypes + i_stereotypes ); + virtual Function & Store_Function( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nReturnType, + bool i_bOneWay ); + virtual Function & Store_ServiceConstructor( + Ce_id i_nOwner, + const String & i_sName ); + virtual StructElement & + Store_StructMember( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nType ); + virtual StructElement & + Store_ExceptionMember( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nType ); + virtual EnumValue & Store_EnumValue( + Ce_id i_nOwner, + const String & i_sName, + const String & i_sValue ); + virtual Attribute & Store_Attribute( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nType, + bool i_bReadOnly, + bool i_bBound ); + + virtual const Module & + GlobalNamespace() const; + virtual const CodeEntity & + Find_Ce( + Ce_id i_nId ) const; + virtual const Module & + Find_Module( + Ce_id i_nId ) const; + virtual const Module * + Search_Module( + Ce_id i_nId ) const; + virtual const Function & + Find_Function( + Ce_id i_nId ) const; + virtual const Property & + Find_Property( + Ce_id i_nId ) const; + virtual const EnumValue & + Find_EnumValue( + Ce_id i_nId ) const; + virtual const Constant & + Find_Constant( + Ce_id i_nId ) const; + virtual const StructElement & + Find_StructElement( + Ce_id i_nId ) const; + virtual void Get_Text( + StringVector & o_module, + String & o_ce, + String & o_member, + const CodeEntity & i_ce ) const; + virtual const NameLookup & + NameDictionary() const; + virtual void Get_AlphabeticalIndex( + std::vector<Ce_id> & + o_rResult, + alphabetical_index::E_Letter + i_cLetter) const; + // ACCESS + virtual Module & GlobalNamespace(); + virtual CodeEntity & + Find_Ce( + Ce_id i_nId ); + private: + // Locals + Module & lhf_Access_Module( + Ce_id i_nId ); + void lhf_Put2Storage_and_AssignId( + CodeEntity & pass_io_rCe ); + void lhf_Store_NewEntity( + DYN CodeEntity & pass_io_rCe, + Module & i_rOwner ); + void lhf_Store_NewEntity( + DYN CodeEntity & pass_io_rCe, + Ce_id i_nOwnerModule ); + void get_ModuleText( + StringVector & o_module, + const CodeEntity & i_ce ) const; + Struct & lhf_Store_TplStruct( + Ce_id i_nOwner, + const String & i_sName, + Type_id i_nBase, + const String & i_sTemplateParam ); + + const Ce_Storage & my_Storage() const; + Ce_Storage & my_Storage(); + NameLookup & my_NameDictionary() { return *pNameDictionary; } + + // DATA + Dyn<Ce_Storage> pStorage; /// @inv pStorage != 0; + Module * pGlobalNamespace; + NameLookup * pNameDictionary; + TypeAdmin * pTypePilot; +}; + + +// IMPLEMENTATION +inline const Ce_Storage & +CeAdmin::Storage() const +{ + return *pStorage; +} + +inline Ce_Storage & +CeAdmin::Storage() +{ + return *pStorage; +} + + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/ia_type.cxx b/autodoc/source/ary/idl/ia_type.cxx new file mode 100644 index 000000000000..eb47d355c9ae --- /dev/null +++ b/autodoc/source/ary/idl/ia_type.cxx @@ -0,0 +1,364 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include "ia_type.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <ary/qualiname.hxx> +#include <ary/idl/i_module.hxx> +#include <ary/idl/i_type.hxx> +#include <ary/idl/ip_ce.hxx> +#include "ia_ce.hxx" +#include "is_type.hxx" +#include "it_builtin.hxx" +#include "it_ce.hxx" +#include "it_explicit.hxx" +#include "it_sequence.hxx" +#include "it_tplparam.hxx" +#include "it_xnameroom.hxx" + + + +namespace ary +{ +namespace idl +{ + +String MakeTemplateName( + const String & i_localName, + const std::vector<Type_id> & + i_templateParameters ); + + + +inline CeAdmin & +TypeAdmin::my_Ces() const + { return *pCes; } + +inline void +TypeAdmin::lhf_Put2Storage_and_AssignId( DYN Type & pass_io_rType ) + { // This also assigns an ID to pass_io_rType: + Storage().Store_Entity(pass_io_rType); } + +inline Type_id +TypeAdmin::lhf_findBuiltInType( const String & i_sName ) + { return ary_cast<ExplicitNameRoom>(Storage()[nXNameRoom_Root]) + .Search_Name(i_sName); } + +inline const ExplicitNameRoom & +TypeAdmin::find_ExplicitNameRoom( Type_id i_nType ) const +{ + return ary_cast<ExplicitNameRoom>(Storage()[i_nType]); +} + +inline ExplicitNameRoom & +TypeAdmin::find_ExplicitNameRoom( Type_id i_nType ) +{ + return ary_cast<ExplicitNameRoom>(Storage()[i_nType]); +} + +ExplicitNameRoom & +TypeAdmin::lhf_CheckIn_XNameRoom( const QualifiedName & i_rName, + Ce_id i_nModuleOfOccurrence ) +{ + Type_id nRoot = i_rName.IsAbsolute() + ? Type_id( predefined::type_GlobalXNameRoom ) + : lhf_Get_NameRoomRoot_forModuleofOccurrence( i_nModuleOfOccurrence ).TypeId(); + + if ( i_rName.NamespaceDepth() == 0 ) + return find_ExplicitNameRoom(nRoot); + + QualifiedName::namespace_iterator it = i_rName.first_namespace(); + ExplicitNameRoom * + ret = & find_ExplicitNameRoom(nRoot); + for ( ; it != i_rName.end_namespace(); ++it ) + { + Type_id + found = ret->Search_Name(*it); + if (found.IsValid()) + { + ret = & find_ExplicitNameRoom(found); + } + else + { + ExplicitNameRoom & + rNew = *new ExplicitNameRoom(*it, *ret); + lhf_Put2Storage_and_AssignId(rNew); + ret->Add_Name( rNew.Name(), rNew.TypeId() ); + ret = &rNew; + } + + } // end for + return *ret; +} + +Type_id +TypeAdmin::lhf_CheckIn_TypeName( const String & i_sLocalName, + ExplicitNameRoom & io_rXNameRoom, + Ce_id i_nModuleOfOccurrence, + const std::vector<Type_id> * i_templateParameters ) +{ + String sSearchLocalName( i_sLocalName ); + if ( i_templateParameters != 0 + ? i_templateParameters->size() > 0 + : false ) + { + sSearchLocalName = MakeTemplateName( + i_sLocalName, + *i_templateParameters); + } + + Type_id + ret = io_rXNameRoom.Search_Name(sSearchLocalName); + if (NOT ret.IsValid()) + { + DYN Type & + rNewType = *new ExplicitType( i_sLocalName, + io_rXNameRoom.TypeId(), + i_nModuleOfOccurrence, + i_templateParameters ); + lhf_Put2Storage_and_AssignId(rNewType); + ret = rNewType.TypeId(); + io_rXNameRoom.Add_Name( sSearchLocalName, ret ); + } + return ret; +} + +Type_id +TypeAdmin::lhf_CheckIn_Sequence(Type_id i_nType) +{ + Type_id + ret = Storage().Search_SequenceOf(i_nType); + + if (NOT ret.IsValid()) + { + DYN Type & + rNewSeq = *new Sequence(i_nType); + lhf_Put2Storage_and_AssignId(rNewSeq); + ret = rNewSeq.Id(); + Storage().Add_Sequence(i_nType, ret); + } + return ret; +} + +void +TypeAdmin::lhf_CheckIn_BuiltInType( const char * i_sName, + Rid i_nId ) +{ + DYN BuiltInType & + rNewType = *new BuiltInType(i_sName); + Storage().Set_Reserved(i_nId, rNewType); + + // Put them into both roots, to catch the syntactically correct + // (though unlikely) ::Any, ::long etc. + Type_id + nId(i_nId); + find_ExplicitNameRoom(nXNameRoom_Root).Add_Name(i_sName, nId); + find_ExplicitNameRoom(nXNameRoom_Global).Add_Name(i_sName, nId); +} + +ExplicitNameRoom & +TypeAdmin::lhf_Get_NameRoomRoot_forModuleofOccurrence( Ce_id i_nModuleOfOccurrence ) +{ + const Type_id * + pFound = csv::find_in_map( aMap_ModuleOfOccurrence2NameRoomRoot, + i_nModuleOfOccurrence ); + if (pFound != 0) + return find_ExplicitNameRoom(*pFound); + + ExplicitNameRoom & + ret = *new ExplicitNameRoom; + lhf_Put2Storage_and_AssignId(ret); + aMap_ModuleOfOccurrence2NameRoomRoot.insert(std::pair< const Ce_id, Type_id>(i_nModuleOfOccurrence,ret.TypeId())); + return ret; +} + +TypeAdmin::TypeAdmin() + : pStorage(new Type_Storage), + pCes(0), // Needs to be set directly after creation. + nXNameRoom_Root( static_cast<ary::Rid>(predefined::type_Root_ofXNameRooms) ), + nXNameRoom_Global( static_cast<ary::Rid>(predefined::type_GlobalXNameRoom) ), + aMap_ModuleOfOccurrence2NameRoomRoot() +{ + DYN ExplicitNameRoom & + drRoot = *new ExplicitNameRoom; + Storage().Set_Reserved( nXNameRoom_Root.Value(), drRoot ); + + DYN ExplicitNameRoom & + drGlobal = *new ExplicitNameRoom(String::Null_(), drRoot); + Storage().Set_Reserved( nXNameRoom_Global.Value(), drGlobal ); + drRoot.Add_Name( drGlobal.Name(), nXNameRoom_Global ); + + lhf_Setup_BuildInTypes(); +} + +TypeAdmin::~TypeAdmin() +{ +} + +void +TypeAdmin::lhf_Setup_BuildInTypes() +{ + lhf_CheckIn_BuiltInType("any", predefined::type_any); + lhf_CheckIn_BuiltInType("boolean", predefined::type_boolean); + lhf_CheckIn_BuiltInType("byte", predefined::type_byte); + lhf_CheckIn_BuiltInType("char", predefined::type_char); + lhf_CheckIn_BuiltInType("double", predefined::type_double); + lhf_CheckIn_BuiltInType("float", predefined::type_float); + lhf_CheckIn_BuiltInType("hyper", predefined::type_hyper); + lhf_CheckIn_BuiltInType("long", predefined::type_long); + lhf_CheckIn_BuiltInType("short", predefined::type_short); + lhf_CheckIn_BuiltInType("string", predefined::type_string); + lhf_CheckIn_BuiltInType("type", predefined::type_type); + lhf_CheckIn_BuiltInType("void", predefined::type_void); + lhf_CheckIn_BuiltInType("unsigned hyper", predefined::type_u_hyper); + lhf_CheckIn_BuiltInType("unsigned long", predefined::type_u_long); + lhf_CheckIn_BuiltInType("unsigned short", predefined::type_u_short); +} + +const Type & +TypeAdmin::CheckIn_Type( QualifiedName & i_rFullName, + uintt i_nSequenceCount, + Ce_id i_nModuleOfOccurrence, + const std::vector<Type_id> * i_templateParameters ) +{ + // Look in built-in types: + Type_id + nType = lhf_findBuiltInType(i_rFullName.LocalName()); + if (NOT nType.IsValid()) + { // No built-in type: + ExplicitNameRoom & + rNameRoom = lhf_CheckIn_XNameRoom(i_rFullName,i_nModuleOfOccurrence); + nType = lhf_CheckIn_TypeName( i_rFullName.LocalName(), + rNameRoom, + i_nModuleOfOccurrence, + i_templateParameters ); + } // endif + + for ( uintt s = 0; s < i_nSequenceCount; ++s ) + { + nType = lhf_CheckIn_Sequence(nType); + } + + return Storage()[nType]; +} + +TemplateParamType & +TypeAdmin::Store_TemplateParamType( String i_sName ) +{ + DYN TemplateParamType & + ret = *new TemplateParamType( i_sName ); + lhf_Put2Storage_and_AssignId(ret); + return ret; +} + +const Type & +TypeAdmin::Find_Type( Type_id i_nType ) const +{ + return Storage()[i_nType]; +} + +String +TypeAdmin::Search_LocalNameOf( Type_id i_nType ) const +{ + const Type * + pType = Storage().Exists(i_nType) + ? 0 + : & Storage()[i_nType]; + if (pType != 0) + { + switch (pType->AryClass()) + { + case Ce_Type::class_id: + case ExplicitType::class_id: + case BuiltInType::class_id: + return static_cast< const Named_Type& >(*pType).Name(); + } + } + return String::Null_(); +} + +Ce_id +TypeAdmin::Search_CeRelatedTo( Type_id i_nType ) const +{ + const Ce_Type * + ret = ary_cast<Ce_Type>( & Storage()[i_nType] ); + return ret != 0 + ? ret->RelatedCe() + : Ce_id_Null(); +} + +const ExplicitNameRoom & +TypeAdmin::Find_XNameRoom( Type_id i_nType ) const +{ + return find_ExplicitNameRoom(i_nType); +} + +bool +TypeAdmin::IsBuiltInOrRelated( const Type & i_rType ) const +{ + if ( is_type<BuiltInType>(i_rType) ) + return true; + else + { + const Type * + pType = &i_rType; + while (is_type<Sequence>(*pType)) + { + Type_id + nt = ary_cast<Sequence>(pType)->RelatedType(); + if (NOT nt.IsValid()) + return false; + pType = & Storage()[nt]; + } + return is_type<BuiltInType>(*pType); + } +} + + +String +MakeTemplateName( const String & i_localName, + const std::vector<Type_id> & ) +{ + StreamLock + sl(200); + + // This is the simple solution, assuming that there is only + // one version of templatisation allowed with a given name. + return + sl() + << i_localName + << C_cTemplateDelimiter + << c_str; +} + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/ia_type.hxx b/autodoc/source/ary/idl/ia_type.hxx new file mode 100644 index 000000000000..050519234626 --- /dev/null +++ b/autodoc/source/ary/idl/ia_type.hxx @@ -0,0 +1,170 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_IA_TYPE_HXX +#define ARY_IDL_IA_TYPE_HXX + + +// USED SERVICES + // BASE CLASSES +#include <ary/idl/ip_type.hxx> + // COMPONENTS + // PARAMETERS +#include "is_type.hxx" + + +namespace ary +{ +namespace idl +{ + + +class Type_Storage; +class CeAdmin; +class TemplateParamType; + + +class TypeAdmin : public TypePilot +{ + public: + // LIFECYCLE + TypeAdmin(); + + void Assign_CePilot( + CeAdmin & io_rCes ); + virtual ~TypeAdmin(); + + // OPERATIONS + TemplateParamType & Store_TemplateParamType( + String i_sName ); + // INQUIRY + const Type_Storage & + Storage() const; + // ACCESS + Type_Storage & Storage(); + + // INHERITED + // Interface TypePilot: + virtual const Type & + CheckIn_Type( + QualifiedName & i_rFullName, + uintt i_nSequenceCount, + Ce_id i_nModuleOfOccurrence, + const std::vector<Type_id> * + i_templateParameters ); + virtual const Type & + Find_Type( + Type_id i_nType ) const; + virtual String Search_LocalNameOf( + Type_id i_nType ) const; + virtual Ce_id Search_CeRelatedTo( + Type_id i_nType ) const; + virtual const ExplicitNameRoom & + Find_XNameRoom( + Type_id i_nType ) const; + virtual bool IsBuiltInOrRelated( + const Type & i_rType ) const; + private: + // Locals + CeAdmin & my_Ces() const; + + void lhf_Put2Storage_and_AssignId( + DYN Type & pass_io_rType ); + + ExplicitNameRoom & lhf_CheckIn_XNameRoom( + const QualifiedName & + i_rName, + Ce_id i_nModuleOfOccurrence ); + Type_id lhf_CheckIn_TypeName( + const String & i_sLocalName, + ExplicitNameRoom & io_rExplicitNameRoom, + Ce_id i_nModuleOfOccurrence, + const std::vector<Type_id> * + i_templateParameters ); + Type_id lhf_CheckIn_Sequence( + Type_id i_nType ); + void lhf_CheckIn_BuiltInType( + const char * i_sName, + Rid i_nId ); + const ExplicitNameRoom & + find_ExplicitNameRoom( + Type_id i_nType ) const; + ExplicitNameRoom & find_ExplicitNameRoom( + Type_id i_nType ); + ExplicitNameRoom & lhf_Get_NameRoomRoot_forModuleofOccurrence( + Ce_id i_nModuleOfOccurrence ); + + /// @return Type_id::Null_(), if not found. + Type_id lhf_findBuiltInType( + const String & i_sName ); + /// @precond nGlobalNamespace must be valid. + void lhf_Setup_BuildInTypes(); + + // DATA + Type_Storage * pStorage; /// @inv pStorage != 0 + CeAdmin * pCes; /// @inv pCes != 0 + + // Data for saving time: + Type_id nXNameRoom_Root; /** @descr This is different from nXNameRoom_Global, because + the root of explicit name rooms in code without leading "::" is unknown. + */ + Type_id nXNameRoom_Global; + + // HACK, because this needs to be saved somehow and is not in storage: + std::map<Ce_id, Type_id> + aMap_ModuleOfOccurrence2NameRoomRoot; +}; + + + + + +// IMPLEMENTATION +inline const Type_Storage & +TypeAdmin::Storage() const +{ + return *pStorage; +} + +inline Type_Storage & +TypeAdmin::Storage() +{ + return *pStorage; +} + +inline void +TypeAdmin::Assign_CePilot( CeAdmin & io_rCes ) +{ + pCes = &io_rCes; +} + + + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/is_ce.cxx b/autodoc/source/ary/idl/is_ce.cxx new file mode 100644 index 000000000000..eb4b93a6dfce --- /dev/null +++ b/autodoc/source/ary/idl/is_ce.cxx @@ -0,0 +1,65 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include "is_ce.hxx" + +// NOT FULLY DEFINED SERVICES + +namespace +{ + const uintt + C_nReservedElements = ary::idl::predefined::ce_MAX; // Skipping "0" and the GlobalNamespace +} + + +namespace ary +{ +namespace idl +{ + +Ce_Storage * Ce_Storage::pInstance_ = 0; + + + + +Ce_Storage::Ce_Storage() + : stg::Storage<CodeEntity>(C_nReservedElements) +{ + csv_assert(pInstance_ == 0); + pInstance_ = this; +} + +Ce_Storage::~Ce_Storage() +{ + csv_assert(pInstance_ != 0); + pInstance_ = 0; +} + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/is_ce.hxx b/autodoc/source/ary/idl/is_ce.hxx new file mode 100644 index 000000000000..c1edee0b23ff --- /dev/null +++ b/autodoc/source/ary/idl/is_ce.hxx @@ -0,0 +1,79 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_IS_CE_HXX +#define ARY_IDL_IS_CE_HXX + +// BASE CLASSES +#include <store/s_storage.hxx> +// USED SERVICES +#include <ary/idl/i_ce.hxx> + + + + +namespace ary +{ +namespace idl +{ + + +/** The data base for all ->ary::idl::CodeEntity objects. +*/ +class Ce_Storage : public ::ary::stg::Storage< ::ary::idl::CodeEntity > +{ + public: + Ce_Storage(); + virtual ~Ce_Storage(); + + static Ce_Storage & Instance_() { csv_assert(pInstance_ != 0); + return *pInstance_; } + private: + // DATA + static Ce_Storage * pInstance_; +}; + + + + +namespace predefined +{ + +enum E_CodeEntity +{ + ce_GlobalNamespace = 1, + ce_MAX +}; + +} // namespace predefined + + + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/is_type.cxx b/autodoc/source/ary/idl/is_type.cxx new file mode 100644 index 000000000000..269286413b17 --- /dev/null +++ b/autodoc/source/ary/idl/is_type.cxx @@ -0,0 +1,83 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include "is_type.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/tpl/tpltools.hxx> + +namespace +{ + +const uintt + C_nReservedElements = ary::idl::predefined::type_MAX; // Skipping "0" and the built in types. +} + + +namespace ary +{ +namespace idl +{ + +Type_Storage * Type_Storage::pInstance_ = 0; + + + +Type_Storage::Type_Storage() + : stg::Storage<Type>(C_nReservedElements), + aSequenceIndex() +{ + csv_assert(pInstance_ == 0); + pInstance_ = this; +} + +Type_Storage::~Type_Storage() +{ + csv_assert(pInstance_ != 0); + pInstance_ = 0; +} + +void +Type_Storage::Add_Sequence( Type_id i_nRelatedType, + Type_id i_nSequence ) +{ + aSequenceIndex[i_nRelatedType] = i_nSequence; +} + +Type_id +Type_Storage::Search_SequenceOf( Type_id i_nRelatedType ) +{ + return csv::value_from_map(aSequenceIndex, i_nRelatedType); +} + + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/is_type.hxx b/autodoc/source/ary/idl/is_type.hxx new file mode 100644 index 000000000000..b905602238f0 --- /dev/null +++ b/autodoc/source/ary/idl/is_type.hxx @@ -0,0 +1,122 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_IS_TYPE_HXX +#define ARY_IDL_IS_TYPE_HXX + +// BASE CLASSES +#include <store/s_storage.hxx> +// USED SERVICES +#include <ary/idl/i_type.hxx> + + + + +namespace ary +{ +namespace idl +{ + + +/** The data base for all ->ary::idl::CodeEntity objects. +*/ +class Type_Storage : public ::ary::stg::Storage< ::ary::idl::Type > +{ + public: + Type_Storage(); + ~Type_Storage(); + + + void Add_Sequence( + Type_id i_nRelatedType, + Type_id i_nSequence ); + + Type_id Search_SequenceOf( + Type_id i_nRelatedType ); + + static Type_Storage & + Instance_(); + private: + /** value_type.first := id of the base type + value_type.second := id of the sequence<base type> + */ + typedef std::map<Type_id,Type_id> Map_Sequences; + + // DATA + Map_Sequences aSequenceIndex; + + static Type_Storage * + pInstance_; +}; + + + +namespace predefined +{ + +enum E_Type +{ + type_Root_ofXNameRooms = 1, + type_GlobalXNameRoom, + type_any, + type_boolean, + type_byte, + type_char, + type_double, + type_float, + type_hyper, + type_long, + type_short, + type_string, + type_type, + type_void, + type_u_hyper, + type_u_long, + type_u_short, + type_ellipse, // ... + type_MAX +}; + +} // namespace predefined + + + + +// IMPLEMENTATION +inline Type_Storage & +Type_Storage::Instance_() +{ + csv_assert(pInstance_ != 0); + return *pInstance_; +} + + + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/it_builtin.cxx b/autodoc/source/ary/idl/it_builtin.cxx new file mode 100644 index 000000000000..9c543a7bc798 --- /dev/null +++ b/autodoc/source/ary/idl/it_builtin.cxx @@ -0,0 +1,79 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include "it_builtin.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/tpl/processor.hxx> + + + +namespace ary +{ +namespace idl +{ + + + +BuiltInType::BuiltInType( const char * i_sName ) + : Named_Type(i_sName) +{ +} + +BuiltInType::~BuiltInType() +{ +} + +ClassId +BuiltInType::get_AryClass() const +{ + return class_id; +} + +void +BuiltInType::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +void +BuiltInType::inq_Get_Text( StringVector & , // o_module + String & o_name, + Ce_id & , // o_nRelatedCe + int & , // o_nSequenceCount + const Gate & ) const // i_rGate +{ + o_name = Name(); +} + + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/it_builtin.hxx b/autodoc/source/ary/idl/it_builtin.hxx new file mode 100644 index 000000000000..1e3ca7fcc90f --- /dev/null +++ b/autodoc/source/ary/idl/it_builtin.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_IT_BUILTIN_HXX +#define ARY_IDL_IT_BUILTIN_HXX + +// BASE CLASSES +#include "it_named.hxx" + + + + +namespace ary +{ +namespace idl +{ + + +/** A type defined by the IDL language. +*/ +class BuiltInType : public Named_Type +{ + public: + enum E_ClassId { class_id = 2200 }; + + // LIFECYCLE + BuiltInType( + const char * i_sName ); + virtual ~BuiltInType(); + + private: + // Interface csv::ConstProcessorClient: + virtual void do_Accept( + csv::ProcessorIfc & io_processor ) const; + // Interface Object: + virtual ClassId get_AryClass() const; + + // Interface Type: + virtual void inq_Get_Text( + StringVector & o_module, + String & o_name, + Ce_id & o_nRelatedCe, + int & o_nSequenceCount, + const Gate & i_rGate ) const; +}; + + + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/it_ce.cxx b/autodoc/source/ary/idl/it_ce.cxx new file mode 100644 index 000000000000..1fca8585f941 --- /dev/null +++ b/autodoc/source/ary/idl/it_ce.cxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include "it_ce.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/tpl/processor.hxx> +#include <ary/idl/i_ce.hxx> +#include <ary/idl/i_gate.hxx> +#include <ary/idl/i_module.hxx> +#include <ary/idl/ip_ce.hxx> + + + +namespace ary +{ +namespace idl +{ + + +Ce_Type::Ce_Type( Ce_id i_relatedCe, + const std::vector<Type_id> * i_templateParameters ) + : nRelatedCe(i_relatedCe), + pTemplateParameters(0) +{ + if (i_templateParameters != 0) + pTemplateParameters = new std::vector<Type_id>(*i_templateParameters); +} + +Ce_Type::~Ce_Type() +{ +} + +ClassId +Ce_Type::get_AryClass() const +{ + return class_id; +} + +void +Ce_Type::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +void +Ce_Type::inq_Get_Text( StringVector & o_module, + String & o_name, + Ce_id & o_nRelatedCe, + int & , // o_nSequenceCount + const Gate & i_rGate ) const +{ + String sDummyMember; + + const CodeEntity & + rCe = i_rGate.Ces().Find_Ce(nRelatedCe); + i_rGate.Ces().Get_Text( o_module, + o_name, + sDummyMember, + rCe ); + o_nRelatedCe = nRelatedCe; +} + +const std::vector<Type_id> * +Ce_Type::inq_TemplateParameters() const +{ + return pTemplateParameters.Ptr(); +} + + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/it_ce.hxx b/autodoc/source/ary/idl/it_ce.hxx new file mode 100644 index 000000000000..f2de201503d8 --- /dev/null +++ b/autodoc/source/ary/idl/it_ce.hxx @@ -0,0 +1,88 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_IT_CE_HXX +#define ARY_IDL_IT_CE_HXX + +// BASE CLASSES +#include <ary/idl/i_type.hxx> + + + + +namespace ary +{ +namespace idl +{ + + +/** A named ->Type related to its corresponding + ->CodeEntity. +*/ +class Ce_Type : public Type +{ + public: + enum E_ClassId { class_id = 2201 }; + + // LIFECYCLE + Ce_Type( + Ce_id i_relatedCe, + const std::vector<Type_id> * + i_templateParameters ); + virtual ~Ce_Type(); + + // INQUIRY + Ce_id RelatedCe() const { return nRelatedCe; } + + private: + // Interface csv::ConstProcessorClient: + virtual void do_Accept( + csv::ProcessorIfc & io_processor ) const; + // Interface Object: + virtual ClassId get_AryClass() const; + + // Interface Type: + virtual void inq_Get_Text( + StringVector & o_module, + String & o_name, + Ce_id & o_nRelatedCe, + int & o_nSequemceCount, + const Gate & i_rGate ) const; + virtual const std::vector<Type_id> * + inq_TemplateParameters() const; + // DATA + Ce_id nRelatedCe; + Dyn< std::vector<Type_id> > + pTemplateParameters; +}; + + + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/it_explicit.cxx b/autodoc/source/ary/idl/it_explicit.cxx new file mode 100644 index 000000000000..552abe5b586b --- /dev/null +++ b/autodoc/source/ary/idl/it_explicit.cxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include "it_explicit.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/tpl/processor.hxx> +#include <ary/idl/i_module.hxx> +#include <ary/idl/i_gate.hxx> +#include <ary/idl/ip_ce.hxx> +#include <ary/idl/ip_type.hxx> +#include "it_xnameroom.hxx" + + + +namespace ary +{ +namespace idl +{ + + +ExplicitType::ExplicitType( const String & i_sName, + Type_id i_nXNameRoom, + Ce_id i_nModuleOfOccurrence, + const std::vector<Type_id> * + i_templateParameters ) + : Named_Type(i_sName), + nXNameRoom(i_nXNameRoom), + nModuleOfOccurrence(i_nModuleOfOccurrence), + pTemplateParameters(0) +{ + if (i_templateParameters != 0) + pTemplateParameters = new std::vector<Type_id>(*i_templateParameters); +} + +ExplicitType::~ExplicitType() +{ +} + +ClassId +ExplicitType::get_AryClass() const +{ + return class_id; +} + +void +ExplicitType::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +void +ExplicitType::inq_Get_Text( StringVector & o_module, + String & o_name, + Ce_id & o_nRelatedCe, + int & o_nSequenceCount, + const Gate & i_rGate ) const +{ + const ExplicitNameRoom & + rNameRoom = i_rGate.Types().Find_XNameRoom(nXNameRoom); + rNameRoom.Get_Text(o_module,o_name,o_nRelatedCe,o_nSequenceCount,i_rGate); + + o_name = Name(); +} + +const std::vector<Type_id> * +ExplicitType::inq_TemplateParameters() const +{ + return pTemplateParameters.Ptr(); +} + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/it_explicit.hxx b/autodoc/source/ary/idl/it_explicit.hxx new file mode 100644 index 000000000000..8a3d8d76a24d --- /dev/null +++ b/autodoc/source/ary/idl/it_explicit.hxx @@ -0,0 +1,93 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_IT_EXPLICIT_HXX +#define ARY_IDL_IT_EXPLICIT_HXX + +// BASE CLASSES +#include "it_named.hxx" + + + + +namespace ary +{ +namespace idl +{ + + +/** A named @->Type, not yet related to its corresponding + @->CodeEntity. +*/ +class ExplicitType : public Named_Type +{ + public: + enum E_ClassId { class_id = 2203 }; + + // LIFECYCLE + ExplicitType( + const String & i_sName, + Type_id i_nXNameRoom, + Ce_id i_nModuleOfOccurrence, + const std::vector<Type_id> * + i_templateParameters ); + virtual ~ExplicitType(); + + // INQUIRY + Ce_id ModuleOfOccurrence() const + { return nModuleOfOccurrence; } + Type_id NameRoom() const { return nXNameRoom; } + + private: + // Interface csv::ConstProcessorClient: + virtual void do_Accept( + csv::ProcessorIfc & io_processor ) const; + // Interface CppEntity: + virtual ClassId get_AryClass() const; + + // Interface Type: + virtual void inq_Get_Text( + StringVector & o_module, + String & o_name, + Ce_id & o_nRelatedCe, + int & o_nSequemceCount, + const Gate & i_rGate ) const; + virtual const std::vector<Type_id> * + inq_TemplateParameters() const; + // DATA + Type_id nXNameRoom; // As written in code. + Ce_id nModuleOfOccurrence; + Dyn< const std::vector<Type_id> > + pTemplateParameters; +}; + + + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/it_named.hxx b/autodoc/source/ary/idl/it_named.hxx new file mode 100644 index 000000000000..a1f431368b6d --- /dev/null +++ b/autodoc/source/ary/idl/it_named.hxx @@ -0,0 +1,76 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_IT_NAMED_HXX +#define ARY_IDL_IT_NAMED_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/idl/i_type.hxx> + // COMPONENTS + // PARAMETERS + + +namespace ary +{ +namespace idl +{ + + + + +/** Represents types with a name - in opposite to e.g. sequences, + which do not have one. +*/ +class Named_Type : public Type +{ + public: + // LIFECYCLE + virtual ~Named_Type() {} + + // INQUIRY + const String & Name() const { return sName; } + + protected: + Named_Type( + const String & i_sName ) + : sName(i_sName) { } + private: + // DATA + String sName; +}; + + + +} // namespace idl +} // namespace ary + + +#endif + diff --git a/autodoc/source/ary/idl/it_sequence.cxx b/autodoc/source/ary/idl/it_sequence.cxx new file mode 100644 index 000000000000..144c64ca6c80 --- /dev/null +++ b/autodoc/source/ary/idl/it_sequence.cxx @@ -0,0 +1,91 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include "it_sequence.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/tpl/processor.hxx> +#include <ary/idl/i_gate.hxx> +#include <ary/idl/ip_type.hxx> + + + +namespace ary +{ +namespace idl +{ + + +Sequence::Sequence( Type_id i_nRelatedType ) + : nRelatedType(i_nRelatedType) +{ +} + +Sequence::~Sequence() +{ +} + +ClassId +Sequence::get_AryClass() const +{ + return class_id; +} + +void +Sequence::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +void +Sequence::inq_Get_Text( StringVector & o_module, + String & o_name, + Ce_id & o_nRelatedCe, + int & o_nSequenceCount, + const Gate & i_rGate ) const +{ + ++o_nSequenceCount; + + i_rGate.Types().Find_Type(nRelatedType) + .Get_Text( o_module, + o_name, + o_nRelatedCe, + o_nSequenceCount, + i_rGate ); +} + +const Type & +Sequence::inq_FirstEnclosedNonSequenceType(const Gate & i_rGate) const +{ + return i_rGate.Types().Find_Type(nRelatedType).FirstEnclosedNonSequenceType(i_rGate); +} + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/it_sequence.hxx b/autodoc/source/ary/idl/it_sequence.hxx new file mode 100644 index 000000000000..c4a29d410fd5 --- /dev/null +++ b/autodoc/source/ary/idl/it_sequence.hxx @@ -0,0 +1,84 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_IT_SEQUENCE_HXX +#define ARY_IDL_IT_SEQUENCE_HXX + +// BASE CLASSES +#include <ary/idl/i_type.hxx> + + + + +namespace ary +{ +namespace idl +{ + + +/** A sequence (an array of a type). +*/ +class Sequence : public Type +{ + public: + enum E_ClassId { class_id = 2202 }; + + // LIFECYCLE + Sequence( + Type_id i_nRelatedType ); + virtual ~Sequence(); + + // INQUIRY + Type_id RelatedType() const { return nRelatedType; } + + private: + // Interface csv::ConstProcessorClient: + virtual void do_Accept( + csv::ProcessorIfc & io_processor ) const; + // Interface Object: + virtual ClassId get_AryClass() const; + + // Interface Type: + virtual void inq_Get_Text( + StringVector & o_module, + String & o_name, + Ce_id & o_nRelatedCe, + int & o_nSequemceCount, + const Gate & i_rGate ) const; + virtual const Type & + inq_FirstEnclosedNonSequenceType( + const Gate & i_rGate ) const; + // DATA + Type_id nRelatedType; +}; + + + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/it_tplparam.cxx b/autodoc/source/ary/idl/it_tplparam.cxx new file mode 100644 index 000000000000..cde0d096c85f --- /dev/null +++ b/autodoc/source/ary/idl/it_tplparam.cxx @@ -0,0 +1,92 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include "it_tplparam.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/tpl/processor.hxx> + + + +namespace ary +{ +namespace idl +{ + + + +TemplateParamType::TemplateParamType( const char * i_sName ) + : Named_Type(i_sName) +{ +} + +TemplateParamType::~TemplateParamType() +{ +} + +ClassId +TemplateParamType::get_AryClass() const +{ + return class_id; +} + +void +TemplateParamType::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +void +TemplateParamType::inq_Get_Text( StringVector & , // o_module + String & o_name, + Ce_id & , // o_nRelatedCe + int & , // o_nSequenceCount + const Gate & ) const // i_rGate +{ + o_name = Name(); +} + + +//************* Implemented default function for idl::Type ********// + +const std::vector<Type_id> * +Type::inq_TemplateParameters() const +{ + return 0; +} + +const Type & +Type::inq_FirstEnclosedNonSequenceType(const Gate & ) const +{ + return *this; +} + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/it_tplparam.hxx b/autodoc/source/ary/idl/it_tplparam.hxx new file mode 100644 index 000000000000..608332d6c9de --- /dev/null +++ b/autodoc/source/ary/idl/it_tplparam.hxx @@ -0,0 +1,98 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_IT_TPLPARAM_HXX +#define ARY_IDL_IT_TPLPARAM_HXX + +// BASE CLASSES +#include "it_named.hxx" + + + + +namespace ary +{ +namespace idl +{ + + +/** @resp Represents a template type when it is used within the + declaring struct. +*/ +class TemplateParamType : public Named_Type +{ + public: + enum E_ClassId { class_id = 2205 }; + + // LIFECYCLE + TemplateParamType( + const char * i_sName ); + virtual ~TemplateParamType(); + + Ce_id StructId() const; /// The struct which declares this type. + void Set_StructId( + Ce_id i_nStruct ); + private: + // Interface csv::ConstProcessorClient: + virtual void do_Accept( + csv::ProcessorIfc & io_processor ) const; + // Interface Object: + virtual ClassId get_AryClass() const; + + // Interface Type: + virtual void inq_Get_Text( + StringVector & o_module, + String & o_name, + Ce_id & o_nRelatedCe, + int & o_nSequenceCount, + const Gate & i_rGate ) const; + // DATA + Ce_id nStruct; /// The struct which declares this type. +}; + + + + +// IMPLEMENTATION +inline Ce_id +TemplateParamType::StructId() const +{ + return nStruct; +} + +inline void +TemplateParamType::Set_StructId( Ce_id i_nStruct ) +{ + nStruct = i_nStruct; +} + + + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/it_xnameroom.cxx b/autodoc/source/ary/idl/it_xnameroom.cxx new file mode 100644 index 000000000000..a990fdb7982e --- /dev/null +++ b/autodoc/source/ary/idl/it_xnameroom.cxx @@ -0,0 +1,100 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include <precomp.h> +#include "it_xnameroom.hxx" + + +// NOT FULLY DEFINED SERVICES +#include <cosv/tpl/processor.hxx> +#include <cosv/tpl/tpltools.hxx> +#include <ary/idl/i_gate.hxx> +#include <ary/idl/ip_type.hxx> + + + +namespace ary +{ +namespace idl +{ + + +ExplicitNameRoom::ExplicitNameRoom() + : aImpl() +{ +} + +ExplicitNameRoom::ExplicitNameRoom( const String & i_sName, + const ExplicitNameRoom & i_rParent ) + : aImpl( i_sName, i_rParent.aImpl, i_rParent.TypeId() ) +{ +} + +ExplicitNameRoom::~ExplicitNameRoom() +{ +} + +ClassId +ExplicitNameRoom::get_AryClass() const +{ + return class_id; +} + +void +ExplicitNameRoom::do_Accept( csv::ProcessorIfc & io_processor ) const +{ + csv::CheckedCall(io_processor, *this); +} + +void +ExplicitNameRoom::inq_Get_Text( StringVector & o_module, + String & , // o_name + Ce_id & , // o_nRelatedCe + int & , // o_nSequemceCount + const Gate & ) const // i_rGate +{ + StringVector::const_iterator it = NameChain_Begin(); + if ( it != NameChain_End() + ? (*it).empty() + : false ) + { // Don't put out the root global namespace + ++it; + } + + for ( ; + it != NameChain_End(); + ++it ) + { + o_module.push_back(*it); + } +} + + + + +} // namespace idl +} // namespace ary diff --git a/autodoc/source/ary/idl/it_xnameroom.hxx b/autodoc/source/ary/idl/it_xnameroom.hxx new file mode 100644 index 000000000000..ea9513605cb6 --- /dev/null +++ b/autodoc/source/ary/idl/it_xnameroom.hxx @@ -0,0 +1,123 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_IDL_IT_XNAMEROOM_HXX +#define ARY_IDL_IT_XNAMEROOM_HXX + +// BASE CLASSES +#include <ary/idl/i_type.hxx> +#include <nametreenode.hxx> + + + + +namespace ary +{ +namespace idl +{ + + +/** A namespace for ->Type s, as they are explicitely written in code. + + The search/identification string is usually the local name of + the Type. But for templated structs, the search string has this + pattern: + <LocalName> '<' <StringOfTemplateTypeId> +*/ +class ExplicitNameRoom : public Type +{ + public: + enum E_ClassId { class_id = 2204 }; + + // LIFECYCLE + ExplicitNameRoom(); + ExplicitNameRoom( + const String & i_sName, + const ExplicitNameRoom & + i_rParent ); + virtual ~ExplicitNameRoom(); + + // OPERATIONS + /** @param i_sSearchString + A local type name usually. + For templated types see class docu. + @see ExplicitNameRoom + */ + void Add_Name( + const String & i_sSearchString, + Type_id i_nId ) + { aImpl.Add_Name(i_sSearchString,i_nId); } + // INQUIRY + const String & Name() const { return aImpl.Name(); } + intt Depth() const { return aImpl.Depth(); } + void Get_FullName( + StringVector & o_rText, + Ce_idList * o_pRelatedCes, + const Gate & i_rGate ) const; + bool IsAbsolute() const { return Depth() > 0 + ? (*NameChain_Begin()).empty() + : false; } + /** @param i_sSearchString + A local type name usually. + For templated types see class docu. + @see ExplicitNameRoom + */ + Type_id Search_Name( + const String & i_sSearchString ) const + { return aImpl.Search_Name(i_sSearchString); } + + StringVector::const_iterator + NameChain_Begin() const + { return aImpl.NameChain_Begin(); } + StringVector::const_iterator + NameChain_End() const + { return aImpl.NameChain_End(); } + private: + // Interface csv::ConstProcessorClient: + virtual void do_Accept( + csv::ProcessorIfc & io_processor ) const; + // Interface Object: + virtual ClassId get_AryClass() const; + + // Interface Type: + virtual void inq_Get_Text( + StringVector & o_module, + String & o_name, + Ce_id & o_nRelatedCe, + int & o_nSequemceCount, + const Gate & i_rGate ) const; + // DATA + NameTreeNode<Type_id> + aImpl; +}; + + + + +} // namespace idl +} // namespace ary +#endif diff --git a/autodoc/source/ary/idl/makefile.mk b/autodoc/source/ary/idl/makefile.mk new file mode 100644 index 000000000000..bf260e2c521e --- /dev/null +++ b/autodoc/source/ary/idl/makefile.mk @@ -0,0 +1,87 @@ +#************************************************************************* +# +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. +# +# OpenOffice.org - a multi-platform office productivity suite +# +# This file is part of OpenOffice.org. +# +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. +# +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). +# +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. +# +#************************************************************************* + +PRJ=..$/..$/.. + +PRJNAME=autodoc +TARGET=ary_idl + + +# --- Settings ----------------------------------------------------- + +ENABLE_EXCEPTIONS=true +PRJINC=$(PRJ)$/source + +.INCLUDE : settings.mk +.INCLUDE : $(PRJ)$/source$/mkinc$/fullcpp.mk + + +# --- Files -------------------------------------------------------- + + +OBJFILES= \ + $(OBJ)$/i_attribute.obj \ + $(OBJ)$/i_ce.obj \ + $(OBJ)$/i_ce2s.obj \ + $(OBJ)$/i_comrela.obj \ + $(OBJ)$/i_constant.obj \ + $(OBJ)$/i_constgroup.obj \ + $(OBJ)$/i_enum.obj \ + $(OBJ)$/i_enumvalue.obj \ + $(OBJ)$/i_exception.obj \ + $(OBJ)$/i_function.obj \ + $(OBJ)$/i_interface.obj \ + $(OBJ)$/i_module.obj \ + $(OBJ)$/i_namelookup.obj \ + $(OBJ)$/i_param.obj \ + $(OBJ)$/i_property.obj \ + $(OBJ)$/i_reposypart.obj \ + $(OBJ)$/i_service.obj \ + $(OBJ)$/i_singleton.obj \ + $(OBJ)$/i_siservice.obj \ + $(OBJ)$/i_sisingleton.obj \ + $(OBJ)$/i_struct.obj \ + $(OBJ)$/i_structelem.obj \ + $(OBJ)$/i_traits.obj \ + $(OBJ)$/i_typedef.obj \ + $(OBJ)$/i2s_calculator.obj \ + $(OBJ)$/ia_ce.obj \ + $(OBJ)$/ia_type.obj \ + $(OBJ)$/is_ce.obj \ + $(OBJ)$/is_type.obj \ + $(OBJ)$/it_builtin.obj \ + $(OBJ)$/it_ce.obj \ + $(OBJ)$/it_explicit.obj \ + $(OBJ)$/it_sequence.obj \ + $(OBJ)$/it_tplparam.obj \ + $(OBJ)$/it_xnameroom.obj + + + +# --- Targets ------------------------------------------------------ + +.INCLUDE : target.mk |