MySQL  8.0.19
Source Code Documentation
gcs_member_identifier.h
Go to the documentation of this file.
1 /* Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved.
2 
3  This program is free software; you can redistribute it and/or modify
4  it under the terms of the GNU General Public License, version 2.0,
5  as published by the Free Software Foundation.
6 
7  This program is also distributed with certain software (including
8  but not limited to OpenSSL) that is licensed under separate terms,
9  as designated in a particular file or component or in included license
10  documentation. The authors of MySQL hereby grant you an additional
11  permission to link the program and your derivative works with the
12  separately licensed software that they have included with MySQL.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License, version 2.0, for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
22 
23 #ifndef GCS_MEMBER_IDENTIFIER_INCLUDED
24 #define GCS_MEMBER_IDENTIFIER_INCLUDED
25 
26 #include <string>
27 
28 /**
29  @class Gcs_member_identifier
30 
31  It represents the identity of a group member within a certain group.
32  It can be the same or different within groups.
33 
34  One should avoid creating this representation from outside the binding,
35  since each one might have its own internal representations.
36  Instead one should use the Gcs_control_interface::get_local_information
37  method to know our own identification within the group.
38  */
40  public:
41  /**
42  Gcs_member_identifier constructor.
43 
44  @param[in] member_id the member identifier
45  */
46 
47  explicit Gcs_member_identifier(const std::string &member_id);
48 
49  Gcs_member_identifier() = default;
54 
56 
57  /**
58  @return the member identifier
59  */
60 
61  const std::string &get_member_id() const;
62 
63  /**
64  Redefinition of the operator less, to allow usage as key in maps.
65 
66  @param[in] other the Gcs_member_identifier to compare to
67 
68  @return the result of comparing internal representation with the
69  compare operation from the string object
70  */
71 
72  bool operator<(const Gcs_member_identifier &other) const;
73 
74  /**
75  Redefinition of the operator equals, to allow usage in sets.
76 
77  @param[in] other the Gcs_member_identifier to compare to
78 
79  @return the result of comparing internal representation with the
80  compare operation from the string object
81  */
82 
83  bool operator==(const Gcs_member_identifier &other) const;
84 
85  private:
86  std::string m_member_id;
87 };
88 #endif // GCS_MEMBER_IDENTIFIER_INCLUDED
Gcs_member_identifier::operator=
Gcs_member_identifier & operator=(const Gcs_member_identifier &)=default
Gcs_member_identifier::operator<
bool operator<(const Gcs_member_identifier &other) const
Redefinition of the operator less, to allow usage as key in maps.
Definition: gcs_member_identifier.cc:38
Gcs_member_identifier::m_member_id
std::string m_member_id
Definition: gcs_member_identifier.h:86
Gcs_member_identifier::Gcs_member_identifier
Gcs_member_identifier()=default
Gcs_member_identifier::~Gcs_member_identifier
virtual ~Gcs_member_identifier()
Definition: gcs_member_identifier.h:55
Gcs_member_identifier::operator==
bool operator==(const Gcs_member_identifier &other) const
Redefinition of the operator equals, to allow usage in sets.
Definition: gcs_member_identifier.cc:43
Gcs_member_identifier
Definition: gcs_member_identifier.h:39
Gcs_member_identifier::get_member_id
const std::string & get_member_id() const
Definition: gcs_member_identifier.cc:34