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

E47891-01

coherence/io/pof/annotation/Portable.hpp

00001 /*
00002 * Portable.hpp
00003 *
00004 * Copyright (c) 2000, 2014, 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_HPP
00017 #define COH_PORTABLE_HPP
00018 
00019 #include "coherence/lang.ns"
00020 
00021 COH_OPEN_NAMESPACE4(coherence,io,pof,annotation)
00022 
00023 /**
00024 * Portable marks a class as being eligible for use by a
00025 * PofAnnotationSerializer. This annotation is only permitted at class level
00026 * and is a marker annotation with no members. The following class illustrates
00027 * how to use Portable and PortableProperty annotations.
00028 *
00029 * @code
00030 * class Person
00031 *     : public class_spec<Person>
00032 *        {
00033 *        friend class factory<Person>;
00034 *
00035 *        public:
00036 *            String::View getFirstName() const
00037 *                {
00038 *                return m_vsFirstName;
00039 *                }
00040 *
00041 *            void setFirstName(String::View vsFirstName)
00042 *                {
00043 *                m_vsFirstName = vsFirstName;
00044 *                }
00045 *
00046 *            String::View getLastName() const
00047 *                {
00048 *                return m_vsLastName;
00049 *                }
00050 *
00051 *            void setLastName(String::View vsLastName)
00052 *                {
00053 *                m_vsLastName = vsLastName;
00054 *                }
00055 *
00056 *        private:
00057 *            MemberView<String> m_vsFirstName;
00058 *            MemberView<String> m_vsLastName;
00059 *        };
00060 *
00061 *        COH_REGISTER_CLASS(TypedClass<Person>::create()
00062 *            ->annotate(Portable::create(1001))
00063 *            ->declare(COH_PROPERTY(Person, FirstName, String::View)->annotate(PortableProperty::create(0)))
00064 *            ->declare(COH_PROPERTY(Person, LastName,  String::View)->annotate(PortableProperty::create(1))));
00065 *
00066 * @endcode
00067 *
00068 * @author hr 2011.06.29
00069 *
00070 * @since 3.7.1
00071 *
00072 * @see PortableProperty
00073 */
00074 class COH_EXPORT Portable
00075     : public class_spec<Portable,
00076         extends<Object>,
00077         implements<Annotation> >
00078     {
00079     friend class factory<Portable>;
00080 
00081     // ----- Annotation interface -------------------------------------------
00082 
00083     public:
00084         /**
00085         * {@inheritDoc}
00086         */
00087         virtual Class::View annotationType() const;
00088 
00089     // ----- constants ------------------------------------------------------
00090 
00091     public:
00092         /**
00093         * A convenience static method to return a reference to the Class
00094         * definition for this Portable annotation class.
00095         *
00096         * @return a Class representing the Portable definition
00097         */
00098         static Class::View getStaticClass();
00099     };
00100 
00101 COH_CLOSE_NAMESPACE4
00102 
00103 #endif /* COH_PORTABLE_HPP */
Copyright © 2000, 2014, Oracle and/or its affiliates. All rights reserved.