Oracle Coherence for C++ API
Release 3.6.1.0
E18813-01

- Main Page
- Namespaces
- Classes
- Files

# coherence/util/Converter.hpp

    00001 /*
    00002 * Converter.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_CONVERTER_HPP
    00017 #define COH_CONVERTER_HPP
    00018
    00019 #include "coherence/lang.ns"
    00020
    00021 COH_OPEN_NAMESPACE2(coherence,util)
    00022
    00023
    00024 /**
    00025 * Interface for conversion from one {@link coherence::lang::Object
    00026 * Object} type to another one.
    00027 *
    00028 * @author mf  2007.07.05
    00029 */
    00030 class COH_EXPORT Converter
    00031     : public interface_spec<Converter>
    00032     {
    00033     // ----- Converter interface --------------------------------------------
    00034
    00035     public:
    00036         /**
    00037         * Convert an {@link coherence::lang::Object Object} referenced
    00038         * by the supplied holder.
    00039         *
    00040         * @param oh the holder to the Object to convert
    00041         *
    00042         * @return the holder to the converted Object
    00043         */
    00044         virtual Object::Holder convert(Object::Holder oh) const = 0;
    00045
    00046
    00047     // ----- static methods -------------------------------------------------
    00048
    00049     public:
    00050         /**
    00051         * Convert the {@link coherence::lang::Object Object} referenced
    00052         * by the supplied Object::Holder using the supplied Converter.
    00053         *
    00054         * @param vConvert a handle to the Converter to use
    00055         * @param oh       a holder to the Object to convert
    00056         *
    00057         * @return a holder of the converted Object, or the unconverted Object
    00058         *         if the Converter is NULL
    00059         */
    00060         static Object::Holder convert(Converter::View vConvert, Object::Holder oh);
    00061
    00062         /**
    00063         * Convert the {@link coherence::lang::Object Object} referenced
    00064         * by the supplied handle using the supplied Converter.
    00065         *
    00066         * @param vConvert a handle to the Converter to use
    00067         * @param h        a handle to the Object to convert
    00068         *
    00069         * @return a handle of the converted Object, or the unconverted Object
    00070         *         if the Converter is NULL
    00071         */
    00072         static Object::Handle convertHandle(Converter::View vConvert, Object::Handle h);
    00073     };
    00074
    00075 COH_CLOSE_NAMESPACE2
    00076
    00077 #endif // COH_CONVERTER_HPP

Copyright © 2000, 2010, Oracle and/or its affiliates. All rights reserved.