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

E90870-01

coherence/lang/TypedExecutableClass.hpp

00001 /*
00002 * TypedExecutableClass.hpp
00003 *
00004 * Copyright (c) 2000, 2019, 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_TYPED_EXECUTABLE_CLASS_HPP
00017 #define COH_TYPED_EXECUTABLE_CLASS_HPP
00018 
00019 #include "coherence/lang/compatibility.hpp"
00020 
00021 #include "coherence/lang/ExecutableClass.hpp"
00022 #include "coherence/lang/String.hpp"
00023 #include "coherence/lang/TypedClass.hpp"
00024 
00025 
00026 
00027 COH_OPEN_NAMESPACE2(coherence,lang)
00028 
00029 
00030 /**
00031 * TypedExecutableClass provides a templated extension of ExecutableClass.
00032 *
00033 * @author mf  2008.10.02
00034 */
00035 template<class T, class C> class TypedExecutableClass
00036     : public class_spec<TypedExecutableClass<T, C>,
00037         extends<C>,
00038         implements<ExecutableClass> >
00039     {
00040     friend class factory<TypedExecutableClass<T, C> >;
00041 
00042     // ----- typedefs -------------------------------------------------------
00043 
00044     public:
00045         /**
00046         * Class type.
00047         */
00048         typedef T Type;
00049 
00050 
00051     // ----- constructors ---------------------------------------------------
00052 
00053     protected:
00054         /**
00055         * Create a new TypedExecutableClass.
00056         *
00057         * @return a new TypedExecutableClass
00058         */
00059         TypedExecutableClass<T, C>()
00060             {
00061             }
00062 
00063     private:
00064         /**
00065         * Blocked copy constructor
00066         */
00067         TypedExecutableClass<T, C>(const TypedExecutableClass<T, C>&);
00068 
00069 
00070     // ----- ExecutableClass interface --------------------------------------
00071 
00072     public:
00073         /**
00074         * {@inheritDoc}
00075         */
00076         virtual void execute(ObjectArray::View vasArg) const
00077             {
00078             T::main(vasArg);
00079             }
00080 
00081 
00082     // ----- Object interface -----------------------------------------------
00083 
00084     public:
00085         /**
00086         * {@inheritDoc}
00087         */
00088         virtual TypedHandle<const String> toString() const
00089             {
00090             return COH_TO_STRING("TypedExecutableClass<" << Class::getName() << ">");
00091             }
00092     };
00093 
00094 COH_CLOSE_NAMESPACE2
00095 
00096 #endif // COH_TYPED_EXECUTABLE_CLASS_HPP
Copyright © 2000, 2019, Oracle and/or its affiliates. All rights reserved.