MySQL  8.0.22
Source Code Documentation
gcs_xcom_view_identifier.h
Go to the documentation of this file.
1 /* Copyright (c) 2015, 2020, Oracle and/or its affiliates.
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_XCOM_VIEW_IDENTIFIER_INCLUDED
24 #define GCS_XCOM_VIEW_IDENTIFIER_INCLUDED
25 
26 #include <stdint.h>
27 #include <string>
28 
31 
33  public:
34  explicit Gcs_xcom_view_identifier(uint64_t fixed_part_arg,
35  uint32_t monotonic_part_arg);
36 
38 
39  uint64_t get_fixed_part() const { return m_fixed_part; }
40 
41  uint32_t get_monotonic_part() const { return m_monotonic_part; }
42 
43  void increment_by_one();
44 
45  const std::string &get_representation() const override;
46 
47  Gcs_view_identifier *clone() const override;
48 
49  private:
50  void init(uint64_t fixed_part_arg, uint32_t monotonic_part_arg);
51  bool equals(const Gcs_view_identifier &other) const override;
52  bool lessThan(const Gcs_view_identifier &other) const override;
53 
54  uint64_t m_fixed_part;
55  uint32_t m_monotonic_part;
56  std::string m_representation;
57 };
58 
59 #endif /* GCS_XCOM_VIEW_IDENTIFIER_INCLUDED */
uint64_t get_fixed_part() const
Definition: gcs_xcom_view_identifier.h:39
uint64_t m_fixed_part
Definition: gcs_xcom_view_identifier.h:54
uint32_t m_monotonic_part
Definition: gcs_xcom_view_identifier.h:55
This represents the identification of a certain view of a certain group in a moment in time...
Definition: gcs_view_identifier.h:43
uint32_t get_monotonic_part() const
Definition: gcs_xcom_view_identifier.h:41
bool lessThan(const Gcs_view_identifier &other) const override
Definition: gcs_xcom_view_identifier.cc:66
Gcs_xcom_view_identifier(uint64_t fixed_part_arg, uint32_t monotonic_part_arg)
Definition: gcs_xcom_view_identifier.cc:27
std::string m_representation
Definition: gcs_xcom_view_identifier.h:56
bool equals(const Gcs_view_identifier &other) const override
Definition: gcs_xcom_view_identifier.cc:58
void increment_by_one()
Definition: gcs_xcom_view_identifier.cc:45
Definition: gcs_xcom_view_identifier.h:32
void init(uint64_t fixed_part_arg, uint32_t monotonic_part_arg)
Definition: gcs_xcom_view_identifier.cc:33
Gcs_view_identifier * clone() const override
Returns a copy of this object.
Definition: gcs_xcom_view_identifier.cc:54
const std::string & get_representation() const override
Returns a normalized representation of the DTO.
Definition: gcs_xcom_view_identifier.cc:50