diff options
Diffstat (limited to 'autodoc/source/ary/inc')
-rw-r--r-- | autodoc/source/ary/inc/cross_refs.hxx | 133 | ||||
-rw-r--r-- | autodoc/source/ary/inc/nametree.hxx | 9 | ||||
-rw-r--r-- | autodoc/source/ary/inc/nametreenode.hxx | 262 | ||||
-rw-r--r-- | autodoc/source/ary/inc/reposy.hxx | 89 | ||||
-rw-r--r-- | autodoc/source/ary/inc/sci_impl.hxx | 290 | ||||
-rw-r--r-- | autodoc/source/ary/inc/sorted_idset.hxx | 131 |
6 files changed, 906 insertions, 8 deletions
diff --git a/autodoc/source/ary/inc/cross_refs.hxx b/autodoc/source/ary/inc/cross_refs.hxx new file mode 100644 index 000000000000..1a91f2cfd092 --- /dev/null +++ b/autodoc/source/ary/inc/cross_refs.hxx @@ -0,0 +1,133 @@ +/************************************************************************* + * + * $RCSfile: cross_refs.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: np $ $Date: 2002-11-01 17:13:40 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_CROSS_REFS_HXX +#define ARY_CROSS_REFS_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include "sorted_idset.hxx" + + +template <class VALUE_LIST, class TYPES> +class CrossReferences +{ + public: + typedef TYPES::element_type element; + + /// Checks for double occurences + void Add( + VALUE_LIST::index_type + i_nPosition + const element & i_rElem ); + void Get_List( + Dyn_StdConstIterator<element> & + o_rResult ) const; + private: + SortedIdSet<TYPES> aData[VALUE_LIST::max]; +}; + + + +namespace ary +{ + +template <class TYPES> +class SortedIdSet +{ + public: + typedef typename TYPES::element_type element; + typedef typename TYPES::sort_type sorter; + typedef typename TYPES::find_type finder; + + SortedIdSet( + const finder & i_rFinder ) + : aSorter(i_rFinder), + aData(aSorter) {} + ~SortedIdSet() {} + + void Get_Begin( + Dyn_StdConstIterator<element> & + o_rResult ) + { o_rResult = new SCI_Set<FINDER>(aData); } + void Add( + const element & i_rElement ) + { aData.insert(i_rElement); } + + private: + typedef std::set<element, sorter> Set; + + // DATA + sorter aSorter; + Set aData; +}; + + +} // namespace ary + + + +#endif + diff --git a/autodoc/source/ary/inc/nametree.hxx b/autodoc/source/ary/inc/nametree.hxx index 0fb76629c3ca..6240387fca67 100644 --- a/autodoc/source/ary/inc/nametree.hxx +++ b/autodoc/source/ary/inc/nametree.hxx @@ -2,9 +2,9 @@ * * $RCSfile: nametree.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * last change: $Author: np $ $Date: 2002-11-01 17:13:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -69,6 +69,7 @@ // COMPONENTS #include <ary/ids.hxx> #include "instlist.hxx" +#include "namesort.hxx" // PARAMETERS @@ -79,15 +80,17 @@ namespace ary class NameTree { public: +#if 0 // Test new comparison struct Less_Name { bool operator()( const udmstri & i_r1, const udmstri & i_r2 ) const; }; +#endif // 0 typedef std::map< udmstri, InstanceList, - Less_Name > Map_Name2Inst; + CompareCeNames > Map_Name2Inst; typedef Map_Name2Inst::const_iterator const_iterator; typedef Map_Name2Inst::iterator iterator; diff --git a/autodoc/source/ary/inc/nametreenode.hxx b/autodoc/source/ary/inc/nametreenode.hxx new file mode 100644 index 000000000000..ccee21738a49 --- /dev/null +++ b/autodoc/source/ary/inc/nametreenode.hxx @@ -0,0 +1,262 @@ +/************************************************************************* + * + * $RCSfile: nametreenode.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: np $ $Date: 2002-11-01 17:13:44 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_NAMETREENODE_HXX +#define ARY_NAMETREENODE_HXX + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <cosv/template/tpltools.hxx> +#include <sci_impl.hxx> +// HACK because of SunPro 5.2 compiler bug with templates: +#include <ary/idl/i_module.hxx> + + + +namespace ary +{ + + + +/** Implementation of a node in a namespace-tree. +*/ +template<class ITEM_ID> +class NameTreeNode +{ + public: + typedef NameTreeNode self; + typedef ITEM_ID item_id; + typedef StringVector::const_iterator name_iterator; + typedef std::map<String, item_id> Map_LocalNames; + + // LIFECYCLE + NameTreeNode(); + NameTreeNode( + const String & i_sName, + const self & i_rParent, + ITEM_ID i_nParentId ); + virtual ~NameTreeNode(); + + // OPERATIONS + void Add_Name( + const String & i_sName, + item_id i_nId ); + // INQUIRY + const String & Name() const { return Depth() > 0 ? aCompleteNameChain.back() : String::Null_(); } + item_id Parent() const { return nParent; } + intt Depth() const { return aCompleteNameChain.size(); } + + bool IsEquivalent( + const NameTreeNode & + i_rNode ) const; + name_iterator NameChain_Begin() const { return aCompleteNameChain.begin(); } + name_iterator NameChain_End() const { return aCompleteNameChain.end(); } + + item_id Search_Name( + const String & i_sName ) const; + void Get_Names( + Dyn_StdConstIterator<ITEM_ID> & + o_rResult ) const; + const Map_LocalNames & + LocalNames() const { return aLocalNames; } + private: + // Locals + Map_LocalNames & LocalNames() { return aLocalNames; } + + // DATA + Map_LocalNames aLocalNames; + StringVector aCompleteNameChain; + item_id nParent; +}; + + +#if 0 +// Prototypes have to be left out, because of a VC++ 6 compiler bug +// ( compiler reports ambigious overload ). + +template <class FIND_NODE> +typename FIND_NODE::id_type +Search_SubTree( const typename FIND_NODE::node_type & i_rStart, + const FIND_NODE & i_rNodeFinder ); + +template <class FIND_NODE> +typename FIND_NODE::id_type +Search_SubTree_UpTillRoot( const typename FIND_NODE::node_type & i_rStart, + const FIND_NODE & i_rNodeFinder ); +#endif // 0 + + + +// IMPLEMENTATION + +template<class ITEM_ID> +NameTreeNode<ITEM_ID>::NameTreeNode() + : aLocalNames(), + aCompleteNameChain(), + nParent(0) +{ +} + +template<class ITEM_ID> +NameTreeNode<ITEM_ID>::NameTreeNode( const String & i_sName, + const self & i_rParent, + ITEM_ID i_nParentId ) + : aLocalNames(), + aCompleteNameChain(), + nParent(i_nParentId) +{ + aCompleteNameChain.reserve(i_rParent.Depth()+1); + for ( name_iterator it = i_rParent.NameChain_Begin(); + it != i_rParent.NameChain_End(); + ++it ) + { + aCompleteNameChain.push_back(*it); + } + aCompleteNameChain.push_back(i_sName); +} + +template<class ITEM_ID> +NameTreeNode<ITEM_ID>::~NameTreeNode() +{ +} + + +template<class ITEM_ID> +inline void +NameTreeNode<ITEM_ID>::Add_Name( const String & i_sName, + item_id i_nId ) +{ + LocalNames().insert( Map_LocalNames::value_type(i_sName, i_nId) ); +} + + +template<class ITEM_ID> +inline bool +NameTreeNode<ITEM_ID>::IsEquivalent( const NameTreeNode & i_rNode ) const +{ + return aCompleteNameChain == i_rNode.aCompleteNameChain; +} + +template<class ITEM_ID> +inline ITEM_ID +NameTreeNode<ITEM_ID>::Search_Name( const String & i_sName ) const +{ + return csv::value_from_map(LocalNames(),i_sName); +} + +template<class ITEM_ID> +inline void +NameTreeNode<ITEM_ID>::Get_Names( Dyn_StdConstIterator<ITEM_ID> & o_rResult ) const +{ + o_rResult = new SCI_Map<String,item_id>(LocalNames()); +} + + +// HACK because of SunPro 5.2 compiler bug with templates: +// ary::idl::Module has to be "FIND_NODE::node_type" +// must be solved later somehow. +template <class FIND_NODE> +typename FIND_NODE::id_type +Search_SubTree( const ary::idl::Module & i_rStart, + const FIND_NODE & i_rNodeFinder ) +{ + const typename FIND_NODE::node_type * + ret = &i_rStart; + + for ( StringVector::const_iterator it = i_rNodeFinder.Begin(); + it != i_rNodeFinder.End() AND ret != 0; + ++it ) + { + ret = i_rNodeFinder(ret->Search_Name(*it)); + } + + typename FIND_NODE::id_type nret(0); + return ret != 0 + ? ret->Search_Name(i_rNodeFinder.Name2Search()) + : nret; +} + +template <class FIND_NODE> +typename FIND_NODE::id_type +Search_SubTree_UpTillRoot( const ary::idl::Module & i_rStart, + const FIND_NODE & i_rNodeFinder ) +{ + typename FIND_NODE::id_type + ret(0); + for ( const typename FIND_NODE::node_type * start = &i_rStart; + start != 0 AND NOT ret.IsValid(); + start = i_rNodeFinder(start->Owner()) ) + { + ret = Search_SubTree( *start, + i_rNodeFinder ); + } + return ret; +} +// END Hack for SunPro 5.2 compiler bug. + + +} // namespace ary + + +#endif diff --git a/autodoc/source/ary/inc/reposy.hxx b/autodoc/source/ary/inc/reposy.hxx index acd4c724e18f..9b109ce1dfaa 100644 --- a/autodoc/source/ary/inc/reposy.hxx +++ b/autodoc/source/ary/inc/reposy.hxx @@ -2,9 +2,9 @@ * * $RCSfile: reposy.hxx,v $ * - * $Revision: 1.1.1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: np $ $Date: 2002-03-08 14:45:18 $ + * last change: $Author: np $ $Date: 2002-11-01 17:13:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -62,17 +62,99 @@ #ifndef ARY_REPOSY_HXX #define ARY_REPOSY_HXX +// VERSION: Autodoc 2.2 // USED SERVICES // BASE CLASSES #include <ary/ary.hxx> // COMPONENTS +#include <cosv/ploc_dir.hxx> // PARAMETERS + + namespace ary { +namespace cpp +{ +class RepositoryPartition; +} + +namespace idl +{ +class RepositoryPartition; +} + +namespace phyloc +{ +class RepositoryLocation; +} + +namespace action +{ +class Statistic; +} + + +namespace n22 +{ + +/** Implements ::ary::Repository. + + @see Repository +*/ + +class RepositoryCenter : public ::ary::n22::Repository +{ + public: + // LIFECYCLE + RepositoryCenter( + const String & i_sDisplayedName ); + virtual ~RepositoryCenter(); + + // OPERATIONS + void RunCommand_ProduceAllSecondaries(); + void RunCommand_Statistic( + action::Statistic & io_rCommand ); + private: + // Interface Repository: + virtual void do_Perform( ::ary::Command & io_rCommand); + virtual const String & inq_Name() const; + virtual const idl::Gate & inq_Gate_Idl() const; + virtual idl::Gate & access_Gate_Idl(); + +#if 0 // Version 2.2 + virtual const cpp::Gate & inq_Gate_Cpp() const; + virtual cpp::Gate & access_Gate_Cpp(); +#endif // Version 2.2 + + // Local + + // DATA + String sDisplayedName; /// Name to be displayed for human users. + csv::ploc::Directory + aLocation; + Dyn< idl::RepositoryPartition > + pIdlPartition; + +#if 0 // Version 2.2 + Dyn<cpp::RepositoryPartition> + pCppPartition; +#endif // Version 2.2 +}; + + +} // namespace n22 + + + + + + + + /** @task */ @@ -95,9 +177,6 @@ class RepositoryCenter : public Repository inq_Name() const; virtual cpp::RwGate & access_RwGate_Cpp(); - virtual uidl::Gate & - access_RwGate_Idl(); - struct CheshireCat; // DATA diff --git a/autodoc/source/ary/inc/sci_impl.hxx b/autodoc/source/ary/inc/sci_impl.hxx new file mode 100644 index 000000000000..daf3a5e6987f --- /dev/null +++ b/autodoc/source/ary/inc/sci_impl.hxx @@ -0,0 +1,290 @@ +/************************************************************************* + * + * $RCSfile: sci_impl.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: np $ $Date: 2002-11-01 17:13:48 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_SCI_IMPL_HXX +#define ARY_SCI_IMPL_HXX + + + +// USED SERVICES + // BASE CLASSES +#include <ary/stdconstiter.hxx> + // COMPONENTS + // PARAMETERS + + +namespace ary +{ + + +//************************* SCI_Vector **********************************// + +template <class ELEM> +class SCI_Vector : public StdConstIterator<ELEM> +{ + public: + typedef std::vector<ELEM> source; + typedef source::const_iterator source_iterator; + + SCI_Vector( + const source & i_rSource ); + virtual ~SCI_Vector(); + + private: + // Interface StdConstIterator<>: + virtual void do_Advance(); + virtual const ELEM * + inq_CurElement() const; + virtual bool inq_IsSorted() const; + + // DATA + source_iterator itRun; + source_iterator itEnd; +}; + + + +//************************* SCI_Vector **********************************// + +template <class KEY, class VALUE> +class SCI_Map : public StdConstIterator<VALUE> +{ + public: + typedef std::map<KEY,VALUE> source; + typedef source::const_iterator source_iterator; + + SCI_Map( + const source & i_rSource ); + virtual ~SCI_Map(); + + private: + // Interface StdConstIterator<>: + virtual void do_Advance(); + virtual const VALUE * + inq_CurElement() const; + virtual bool inq_IsSorted() const; + + // DATA + source_iterator itRun; + source_iterator itEnd; +}; + + + +//************************* SCI_Set **********************************// + + +template <class TYPES> +class SCI_Set : public StdConstIterator<typename TYPES::element_type> +{ + public: + typedef typename TYPES::element_type element; + typedef typename TYPES::sort_type sorter; + typedef std::set<element, sorter> source; + typedef source::const_iterator source_iterator; + + SCI_Set( + const source & i_rSource ); + virtual ~SCI_Set(); + + private: + // Interface StdConstIterator<>: + virtual void do_Advance(); + virtual const element * + inq_CurElement() const; + virtual bool inq_IsSorted() const; + + // DATA + source_iterator itRun; + source_iterator itEnd; +}; + + + +// IMPLEMENTATION + +template <class ELEM> +SCI_Vector<ELEM>::SCI_Vector( const source & i_rSource ) + : itRun(i_rSource.begin()), + itEnd(i_rSource.end()) +{ +} + +template <class ELEM> +SCI_Vector<ELEM>::~SCI_Vector() +{ +} + + +template <class ELEM> +void +SCI_Vector<ELEM>::do_Advance() +{ + if (itRun != itEnd) + ++itRun; +} + +template <class ELEM> +const ELEM * +SCI_Vector<ELEM>::inq_CurElement() const +{ + if (itRun != itEnd) + return &(*itRun); + return 0; +} + +template <class ELEM> +bool +SCI_Vector<ELEM>::inq_IsSorted() const +{ + return false; +} + + + + +template <class KEY, class VALUE> +SCI_Map<KEY,VALUE>::SCI_Map( const source & i_rSource ) + : itRun(i_rSource.begin()), + itEnd(i_rSource.end()) +{ +} + +template <class KEY, class VALUE> +SCI_Map<KEY,VALUE>::~SCI_Map() +{ +} + +template <class KEY, class VALUE> +void +SCI_Map<KEY,VALUE>::do_Advance() +{ + if (itRun != itEnd) + ++itRun; +} + +template <class KEY, class VALUE> +const VALUE * +SCI_Map<KEY,VALUE>::inq_CurElement() const +{ + if (itRun != itEnd) + return &(*itRun).second; + return 0; +} + + +template <class KEY, class VALUE> +bool +SCI_Map<KEY,VALUE>::inq_IsSorted() const +{ + return true; +} + + + + + +template <class ELEM> +SCI_Set<ELEM>::SCI_Set( const source & i_rSource ) + : itRun(i_rSource.begin()), + itEnd(i_rSource.end()) +{ +} + +template <class ELEM> +SCI_Set<ELEM>::~SCI_Set() +{ +} + + +template <class ELEM> +void +SCI_Set<ELEM>::do_Advance() +{ + if (itRun != itEnd) + ++itRun; +} + +template <class ELEM> +const typename SCI_Set<ELEM>::element * +SCI_Set<ELEM>::inq_CurElement() const +{ + if (itRun != itEnd) + return &(*itRun); + return 0; +} + +template <class ELEM> +bool +SCI_Set<ELEM>::inq_IsSorted() const +{ + return true; +} + + + + + + +} // namespace ary + + +#endif diff --git a/autodoc/source/ary/inc/sorted_idset.hxx b/autodoc/source/ary/inc/sorted_idset.hxx new file mode 100644 index 000000000000..b4d159a05f5b --- /dev/null +++ b/autodoc/source/ary/inc/sorted_idset.hxx @@ -0,0 +1,131 @@ +/************************************************************************* + * + * $RCSfile: sorted_idset.hxx,v $ + * + * $Revision: 1.1 $ + * + * last change: $Author: np $ $Date: 2002-11-01 17:13:49 $ + * + * The Contents of this file are made available subject to the terms of + * either of the following licenses + * + * - GNU Lesser General Public License Version 2.1 + * - Sun Industry Standards Source License Version 1.1 + * + * Sun Microsystems Inc., October, 2000 + * + * GNU Lesser General Public License Version 2.1 + * ============================================= + * Copyright 2000 by Sun Microsystems, Inc. + * 901 San Antonio Road, Palo Alto, CA 94303, USA + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License version 2.1, as published by the Free Software Foundation. + * + * This library 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 for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + * + * Sun Industry Standards Source License Version 1.1 + * ================================================= + * The contents of this file are subject to the Sun Industry Standards + * Source License Version 1.1 (the "License"); You may not use this file + * except in compliance with the License. You may obtain a copy of the + * License at http://www.openoffice.org/license.html. + * + * Software provided under this License is provided on an "AS IS" basis, + * WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, + * WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS, + * MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING. + * See the License for the specific provisions governing your rights and + * obligations concerning the Software. + * + * The Initial Developer of the Original Code is: Sun Microsystems, Inc. + * + * Copyright: 2000 by Sun Microsystems, Inc. + * + * All Rights Reserved. + * + * Contributor(s): _______________________________________ + * + * + ************************************************************************/ + +#ifndef ARY_SORTED_IDSET_HXX +#define ARY_SORTED_IDSET_HXX + + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS +#include <set> + // PARAMETERS +#include "csi_impl.hxx" + + +template <class XY> class SortedIdSet; + +class Interface_2s +{ + public: + /// Checks for double occurences + void Add_ExportingService( + Ce_id i_nId ); + void Get_ExportingServices( + Dyn_StdConstIterator<Ce_id> & + o_rResult ) const; + private: + Dyn<SortedIdSet> pExportingServices; +}; + + + +namespace ary +{ + +template <class TYPES> +class SortedIdSet +{ + public: + typedef typename TYPES::element_type element; + typedef typename TYPES::sort_type sorter; + typedef typename TYPES::find_type finder; + + SortedIdSet( + const finder & i_rFinder ) + : aSorter(i_rFinder), + aData(aSorter) {} + ~SortedIdSet() {} + + void Get_Begin( + Dyn_StdConstIterator<element> & + o_rResult ) + { o_rResult = new SCI_Set<FINDER>(aData); } + void Add( + const element & i_rElement ) + { aData.insert(i_rElement); } + + private: + typedef std::set<element, sorter> Set; + + // DATA + sorter aSorter; + Set aData; +}; + + +} // namespace ary + + + +#endif + |