VMware GemFire Native C++ Reference  9.1
Properties.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #ifndef GEODE_PROPERTIES_H_
4 #define GEODE_PROPERTIES_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 
26 #include "geode_globals.hpp"
27 #include "geode_types.hpp"
28 #include "Serializable.hpp"
29 #include "DataInput.hpp"
30 #include "DataOutput.hpp"
31 #include "Cacheable.hpp"
32 #include "CacheableKey.hpp"
33 #include "CacheableString.hpp"
34 
35 namespace apache {
36 namespace geode {
37 namespace client {
38 
47  public:
48  class Visitor {
49  public:
50  virtual void visit(CacheableKeyPtr& key, CacheablePtr& value) = 0;
51  virtual ~Visitor() {}
52  };
53 
59  CacheableStringPtr find(const char* key);
66  CacheablePtr find(const CacheableKeyPtr& key);
67 
73  void insert(const char* key, const char* value);
74 
80  void insert(const char* key, const int value);
81 
87  void insert(const CacheableKeyPtr& key, const CacheablePtr& value);
88 
94  void remove(const char* key);
95 
101  void remove(const CacheableKeyPtr& key);
102 
107  void foreach (Visitor& visitor) const;
108 
110  uint32_t getSize() const;
111 
115  void addAll(const PropertiesPtr& other);
116 
118  static PropertiesPtr create();
119 
123  void load(const char* fileName);
124 
128  virtual void toData(DataOutput& output) const;
129 
133  virtual Serializable* fromData(DataInput& input);
134 
136  static Serializable* createDeserializable();
137 
139  virtual int32_t classId() const;
140 
142  virtual int8_t typeId() const;
143 
144  virtual uint32_t objectSize() const {
145  return 0; // don't care to set the right value
146  }
147 
149  virtual ~Properties();
150 
151  private:
152  Properties();
153 
154  void* m_map;
155 
156  private:
157  Properties(const Properties&);
158  const Properties& operator=(const Properties&);
159 };
160 } // namespace client
161 } // namespace geode
162 } // namespace apache
163 
164 #endif // GEODE_PROPERTIES_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
Contains a set of (key, value) pair properties with key being the name of the property; value...
Definition: Properties.hpp:46
Provide operations for writing primitive data values, byte arrays, strings, Serializable objects to a...
Definition: DataOutput.hpp:74
virtual uint32_t objectSize() const
return the size in bytes of the instance being serialized.
Definition: Properties.hpp:144
This abstract base class is the superclass of all user objects in the cache that can be serialized...
Definition: Serializable.hpp:53
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