00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 #ifndef _DECAF_UTIL_CONCURRENT_CONCURRENTMAP_H_ 00019 #define _DECAF_UTIL_CONCURRENT_CONCURRENTMAP_H_ 00020 00021 #include <decaf/util/Config.h> 00022 #include <decaf/util/Map.h> 00023 00024 #include <decaf/lang/exceptions/UnsupportedOperationException.h> 00025 #include <decaf/lang/exceptions/IllegalStateException.h> 00026 #include <decaf/util/NoSuchElementException.h> 00027 00028 namespace decaf { 00029 namespace util { 00030 namespace concurrent { 00031 00038 template<typename K, typename V> 00039 class ConcurrentMap : public Map<K, V>{ 00040 public: 00041 00042 virtual ~ConcurrentMap() {} 00043 00067 virtual bool putIfAbsent( const K& key, const V& value ) = 0; 00068 00087 virtual bool remove( const K& key, const V& value ) = 0; 00088 00108 virtual bool replace( const K& key, const V& oldValue, const V& newValue ) = 0; 00109 00130 virtual V replace( const K& key, const V& value ) = 0; 00131 00132 }; 00133 00134 }}} 00135 00136 #endif /* _DECAF_UTIL_CONCURRENT_CONCURRENTMAP_H_ */
1.6.1