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

E90870-01

coherence/io/pof/annotation/PortableProperty.hpp

00001 /*
00002 * PortableProperty.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_PORTABLE_PROPERTY_HPP
00017 #define COH_PORTABLE_PROPERTY_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 #include "coherence/io/pof/reflect/Codec.hpp"
00022 
00023 COH_OPEN_NAMESPACE4(coherence,io,pof,annotation)
00024 
00025 /**
00026 * A PortableProperty marks a method accessor as a POF serialized
00027 * attribute. Whilst the PortableProperty::getIndex() and
00028 * PortableProperty::getCodec() can be explicitly specified they can be
00029 * determined by classes that use this annotation. Hence these attributes
00030 * serve as hints to the underlying parser.
00031 *
00032 * @author hr  2011.06.29
00033 *
00034 * @since 3.7.1
00035 */
00036 class COH_EXPORT PortableProperty
00037     : public class_spec<PortableProperty,
00038         extends<Object>,
00039         implements<Annotation> >
00040     {
00041     friend class factory<PortableProperty>;
00042 
00043     // ----- constructors ---------------------------------------------------
00044 
00045     protected:
00046         PortableProperty(int32_t nIndex = -1, Class::View vCodec = NULL);
00047 
00048     // ----- Annotation methods ---------------------------------------------
00049 
00050     public:
00051         /**
00052         * {@inheritDoc}
00053         */
00054         virtual Class::View annotationType() const;
00055 
00056     // ----- PortableProperty methods ---------------------------------------
00057 
00058     public:
00059         /**
00060          * The index of this property.
00061          *
00062          * @see PofWriter
00063          *
00064          * @return POF index
00065          */
00066         virtual int32_t getIndex() const;
00067 
00068         /**
00069         * A codec to use to short-circuit determining the type via the
00070         * method return type.
00071         *
00072         * This could be used to determine concrete implementations of
00073         * interfaces, i.e. when the method return is a Map this type
00074         * definition could instruct the code to utilize a LinkedHashMap.
00075         *
00076         * @return class representing the codec to use for this property
00077         */
00078         virtual Class::View getCodec() const;
00079 
00080     // ----- static functions -----------------------------------------------
00081 
00082     public:
00083         /**
00084         * A convenience static method to return a reference to the Class
00085         * definition for this PortableProperty annotation class.
00086         */
00087         static Class::View getStaticClass();
00088 
00089     // ----- data members ---------------------------------------------------
00090 
00091     private:
00092         /**
00093         * The POF index used for serialization and deserialization by
00094         * PofAnnotationSerializer.
00095         */
00096         int32_t             m_nIndex;
00097 
00098         /**
00099         * A Class representing a Codec implementation.
00100         */
00101         FinalView<Class>   f_vClzCodec;
00102     };
00103 
00104 COH_CLOSE_NAMESPACE4
00105 
00106 #endif /* COH_PORTABLE_PROPERTY_HPP */
Copyright © 2000, 2019, Oracle and/or its affiliates. All rights reserved.