Oracle Fusion Middleware C++ API Reference for Oracle Coherence
12c (12.1.2)

E26041-01

coherence/lang/interface_spec.hpp

00001 /*
00002 * interface_spec.hpp
00003 *
00004 * Copyright (c) 2000, 2013, 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_INTERFACE_SPEC_HPP
00017 #define COH_INTERFACE_SPEC_HPP
00018 
00019 #include "coherence/lang/compatibility.hpp"
00020 
00021 #include "coherence/lang/lang_spec.hpp"
00022 #include "coherence/lang/Object.hpp"
00023 #include "coherence/lang/TypedHandle.hpp"
00024 #include "coherence/lang/TypedHolder.hpp"
00025 
00026 COH_OPEN_NAMESPACE2(coherence,lang)
00027 
00028 /**
00029 * Helper for defining a managed interface.
00030 *
00031 * Managed interfaces virtually derive from coherence::lang::Object, and
00032 * include a set of well known features, which are auto-generated by this
00033 * helper class:
00034 *
00035 * - Handle/View/Holder definitions
00036 * - virtual interface inheritance of up to 16 interfaces
00037 *
00038 * The template takes two parameters:
00039 *
00040 * - The name of the interface being defined
00041 * - An optional list of interfaces to extend, indicated as
00042 *   implements<i1, i2, ...>
00043 *
00044 * A normal interface definition would be:
00045 * @code
00046 * class MyInterface
00047 *   : public interface_spec<MyInterface,
00048 *       implements<SomeInterface, SomeOtherInterface> >
00049 *   {
00050 *   public:
00051 *       // pure virtual method definitions....
00052 *   };
00053 * @endcode
00054 *
00055 * @see implements
00056 *
00057 * @author mf 2008.07.14
00058 */
00059 template<class T, class I = implements<> >
00060 class interface_spec
00061     : public virtual Object, public virtual I::implements_chain
00062     {
00063     public:
00064         /**
00065         * Specification definition
00066         */
00067         typedef interface_spec this_spec;
00068 
00069         /**
00070         * Standard Handle definition
00071         */
00072         typedef TypedHandle<T> Handle;
00073 
00074         /**
00075         * Standard View definition
00076         */
00077         typedef TypedHandle<const T> View;
00078 
00079         /**
00080         * Standard Holder definition
00081         */
00082         typedef TypedHolder<T> Holder;
00083 
00084         /**
00085          * implemented interface typedefs
00086          */
00087         typedef typename I::interface_1  interface_1;
00088         typedef typename I::interface_2  interface_2;
00089         typedef typename I::interface_3  interface_3;
00090         typedef typename I::interface_4  interface_4;
00091         typedef typename I::interface_5  interface_5;
00092         typedef typename I::interface_6  interface_6;
00093         typedef typename I::interface_7  interface_7;
00094         typedef typename I::interface_8  interface_8;
00095         typedef typename I::interface_9  interface_9;
00096         typedef typename I::interface_10 interface_10;
00097         typedef typename I::interface_11 interface_11;
00098         typedef typename I::interface_12 interface_12;
00099         typedef typename I::interface_13 interface_13;
00100         typedef typename I::interface_14 interface_14;
00101         typedef typename I::interface_15 interface_15;
00102         typedef typename I::interface_16 interface_16;
00103 
00104     private:
00105         /**
00106         * Blocked Object::create()
00107         *
00108         * @internal
00109         */
00110         static void create()
00111             {
00112             }
00113     };
00114 
00115 COH_CLOSE_NAMESPACE2
00116 
00117 #endif // COH_INTERFACE_SPEC_HPP
Copyright © 2000, 2013, Oracle and/or its affiliates. All rights reserved.