GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue > Class Template Reference

Inherits GemStone::GemFire::Cache::Generic::Internal::SBWrap< gemfire::Properties >, and GemStone::GemFire::Cache::Generic::IGFSerializable.


Detailed Description

template<class TPropKey, class TPropValue>
class GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >

Provides a collection of properties, each of which is a key/value pair. Each key is a string, and the value may be a string or an integer.

Public Member Functions

TPropValue Find (TPropKey key)
void ForEach (PropertyVisitorGeneric< TPropKey, TPropValue >^visitor)
virtual IGFSerializableFromData (DataInput^ input)
void Insert (TPropKey key, TPropValue value)
void Load (String^ fileName)
 Properties ()
void Remove (TPropKey key)
virtual void ToData (DataOutput^ output)
virtual String^ ToString () override

Static Public Member Functions

template<class TPropKey, class TPropValue>
static Properties
< TPropKey,
TPropValue >^ 
Create ()
template<class TPropKey, class TPropValue>
static Properties
< TPropKey,
TPropValue >^ 
CreateFromVoidPtr (void *ptr)

Protected Member Functions

void _SetNativePtr (gemfire::Properties *nativeptr)
void AssignPtr (gemfire::Properties *nativeptr)
void InternalCleanup ()
void SetPtr (gemfire::Properties *nativeptr)

Properties

virtual uint32_t ClassId [get]
void * NativeIntPtr [get]
virtual uint32_t ObjectSize [get]
uint32_t Size [get]

Constructor & Destructor Documentation

template<class TPropKey, class TPropValue>
GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::Properties (  )  [inline]

Default constructor: returns an empty collection.


Member Function Documentation

void GemStone::GemFire::Cache::Generic::Internal::SBWrap< gemfire::Properties >::_SetNativePtr ( gemfire::Properties *  nativeptr  )  [inline, protected, inherited]

Set the native pointer to the new object without doing a preserveSB(). DO NOT USE UNLESS YOU KNOW WHAT YOU ARE DOING.

void GemStone::GemFire::Cache::Generic::Internal::SBWrap< gemfire::Properties >::AssignPtr ( gemfire::Properties *  nativeptr  )  [inline, protected, inherited]

Used to assign the native pointer to a new object.

Note the order of preserveSB() and releaseSB(). This handles the corner case when m_nativeptr is same as nativeptr.

template<class TPropKey, class TPropValue>
template<class TPropKey, class TPropValue>
static Properties<TPropKey, TPropValue> ^ GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::Create (  )  [inline, explicit, static]

Factory method to create an empty collection of properties.

Returns:
empty collection of properties

template<class TPropKey, class TPropValue>
template<class TPropKey, class TPropValue>
static Properties<TPropKey, TPropValue> ^ GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::CreateFromVoidPtr ( void *  ptr  )  [inline, explicit, static]

Internal factory function to wrap a native object pointer inside this managed class with null pointer check.

Parameters:
ptr The native IntPtr pointer
Returns:
The managed wrapper object; null if the native pointer is null.

template<class TPropKey, class TPropValue>
TPropValue GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::Find ( TPropKey  key  ) 

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

Parameters:
key the key to find
Returns:
the value for the key
Exceptions:
NullPointerException if the key is null

template<class TPropKey, class TPropValue>
void GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::ForEach ( PropertyVisitorGeneric< TPropKey, TPropValue >^  visitor  ) 

Execute the Visitor delegate for each entry in the collection.

Parameters:
visitor visitor delegate

template<class TPropKey, class TPropValue>
virtual IGFSerializable ^ GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::FromData ( DataInput^   input  )  [virtual]

Deserializes this Properties object.

Parameters:
input the DataInput stream to use for reading data
Returns:
the deserialized Properties object

Implements GemStone::GemFire::Cache::Generic::IGFSerializable.

template<class TPropKey, class TPropValue>
void GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::Insert ( TPropKey  key,
TPropValue  value 
)

Add or update the string value for key.

Parameters:
key the key to insert
value the string value to insert
Exceptions:
NullPointerException if the key is null

void GemStone::GemFire::Cache::Generic::Internal::SBWrap< gemfire::Properties >::InternalCleanup (  )  [inline, protected, inherited]

Internal cleanup function invoked by dispose/finalizer.

template<class TPropKey, class TPropValue>
void GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::Load ( String^   fileName  ) 

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

Parameters:
fileName the name of the file

template<class TPropKey, class TPropValue>
void GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::Remove ( TPropKey  key  ) 

Remove the key from the collection.

Parameters:
key the key to remove
Exceptions:
NullPointerException if the key is null

void GemStone::GemFire::Cache::Generic::Internal::SBWrap< gemfire::Properties >::SetPtr ( gemfire::Properties *  nativeptr  )  [inline, protected, inherited]

Used to set the native pointer to a new object. This should only be used when you know that the underlying object is NULL.

template<class TPropKey, class TPropValue>
virtual void GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::ToData ( DataOutput^   output  )  [virtual]

Serializes this Properties object.

Parameters:
output the DataOutput stream to use for serialization

Implements GemStone::GemFire::Cache::Generic::IGFSerializable.

template<class TPropKey, class TPropValue>
virtual String ^ GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::ToString (  )  [override, virtual]

Returns a string representation of the current Properties object.

Returns:
A comma separated list of property name,value pairs.

Implements GemStone::GemFire::Cache::Generic::IGFSerializable.


Property Documentation

template<class TPropKey, class TPropValue>
virtual uint32_t GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::ClassId [get]

Returns the classId of this class for serialization.

Returns:
classId of the Properties class
See also:
IGFSerializable.ClassId

Implements GemStone::GemFire::Cache::Generic::IGFSerializable.

template<class TPropKey, class TPropValue>
void* GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::NativeIntPtr [get]

Get the underlying native unmanaged pointer.

template<class TPropKey, class TPropValue>
virtual uint32_t GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::ObjectSize [get]

return the size of this object in bytes

Implements GemStone::GemFire::Cache::Generic::IGFSerializable.

template<class TPropKey, class TPropValue>
uint32_t GemStone::GemFire::Cache::Generic::Properties< TPropKey, TPropValue >::Size [get]

Return the number of entries in the collection.

Returns:
the number of entries


GemFire C++ Cache .NET API Documentation