C++ Client API Reference for Oracle Coherence
14c (14.1.2.0.0)

F79659-03

coherence/io/pof/reflect/SimplePofPath.hpp

00001 /*
00002  * Copyright (c) 2000, 2020, Oracle and/or its affiliates.
00003  *
00004  * Licensed under the Universal Permissive License v 1.0 as shown at
00005  * http://oss.oracle.com/licenses/upl.
00006  */
00007 #ifndef COH_SIMPLE_POF_PATH_HPP
00008 #define COH_SIMPLE_POF_PATH_HPP
00009 
00010 #include "coherence/lang.ns"
00011 
00012 #include "coherence/io/pof/reflect/AbstractPofPath.hpp"
00013 
00014 COH_OPEN_NAMESPACE4(coherence,io,pof,reflect)
00015 
00016 
00017 /**
00018 * A static PofNavigator implementation which uses an array of integer indices
00019 * to navigate the PofValue hierarchy.
00020 *
00021 * @author as/gm  2009.04.01
00022 * @since Coherence 3.5
00023 */
00024 class COH_EXPORT SimplePofPath
00025     : public class_spec<SimplePofPath,
00026         extends<AbstractPofPath> >
00027     {
00028     friend class factory<SimplePofPath>;
00029 
00030     // ----- constructors ---------------------------------------------------
00031 
00032     protected:
00033         /**
00034         * Default constructor (necessary for the PortableObject interface).
00035         */
00036         SimplePofPath();
00037 
00038         /**
00039         * Construct a SimplePofPath using a single index as a path.
00040         *
00041         * @param nIndex  an index
00042         */
00043         SimplePofPath(int32_t nIndex);
00044 
00045         /**
00046         * Construct a SimplePofPath using an array of indices as a path.
00047         *
00048         * @param vanIndices  an array of indices
00049         */
00050         SimplePofPath(Array<int32_t>::View vanIndices);
00051 
00052 
00053     // ----- internal -------------------------------------------------------
00054 
00055     protected:
00056         /**
00057         * {@inheritDoc}
00058         */
00059         virtual Array<int32_t>::View getPathElements() const;
00060 
00061 
00062     // ----- PortableObject interface ---------------------------------------
00063 
00064     public:
00065         /**
00066         * {@inheritDoc}
00067         */
00068         virtual void readExternal(PofReader::Handle hIn);
00069 
00070         /**
00071         * {@inheritDoc}
00072         */
00073         virtual void writeExternal(PofWriter::Handle hOut) const;
00074 
00075 
00076     // ----- Object interface -----------------------------------------------
00077 
00078     public:
00079         /**
00080         * Compare the SimplePofPath with another object to determine
00081         * equality. Two SimplePofPath objects are considered equal iff their
00082         * indices are equal.
00083         *
00084         * @param v  the object to compare against
00085         *
00086         * @return true iff this SimplePofPath and the passed object are
00087         *              equivalent.
00088         */
00089         virtual bool equals(Object::View v) const;
00090 
00091         /**
00092         * Determine a hash value for the SimplePofPath object according to
00093         * the general {@link Object#hashCode()} contract.
00094         *
00095         * @return an integer hash value for this SimplePofPath object
00096         */
00097         virtual size32_t hashCode() const;
00098 
00099         /**
00100         * Return a human-readable description for this SimplePofPath.
00101         *
00102         * @param out  the stream to write to
00103         *
00104         * @return a String description of the SimplePofPath
00105         */
00106         virtual TypedHandle<const String> toString() const;
00107 
00108 
00109     // ----- data members ---------------------------------------------
00110 
00111     private:
00112         /**
00113         * Path elements.
00114         */
00115         FinalView<Array<int32_t> > f_vaiElements;
00116     };
00117 
00118 COH_CLOSE_NAMESPACE4
00119 
00120 #endif // COH_SIMPLE_POF_PATH_HPP
Copyright © 2000, 2025, Oracle and/or its affiliates. Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.