VMware GemFire Native C++ Reference  9.1
PdxWrapper.hpp
1 #pragma once
2 
3 #ifndef GEODE_PDXWRAPPER_H_
4 #define GEODE_PDXWRAPPER_H_
5 
6 /*
7  * Licensed to the Apache Software Foundation (ASF) under one or more
8  * contributor license agreements. See the NOTICE file distributed with
9  * this work for additional information regarding copyright ownership.
10  * The ASF licenses this file to You under the Apache License, Version 2.0
11  * (the "License"); you may not use this file except in compliance with
12  * the License. You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS,
18  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  */
22 
23 #include "PdxSerializer.hpp"
24 #include "PdxSerializable.hpp"
25 
26 namespace apache {
27 namespace geode {
28 namespace client {
29 
30 class CPPCACHE_EXPORT PdxWrapper : public PdxSerializable {
38  public:
47  PdxWrapper(void* userObject, const char* className);
48 
57  void* getObject(bool detach = false);
58 
62  const char* getClassName() const;
63 
65  bool operator==(const CacheableKey& other) const;
66 
68  int32_t hashcode() const;
69 
74  void toData(PdxWriterPtr output);
79  void fromData(PdxReaderPtr input);
83  void toData(DataOutput& output) const;
88  Serializable* fromData(DataInput& input);
94  int32_t classId() const { return 0; }
103  uint32_t objectSize() const;
113  CacheableStringPtr toString() const;
114 
115  virtual ~PdxWrapper();
116 
117  private:
119  PdxWrapper();
120  PdxWrapper(const char* className);
121 
122  void* m_userObject;
123  PdxSerializerPtr m_serializer;
124  UserDeallocator m_deallocator;
125  UserObjectSizer m_sizer;
126  char* m_className;
127 
128  friend class SerializationRegistry;
129 
130  PdxWrapper(const PdxWrapper&);
131 
132  const PdxWrapper& operator=(const PdxWrapper&);
133 };
134 } // namespace client
135 } // namespace geode
136 } // namespace apache
137 
138 #endif // GEODE_PDXWRAPPER_H_
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
This namespace contains all the Geode C++ API classes, enumerations and globals.

Pivotal GemFire C++ Cache API Documentation