Hazelcast C++ Client
Hazelcast C++ Client Library
hazelcast::client::member Class Reference

hz_cluster member class. More...

#include <member.h>

Classes

struct  version
 

Public Types

enum  member_attribute_operation_type { PUT = 1 , REMOVE = 2 }
 PUT even type representing an addition of an attribute REMOVE event type representing a deletion of an attribute.
 

Public Member Functions

 member (address member_address, boost::uuids::uuid uuid, bool lite, std::unordered_map< std::string, std::string > attr, std::unordered_map< endpoint_qualifier, address > address_map)
 
 member (address member_address)
 
 member (boost::uuids::uuid uuid)
 
bool is_lite_member () const
 Lite member is does not hold data. More...
 
const addressget_address () const
 Returns the socket address of this member. More...
 
boost::uuids::uuid get_uuid () const
 Returns UUID of this member. More...
 
const std::unordered_map< std::string, std::string > & get_attributes () const
 
const std::string * get_attribute (const std::string &key) const
 Returns the value of the specified key for this member or default constructed value if value is undefined. More...
 
bool lookup_attribute (const std::string &key) const
 check if an attribute is defined for given key. More...
 
const std::unordered_map< endpoint_qualifier, address > & address_map () const
 
bool operator< (const member &rhs) const
 

Friends

bool HAZELCAST_API operator== (const member &lhs, const member &rhs)
 

Detailed Description

hz_cluster member class.

The default implementation

See also
Cluster
MembershipListener

Definition at line 55 of file member.h.

Member Function Documentation

◆ get_address()

const address & hazelcast::client::member::get_address ( ) const

Returns the socket address of this member.

Returns
socket address of this member

Definition at line 66 of file cluster.cpp.

66  {
67  return address_;
68  }

◆ get_attribute()

const std::string * hazelcast::client::member::get_attribute ( const std::string &  key) const

Returns the value of the specified key for this member or default constructed value if value is undefined.

Template Parameters
AttributeTypetype template for attribute type
Parameters
keyThe key to lookup.
Returns
The value for this members key.

Definition at line 96 of file cluster.cpp.

96  {
97  std::unordered_map<std::string, std::string>::const_iterator it = attributes_.find(key);
98  if (attributes_.end() != it) {
99  return &(it->second);
100  } else {
101  return NULL;
102  }
103  }

◆ get_uuid()

boost::uuids::uuid hazelcast::client::member::get_uuid ( ) const

Returns UUID of this member.

Returns
UUID of this member.

Definition at line 70 of file cluster.cpp.

70  {
71  return uuid_;
72  }

◆ is_lite_member()

bool hazelcast::client::member::is_lite_member ( ) const

Lite member is does not hold data.

Returns
true if member is lite.

Definition at line 74 of file cluster.cpp.

74  {
75  return lite_member_;
76  }

◆ lookup_attribute()

bool hazelcast::client::member::lookup_attribute ( const std::string &  key) const

check if an attribute is defined for given key.

Template Parameters
keyfor the attribute
Returns
true if attribute is defined.

Definition at line 105 of file cluster.cpp.

105  {
106  return attributes_.find(key) != attributes_.end();
107  }

The documentation for this class was generated from the following files: