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

E80355-01

coherence/lang/TypedBarrenClass.hpp

00001 /*
00002 * TypedBarrenClass.hpp
00003 *
00004 * Copyright (c) 2000, 2017, 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_BARREN_CLASS_HPP
00017 #define COH_TYPED_BARREN_CLASS_HPP
00018 
00019 #include "coherence/lang/compatibility.hpp"
00020 
00021 #include "coherence/lang/AbstractTypedClass.hpp"
00022 #include "coherence/lang/Class.hpp"
00023 #include "coherence/lang/Object.hpp"
00024 #include "coherence/lang/String.hpp"
00025 #include "coherence/lang/UnsupportedOperationException.hpp"
00026 
00027 
00028 #include <typeinfo>
00029 
00030 COH_OPEN_NAMESPACE2(coherence,lang)
00031 
00032 
00033 /**
00034 * TypedBarrenClass provides a templated extension of Class but does not
00035 * provide a means to instantiate new instances of the class.
00036 *
00037 * This is suitable for use with interfaces, abstract classes, and classes
00038 * which do not have a zero-argument create method.
00039 *
00040 * @author mf/jh  2008.05.02
00041 */
00042 template<class T> class TypedBarrenClass
00043     : public class_spec<TypedBarrenClass<T>,
00044         extends<AbstractTypedClass<T> > >
00045     {
00046     friend class factory<TypedBarrenClass<T> >;
00047 
00048     // ----- typedefs -------------------------------------------------------
00049 
00050     public:
00051         /**
00052         * Class type.
00053         */
00054         typedef T Type;
00055 
00056 
00057     // ----- constructors ---------------------------------------------------
00058 
00059     protected:
00060         /**
00061          * Create a new TypedBarrenClass.
00062          */
00063         TypedBarrenClass<T>()
00064             {
00065             }
00066 
00067     private:
00068         /**
00069         * Blocked copy constructor
00070         */
00071         TypedBarrenClass<T>(const TypedBarrenClass<T>&);
00072 
00073 
00074     // ----- TypedBarrenClass interface -------------------------------------
00075 
00076     public:
00077         /**
00078         * {@inheritDoc}
00079         *
00080         * @throws UnsupportedOperationException
00081         */
00082         virtual Object::Handle newInstance(ObjectArray::View /*vaParam*/) const
00083             {
00084             if (true)
00085                 {
00086                 COH_THROW (UnsupportedOperationException::create(Class::getName()));
00087                 }
00088             return NULL;
00089             }
00090 
00091 
00092     // ----- Object interface -----------------------------------------------
00093 
00094     public:
00095         /**
00096          * {@inheritDoc}
00097          */
00098         virtual TypedHandle<const String> toString() const
00099             {
00100             return COH_TO_STRING("TypedBarrenClass<" << Class::getName() << ">");
00101             }
00102     };
00103 
00104 COH_CLOSE_NAMESPACE2
00105 
00106 #endif // COH_TYPED_BARREN_CLASS_HPP
Copyright © 2000, 2017, Oracle and/or its affiliates. All rights reserved.