Oracle Coherence for C++ API
Release 3.6.0.0

E15728-01

coherence/util/ValueUpdater.hpp

00001 /*
00002 * ValueUpdater.hpp
00003 *
00004 * Copyright (c) 2000, 2010, 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_VALUE_UPDATER_HPP
00017 #define COH_VALUE_UPDATER_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 COH_OPEN_NAMESPACE2(coherence,util)
00022 
00023 
00024 /**
00025 * ValueUpdater is used to update an object's state.
00026 *
00027 * @author jh  2008.02.26
00028 */
00029 class COH_EXPORT ValueUpdater
00030     : public interface_spec<ValueUpdater>
00031     {
00032     // ----- ValueUpdater interface ---------------------------------------
00033 
00034     public:
00035         /**
00036         * Update the state of the passed target object using the passed
00037         * value.
00038         *
00039         * @param hTarget  the Object to update the state of
00040         * @param ohValue  the new value to update the state with
00041         *
00042         * @throws ClassCastException if this ValueUpdater is incompatible with
00043         *         the passed target object or the value and the
00044         *         implementation <b>requires</b> the passed object or the
00045         *         value to be of a certain type
00046         * @throws Exception if this ValueUpdater encounters a checked
00047         *         exception in the course of updating the target object
00048         * @throws IllegalArgumentException if this ValueUpdater cannot handle
00049         *         the passed target object or value for any other reason;
00050         *         an implementor should include a descriptive message
00051         */
00052         virtual void update(Object::Handle hTarget,
00053                 Object::Holder ohValue) const = 0;
00054     };
00055 
00056 COH_CLOSE_NAMESPACE2
00057 
00058 #endif // COH_VALUE_UPDATER_HPP
Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.