![]() |
MySQL 9.7.0
Source Code Documentation
|
Class to aid implementing a table with cursor ( Is_table_with_cursor) where the table data is represented in a mysql::abi_helpers::Packet_array object.
More...
#include <packet_based_table_with_cursor.h>
Public Types | |
| using | Impl_t = Impl_tp |
| Type of the implementation. More... | |
| using | Type_info_t = detail::Type_info_for_get_row_view_definition< Impl_t > |
| Type of Row_view_definitions returned by the get_row_view_definition() member of Impl_t. More... | |
Public Member Functions | |
| Packet_based_table_with_cursor () | |
| ~Packet_based_table_with_cursor () | |
| Packet_based_table_with_cursor (const Packet_based_table_with_cursor &)=delete | |
| Delete copy/move semantics. More... | |
| Packet_based_table_with_cursor (Packet_based_table_with_cursor &&)=delete | |
| Packet_based_table_with_cursor & | operator= (const Packet_based_table_with_cursor &)=delete |
| Packet_based_table_with_cursor & | operator= (Packet_based_table_with_cursor &&)=delete |
| void | set_cursor (int row) |
| Move the cursor to the given row number. More... | |
| int | get_cursor () |
| Return the current cursor (row number). More... | |
| void | advance () |
| Move the cursor to next row. More... | |
| bool | is_at_end () const |
| void | copy_field (int index, PSI_field *field) const |
| Copy the value of the given field index to the given PSI_field object. More... | |
Static Public Member Functions | |
| static const char * | get_table_name () |
| Return the table name. More... | |
| static const char * | get_table_definition () |
| Return the table definition. More... | |
| static int | get_approximate_row_count () |
| Return the cached approximate row count. More... | |
Static Private Member Functions | |
| static std::atomic< int > & | get_cached_approximate_row_count_ref () |
| Return a reference to an atomic integer that caches the row count for the last created object. More... | |
Private Attributes | |
| Impl_t | m_impl |
| Type_info_t::Table_t | m_table |
| Table object. More... | |
| int | m_cursor {0} |
| Current cursor position. More... | |
| Type_info_t::Row_proxy_t | m_row_proxy |
| Row proxy, containing a view over the current row. More... | |
| bool | m_cursor_dirty {true} |
| True if the cursor has moved away from the row that m_row_proxy refers to. More... | |
Class to aid implementing a table with cursor ( Is_table_with_cursor) where the table data is represented in a mysql::abi_helpers::Packet_array object.
| Impl_tp | Implementation capable of returning the name, definition, and data for the table. |
| using Packet_based_table_with_cursor< Impl_tp >::Impl_t = Impl_tp |
Type of the implementation.
| using Packet_based_table_with_cursor< Impl_tp >::Type_info_t = detail::Type_info_for_get_row_view_definition<Impl_t> |
Type of Row_view_definitions returned by the get_row_view_definition() member of Impl_t.
|
inline |
|
inline |
|
delete |
Delete copy/move semantics.
|
delete |
|
inline |
Move the cursor to next row.
|
inline |
Copy the value of the given field index to the given PSI_field object.
| index | The column number |
| field | The output PSI_field. |
|
inlinestatic |
Return the cached approximate row count.
|
inlinestaticprivate |
Return a reference to an atomic integer that caches the row count for the last created object.
(This could have been implemented as a static member variable. But that would be less convenient, since each specialization of this class template would have to provide a definition of the member variable in exactly one compilation unit. Using a function-local static variable, the variable gets automatically instantiated in each specialization of the function.)
|
inline |
Return the current cursor (row number).
|
inlinestatic |
Return the table definition.
|
inlinestatic |
Return the table name.
|
inline |
|
delete |
|
delete |
|
inline |
Move the cursor to the given row number.
|
private |
Current cursor position.
|
mutableprivate |
True if the cursor has moved away from the row that m_row_proxy refers to.
|
private |
|
mutableprivate |
Row proxy, containing a view over the current row.
This is capable of translating column index to an entry in the mysql::abi_helpers::Packet object for the current row, and of copying the value in that column to a PSI_field object.
Mutable, because it is updated lazily. The actual object state is represented by m_table and m_cursor.
|
private |
Table object.