00001 /* 00002 * IdentityHolder.hpp 00003 * 00004 * Copyright (c) 2000, 2020, 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_IDENTITY_HOLDER_HPP 00017 #define COH_IDENTITY_HOLDER_HPP 00018 00019 #include "coherence/lang.ns" 00020 00021 #include "coherence/io/pof/PofBufferReader.hpp" 00022 00023 COH_OPEN_NAMESPACE3(coherence,io,pof) 00024 00025 00026 /** 00027 * A thread local storage to hold the identity of an object and its corresponding 00028 * POF stream reader. 00029 * 00030 * @author lh 2011.07.19 00031 * 00032 * @since Coherence 3.7.1 00033 */ 00034 class COH_EXPORT IdentityHolder 00035 : public class_spec<IdentityHolder, 00036 extends <Object> > 00037 { 00038 friend class factory<IdentityHolder>; 00039 00040 // ----- member methods ------------------------------------------------- 00041 00042 public: 00043 /** 00044 * Store an identity for an object a POF stream reader just read. 00045 * 00046 * @param hReader the POF stream reader 00047 * @param nId the identity of an object 00048 */ 00049 static void set(PofBufferReader::Handle hReader, int32_t nId); 00050 00051 /** 00052 * Register an object. 00053 * 00054 * @param hReader the POF stream reader 00055 * @param nId the identity of an object 00056 * @param oh the object 00057 */ 00058 static void reset(PofBufferReader::Handle hReader, int32_t nId, Object::Holder oh); 00059 }; 00060 00061 COH_CLOSE_NAMESPACE3 00062 00063 #endif // COH_IDENTITY_HOLDER_HPP 00064