Oracle Coherence for C++ API
Release 3.7.1.0
E22845-01
00001 /* 00002 * AbstractList.hpp 00003 * 00004 * Copyright (c) 2000, 2011, 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_ABSTRACT_LIST_HPP 00017 #define COH_ABSTRACT_LIST_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include "coherence/util/AbstractCollection.hpp" 00022 #include "coherence/util/List.hpp" 00023 00024 COH_OPEN_NAMESPACE2(coherence,util) 00025 00026 00027 /** 00028 * This class provides a skeletal implementation of the List interface to 00029 * minimize the effort required to implement this interface. 00030 */ 00031 class COH_EXPORT AbstractList 00032 : public abstract_spec<AbstractList, 00033 extends<AbstractCollection>, 00034 implements<List> > 00035 { 00036 protected: 00037 /** 00038 * @internal 00039 */ 00040 AbstractList(); 00041 00042 /** 00043 * @internal 00044 */ 00045 AbstractList(const AbstractList& that); 00046 00047 00048 // ----- List interface ------------------------------------------------- 00049 00050 public: 00051 /** 00052 * {@inheritDoc} 00053 */ 00054 virtual Object::Holder get(size32_t i); 00055 00056 /** 00057 * {@inheritDoc} 00058 */ 00059 using List::get; 00060 00061 00062 // ----- Object interface ----------------------------------------------- 00063 00064 public: 00065 /** 00066 * {@inheritDoc} 00067 */ 00068 virtual bool equals(Object::View v) const; 00069 00070 /** 00071 * {@inheritDoc} 00072 */ 00073 virtual size32_t hashCode() const; 00074 00075 /** 00076 * {@inheritDoc} 00077 */ 00078 virtual bool isImmutable() const; 00079 00080 00081 // ----- data members --------------------------------------------------- 00082 00083 protected: 00084 /** 00085 * The cached hash of all the array elements. The hash code is not 00086 * cached until the List becomes immutable. A value of 0 indicates 00087 * that the has has not been cached. 00088 */ 00089 mutable size32_t m_nHashCode; 00090 }; 00091 00092 COH_CLOSE_NAMESPACE2 00093 00094 #endif // COH_ABSTRACT_LIST_HPP