VMware GemFire Native Client Cache Reference  9.0.6
Properties.hpp
Go to the documentation of this file.
1 #ifndef __GEMFIRE_PROPERTIES_H__
2 #define __GEMFIRE_PROPERTIES_H__
3 /*=========================================================================
4  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
5  * This product is protected by U.S. and international copyright
6  * and intellectual property laws. Pivotal products are covered by
7  * more patents listed at http://www.pivotal.io/patents.
8  *========================================================================
9  *
10  * The specification of function behaviors is found in the corresponding .cpp file.
11  *
12  *========================================================================
13  */
14 
18 #include "gfcpp_globals.hpp"
19 #include "gf_types.hpp"
20 #include "Serializable.hpp"
21 #include "DataInput.hpp"
22 #include "DataOutput.hpp"
23 #include "Cacheable.hpp"
24 #include "CacheableKey.hpp"
25 #include "CacheableString.hpp"
26 
27 
28 namespace gemfire {
29 
38 : public Serializable
39 {
40 public:
41 
42  class Visitor
43  {
44  public:
45  virtual void visit( CacheableKeyPtr& key, CacheablePtr& value ) = 0;
46  virtual ~Visitor( ) { }
47  };
48 
54  CacheableStringPtr find( const char* key);
61  CacheablePtr find( const CacheableKeyPtr& key );
62 
68  void insert( const char* key, const char* value );
69 
75  void insert( const char* key, const int value );
76 
82  void insert( const CacheableKeyPtr &key, const CacheablePtr &value );
83 
89  void remove( const char* key );
90 
96  void remove( const CacheableKeyPtr& key );
97 
101  void foreach( Visitor& visitor ) const;
102 
104  uint32_t getSize() const;
105 
109  void addAll( const PropertiesPtr& other );
110 
112  static PropertiesPtr create( );
113 
117  void load( const char* fileName );
118 
122  virtual void toData( DataOutput& output ) const;
123 
127  virtual Serializable* fromData( DataInput& input );
128 
130  static Serializable* createDeserializable( );
131 
133  virtual int32_t classId( ) const;
134 
136  virtual int8_t typeId( ) const;
137 
138  virtual uint32_t objectSize() const {
139  return 0; //don't care to set the right value
140  }
141 
143  virtual ~Properties();
144 
145 private:
146 
147  Properties();
148 
149  void * m_map;
150 
151  private:
152  Properties( const Properties& );
153  const Properties& operator=( const Properties& );
154 
155 };
156 
157 }; //namespace gemfire
158 #endif //ifndef __GEMFIRE_PROPERTIES_H__
Provide operations for writing primitive data values, byte arrays, strings, Serializable objects to a...
Definition: DataOutput.hpp:62
This namespace contains all the GemFire C++ API classes, enumerations and globals.
Definition: Assert.hpp:19
virtual uint32_t objectSize() const
return the size in bytes of the instance being serialized.
Definition: Properties.hpp:138
This abstract base class is the superclass of all user objects in the cache that can be serialized...
Definition: Serializable.hpp:39
Provide operations for reading primitive data values, byte arrays, strings, Serializable objects from...
Definition: DataInput.hpp:44
Contains a set of (key, value) pair properties with key being the name of the property; value...
Definition: Properties.hpp:37
#define CPPCACHE_EXPORT
Defines a GemFire CPPCACHE export.
Definition: gf_base.hpp:51

GemFire C++ Cache API Documentation