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

F79659-03

coherence/io/pof/PofContext.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_POF_CONTEXT_HPP
00008 #define COH_POF_CONTEXT_HPP
00009 
00010 #include "coherence/lang.ns"
00011 
00012 #include "coherence/io/Serializer.hpp"
00013 #include "coherence/io/pof/PofSerializer.hpp"
00014 
00015 COH_OPEN_NAMESPACE3(coherence,io,pof)
00016 
00017 using coherence::io::Serializer;
00018 
00019 
00020 /**
00021 * A PofContext is a registry of PofSerializer instances, and thus, represents
00022 * a set of user types that can be serialized to and deserialized from a POF
00023 * stream.
00024 *
00025 * @author jh  2008.01.18
00026 */
00027 class COH_EXPORT PofContext
00028     : public interface_spec<PofContext,
00029         implements<Serializer> >
00030     {
00031     // ----- PofContext interface -------------------------------------------
00032 
00033     public:
00034         /**
00035         * Return a PofSerializer that can be used to serialize and
00036         * deserialize an objectof the specified user type to and from a POF
00037         * stream.
00038         *
00039         * @param nTypeId  the type identifier of the user type that can be
00040         *                 serialized and deserialized using the returned
00041         *                 PofSerializer
00042         *
00043         * @return a PofSerializer for the specified user type
00044         *
00045         * @throws coherence::lang::IllegalArgumentException if the specified
00046         *         user type is negative or unknown to this PofContext
00047         */
00048         virtual PofSerializer::View getPofSerializer(int32_t nTypeId) const = 0;
00049 
00050         /**
00051         * Determine the user type identifier associated with the given
00052         * object.
00053         *
00054         * @param v  an instance of a user type; must not be NULL
00055         *
00056         * @return the type identifier of the user type associated with the
00057         *         given object
00058         *
00059         * @throws coherence::lang::IllegalArgumentException if the user type
00060         *         associated with the given object is unknown to this
00061         *         PofContext or if the object is NULL
00062         */
00063         virtual int32_t getUserTypeIdentifier(Object::View v) const = 0;
00064 
00065         /**
00066         * Determine the user type identifier associated with the given class.
00067         *
00068         * @param vClass  a user type class; must not be NULL
00069         *
00070         * @return the type identifier of the user type associated with the
00071         *         given class
00072         *
00073         * @throws coherence::lang::IllegalArgumentException if the user type
00074         *         associated with the given class is unknown to this
00075         *         PofContext or if the class is NULL
00076         */
00077         virtual int32_t getUserTypeIdentifier(Class::View vClass) const = 0;
00078 
00079         /**
00080         * Determine the user type identifier associated with the given class
00081         * name.
00082         *
00083         * @param vsClass  the name of a user type class; must not be NULL
00084         *
00085         * @return the type identifier of the user type associated with the
00086         *         given class name
00087         *
00088         * @throws coherence::lang::IllegalArgumentException if the user type
00089         *         associated with the given class name is unknown to this
00090         *         PofContext or if the class name is NULL
00091         */
00092         virtual int32_t getUserTypeIdentifier(String::View vsClass) const = 0;
00093 
00094         /**
00095         * Determine the name of the class associated with the given user type
00096         * identifier.
00097         *
00098         * @param nTypeId  the user type identifier; must be non-negative
00099         *
00100         * @return the name of the class associated with the specified user
00101         *         type identifier
00102         *
00103         * @throws coherence::lang::IllegalArgumentException if the specified
00104         *         user type is negative or unknown to this PofContext
00105         */
00106         virtual String::View getClassName(int32_t nTypeId) const = 0;
00107 
00108         /**
00109         * Determine the class associated with the given user type identifier.
00110         *
00111         * @param nTypeId  the user type identifier; must be non-negative
00112         *
00113         * @return the class associated with the specified user type
00114         *         identifier
00115         *
00116         * @throws coherence::lang::IllegalArgumentException if the specified
00117         *         user type is negative or unknown to this PofContext
00118         */
00119         virtual Class::View getClass(int32_t nTypeId) const = 0;
00120 
00121         /**
00122         * Determine if the given object is an instance of a user type known
00123         * to this PofContext.
00124         *
00125         * @param v  the object to test; must not be NULL
00126         *
00127         * @return true iff the specified object is of a valid user type
00128         *
00129         * @throws coherence::lang::IllegalArgumentException if the given
00130         *         object is NULL
00131         */
00132         virtual bool isUserType(Object::View v) const = 0;
00133 
00134         /**
00135         * Determine if the given class is a user type known to this
00136         * PofContext.
00137         *
00138         * @param vClass  the class to test; must not be NULL
00139         *
00140         * @return true iff the specified class is a valid user type known to
00141         *         this PofContext
00142         *
00143         * @throws coherence::lang::IllegalArgumentException if the given
00144         *         class is NULL
00145         */
00146         virtual bool isUserType(Class::View vClass) const = 0;
00147 
00148         /**
00149         * Determine if the class with the given name is a user type known to
00150         * this PofContext.
00151         *
00152         * @param vsClass  the name of the class to test; must not be NULL
00153         *
00154         * @return true iff the class with the specified name is a valid user
00155         *         type
00156         *
00157         * @throws coherence::lang::IllegalArgumentException if the given
00158         *         class name is NULL
00159         */
00160         virtual bool isUserType(String::View vsClass) const = 0;
00161     };
00162 
00163 COH_CLOSE_NAMESPACE3
00164 
00165 #endif // COH_POF_CONTEXT_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.