build-artifacts/win/product/include/gfcpp/Properties.hpp

Go to the documentation of this file.
00001 #ifndef __GEMFIRE_PROPERTIES_H__
00002 #define __GEMFIRE_PROPERTIES_H__
00003 /*=========================================================================
00004  * Copyright (c) 2002-2014 Pivotal Software, Inc. All Rights Reserved.
00005  * This product is protected by U.S. and international copyright
00006  * and intellectual property laws. Pivotal products are covered by
00007  * more patents listed at http://www.pivotal.io/patents.
00008  *========================================================================
00009  *
00010  * The specification of function behaviors is found in the corresponding .cpp file.
00011  *
00012  *========================================================================
00013  */
00014 
00018 #include "gfcpp_globals.hpp"
00019 #include "gf_types.hpp"
00020 #include "Serializable.hpp"
00021 #include "DataInput.hpp"
00022 #include "DataOutput.hpp"
00023 #include "Cacheable.hpp"
00024 #include "CacheableKey.hpp"
00025 #include "CacheableString.hpp"
00026 
00027 
00028 namespace gemfire {
00029   
00037 class CPPCACHE_EXPORT Properties 
00038 :  public Serializable
00039 {
00040 public:
00041 
00042    class Visitor
00043    {
00044      public:
00045        virtual void visit( CacheableKeyPtr& key, CacheablePtr& value ) = 0;
00046        virtual ~Visitor( ) { }
00047    };
00048 
00054    CacheableStringPtr find( const char* key);
00061    CacheablePtr find( const CacheableKeyPtr& key );
00062 
00068    void insert( const char* key, const char* value );
00069 
00075    void insert( const char* key, const int value );
00076 
00082    void insert( const CacheableKeyPtr &key, const CacheablePtr &value );
00083 
00089    void remove( const char* key );
00090 
00096    void remove( const CacheableKeyPtr& key );
00097 
00101    void foreach( Visitor& visitor ) const;
00102 
00104    uint32_t getSize() const;
00105 
00109    void addAll( const PropertiesPtr& other );
00110    
00112    static PropertiesPtr create( );
00113    
00117    void load( const char* fileName );
00118 
00122   virtual void toData( DataOutput& output ) const;
00123 
00127   virtual Serializable* fromData( DataInput& input );
00128 
00130   static Serializable* createDeserializable( );
00131 
00133   virtual int32_t classId( ) const;
00134 
00136   virtual int8_t typeId( ) const;
00137 
00138   virtual uint32_t objectSize() const {
00139     return 0;  //don't care to set the right value
00140   }
00141 
00143    virtual ~Properties();
00144 
00145 private:
00146 
00147    Properties();
00148 
00149    void * m_map;
00150 
00151    private:
00152      Properties( const Properties& );
00153      const Properties& operator=( const Properties& ); 
00154    
00155 };
00156 
00157 }; //namespace gemfire
00158 #endif //ifndef __GEMFIRE_PROPERTIES_H__

GemFire C++ Cache API Documentation