VMware GemFire Native C++ Reference  9.1
Serializable.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_SERIALIZABLE_H_
4 #define GEODE_SERIALIZABLE_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 
27 #include "geode_globals.hpp"
28 #include "geode_types.hpp"
29 
30 namespace apache {
31 namespace geode {
32 namespace client {
33 
34 class DataOutput;
35 class DataInput;
36 
37 typedef void (*CliCallbackMethod)();
38 
44 typedef Serializable* (*TypeFactoryMethod)();
45 
46 typedef PdxSerializable* (*TypeFactoryMethodPdx)();
54  public:
58  virtual void toData(DataOutput& output) const = 0;
59 
64  virtual Serializable* fromData(DataInput& input) = 0;
65 
74  virtual int32_t classId() const = 0;
75 
84  virtual int8_t typeId() const;
85 
94  virtual int8_t DSFID() const;
95 
104  virtual uint32_t objectSize() const;
105 
114  static void registerType(TypeFactoryMethod creationFunction);
115 
122  static void registerPdxType(TypeFactoryMethodPdx creationFunction);
123 
129  static void registerPdxSerializer(PdxSerializerPtr pdxSerializer);
130 
140  virtual CacheableStringPtr toString() const;
141 
149  template <class PRIM>
150  inline static SerializablePtr create(const PRIM value);
151 
155  virtual ~Serializable() {}
156 
157  protected:
162 
163  private:
164  // Never defined.
165  Serializable(const Serializable& other);
166  void operator=(const Serializable& other);
167 };
168 } // namespace client
169 } // namespace geode
170 } // namespace apache
171 
172 #endif // GEODE_SERIALIZABLE_H_
virtual ~Serializable()
destructor
Definition: Serializable.hpp:155
Each enum represents a predefined RegionAttributes in a Cache.
Definition: Assert.hpp:31
Serializable *(* TypeFactoryMethod)()
signature of functions passed to registerType.
Definition: Serializable.hpp:44
#define CPPCACHE_EXPORT
Defines a Geode CPPCACHE export.
Definition: geode_base.hpp:58
Provide operations for writing primitive data values, byte arrays, strings, Serializable objects to a...
Definition: DataOutput.hpp:74
This abstract base class is the base class of all user objects that have the shared capability of ref...
Definition: SharedBase.hpp:40
This abstract base class is the superclass of all user objects in the cache that can be serialized...
Definition: Serializable.hpp:53
Serializable()
constructors
Definition: Serializable.hpp:161
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from...
Definition: DataInput.hpp:56
This namespace contains all the Geode C++ API classes, enumerations and globals.

Pivotal GemFire C++ Cache API Documentation