00001 /* 00002 * EvolvableHolder.hpp 00003 * 00004 * Copyright (c) 2000, 2019, 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_EVOLVABLE_HOLDER_HPP 00017 #define COH_EVOLVABLE_HOLDER_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include "coherence/io/Evolvable.hpp" 00022 00023 #include "coherence/util/Map.hpp" 00024 #include "coherence/util/Set.hpp" 00025 00026 COH_OPEN_NAMESPACE3(coherence,io,pof) 00027 00028 using coherence::io::Evolvable; 00029 using coherence::util::Map; 00030 using coherence::util::Set; 00031 00032 /** 00033 * Storage for Evolvable classes. 00034 * 00035 * @author as 2013.07.25 00036 * 00037 * @since 12.1.3 00038 */ 00039 class COH_EXPORT EvolvableHolder 00040 : public class_spec<EvolvableHolder, 00041 extends<Object> > 00042 { 00043 friend class factory<EvolvableHolder>; 00044 00045 // ---- constructors ---------------------------------------------------- 00046 00047 protected: 00048 EvolvableHolder(); 00049 00050 // ---- EvolvableHolder methods------------------------------------------ 00051 00052 public: 00053 /** 00054 * Return Evolvable for the specified type id. 00055 * 00056 * @param nTypeId type identifier 00057 * 00058 * @return Evolvable instance 00059 */ 00060 virtual Evolvable::Handle get(int32_t nTypeId) const; 00061 00062 /** 00063 * Return type identifiers for all the Evolvables within this holder. 00064 * 00065 * @return type identifiers for all the Evolvables within this holder 00066 */ 00067 virtual Set::View getTypeIds() const; 00068 00069 /** 00070 * Return <c>true</c> if this holder is empty. 00071 * 00072 * @return <c>true</c> if this holder is empty, <c>false</c> otherwise 00073 */ 00074 virtual bool isEmpty() const; 00075 00076 // ---- data members ---------------------------------------------------- 00077 00078 private: 00079 /** 00080 * Map of Evolvable objects keyed by type id (Integer32) 00081 */ 00082 mutable FinalHandle<Map> f_hEvolvableMap; 00083 }; 00084 00085 COH_CLOSE_NAMESPACE3 00086 00087 #endif // COH_EVOLVABLE_HOLDER_HPP