VMware Tanzu GemFire Native C++ Reference 10.3.0
apache::geode::client::Properties Class Reference

Contains a set of (key, value) pair properties with key being the name of the property; value, the value of the property. More...

#include <Properties.hpp>

Inherits internal::DataSerializablePrimitive.

Public Member Functions

void addAll (const std::shared_ptr< Properties > &other)
 Add the contents of other to this instance, replacing any existing values with those from other. More...
 
std::shared_ptr< Cacheablefind (const std::shared_ptr< CacheableKey > &key)
 Return the value for the given CacheableKey, or nullptr if not found. More...
 
std::shared_ptr< CacheableStringfind (const std::string &key)
 Return the value for the given key, or nullptr if not found. More...
 
void foreach (Visitor &visitor) const
 Execute the Visitor's visit( const char* key, const char* value ) method for each entry in the collection. More...
 
size_t getSize () const
 Return the number of entries in the collection. More...
 
void insert (const std::shared_ptr< CacheableKey > &key, const std::shared_ptr< Cacheable > &value)
 Add or update Cacheable value for CacheableKey. More...
 
void insert (std::string key, const int value)
 Add or update the int value for key. More...
 
void insert (std::string key, std::string value)
 Add or update the string value for key. More...
 
void load (const std::string &fileName)
 Read property values from a file, overriding what is currently in the properties object. More...
 
void remove (const std::shared_ptr< CacheableKey > &key)
 Remove the CacheableKey from the collection. More...
 
void remove (const std::string &key)
 Remove the key from the collection. More...
 

Static Public Member Functions

static std::shared_ptr< Propertiescreate ()
 Factory method, returns an empty collection. More...
 
static std::shared_ptr< SerializablecreateDeserializable ()
 Return an empty instance for deserialization. More...
 

Detailed Description

Contains a set of (key, value) pair properties with key being the name of the property; value, the value of the property.

Member Function Documentation

◆ addAll()

void apache::geode::client::Properties::addAll ( const std::shared_ptr< Properties > &  other)

Add the contents of other to this instance, replacing any existing values with those from other.

◆ create()

static std::shared_ptr< Properties > apache::geode::client::Properties::create ( )
static

Factory method, returns an empty collection.

◆ createDeserializable()

static std::shared_ptr< Serializable > apache::geode::client::Properties::createDeserializable ( )
static

Return an empty instance for deserialization.

◆ find() [1/2]

std::shared_ptr< Cacheable > apache::geode::client::Properties::find ( const std::shared_ptr< CacheableKey > &  key)

Return the value for the given CacheableKey, or nullptr if not found.

Exceptions
NullPointerExceptionif the key is nullptr

◆ find() [2/2]

std::shared_ptr< CacheableString > apache::geode::client::Properties::find ( const std::string &  key)

Return the value for the given key, or nullptr if not found.

Exceptions
NullPointerExceptionif the key is null

◆ foreach()

void apache::geode::client::Properties::foreach ( Visitor &  visitor) const

Execute the Visitor's visit( const char* key, const char* value ) method for each entry in the collection.

◆ getSize()

size_t apache::geode::client::Properties::getSize ( ) const

Return the number of entries in the collection.

◆ insert() [1/3]

void apache::geode::client::Properties::insert ( const std::shared_ptr< CacheableKey > &  key,
const std::shared_ptr< Cacheable > &  value 
)

Add or update Cacheable value for CacheableKey.

Exceptions
NullPointerExceptionif the key is nullptr

◆ insert() [2/3]

void apache::geode::client::Properties::insert ( std::string  key,
const int  value 
)

Add or update the int value for key.

Exceptions
NullPointerExceptionif the key is null

◆ insert() [3/3]

void apache::geode::client::Properties::insert ( std::string  key,
std::string  value 
)

Add or update the string value for key.

Exceptions
NullPointerExceptionif the key is null

◆ load()

void apache::geode::client::Properties::load ( const std::string &  fileName)

Read property values from a file, overriding what is currently in the properties object.

◆ remove() [1/2]

void apache::geode::client::Properties::remove ( const std::shared_ptr< CacheableKey > &  key)

Remove the CacheableKey from the collection.

Exceptions
NullPointerExceptionif the key is nullptr

◆ remove() [2/2]

void apache::geode::client::Properties::remove ( const std::string &  key)

Remove the key from the collection.

Exceptions
NullPointerExceptionif the key is null

Apache Geode C++ Cache API Documentation