coherence/util/MappedSet.hpp

00001 /*
00002 * MappedSet.hpp
00003 *
00004 * Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.
00005 *
00006 * Oracle is a registered trademarks of Oracle Corporation and/or its
00007 * affiliates.
00008 *
00009 * This software is the confidential and proprietary information of Oracle
00010 * Corporation. You shall not disclose such confidential and proprietary
00011 * information and shall use it only in accordance with the terms of the
00012 * license agreement you entered into with Oracle.
00013 *
00014 * This notice may not be removed or altered.
00015 */
00016 #ifndef COH_MAPPED_SET_HPP
00017 #define COH_MAPPED_SET_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/util/MapKeySet.hpp"
00022 
00023 COH_OPEN_NAMESPACE2(coherence,util)
00024 
00025 
00026 /**
00027 * Set implementation which is backed by a Map.
00028 */
00029 class COH_EXPORT MappedSet
00030     : public cloneable_spec<MappedSet,
00031         extends<MapKeySet> >
00032     {
00033     friend class factory<MappedSet>;
00034 
00035     // ----- constructors ---------------------------------------------------
00036 
00037     protected:
00038         /**
00039         * Return a new MappedSet backed by the supplied Map.
00040         *
00041         * @param hMap  the map to use as storage
00042         */
00043         MappedSet(Map::Handle hMap);
00044 
00045         /**
00046         * Copy constructor.
00047         */
00048         MappedSet(const MappedSet& that);
00049 
00050 
00051     // ----- Set interface --------------------------------------------------
00052 
00053     public:
00054         /**
00055         * {@inheritDoc}
00056         */
00057         virtual bool add(Object::Holder oh);
00058 
00059         /**
00060         * {@inheritDoc}
00061         */
00062         virtual bool addAll(Collection::View vCol);
00063 
00064         /**
00065         * {@inheritDoc}
00066         */
00067         virtual Iterator::Handle iterator() const;
00068 
00069         /**
00070         * {@inheritDoc}
00071         */
00072         virtual Muterator::Handle iterator();
00073     };
00074 
00075 COH_CLOSE_NAMESPACE2
00076 
00077 #endif // COH_MAPPED_SET
Copyright (c) 2000, 2009, Oracle and/or its affiliates. All rights reserved.