TableDebugView.cpp
Go to the documentation of this file.
1 #include "TableDebugView.hpp"
2 #include <algorithm>
3 
4 namespace iv
5 {
6 
7 using namespace table_debug_context;
8 
9 //---------------------------------- TableId -------------------------------------------------------
10 RuntimeIdDictionary TableId::Dictionary;
11 
12 //---------------------------------- TableDebugView ---------------------------------------------
14  DebugView( context )
15 {
16 }
17 
19 {
20  return TableHandle( this, table_id );
21 }
22 
24 {
25  return this->tables.empty();
26 }
27 
29 {
30  this->tables.clear();
31 }
32 
33 std::unordered_map< TableId, TableData > const & TableDebugView::Tables() const
34 {
35  return this->tables;
36 }
37 
38 std::unordered_map< TableId, TableData > & TableDebugView::Tables()
39 {
40  return this->tables;
41 }
42 
43 namespace table_debug_context
44 {
45 
46 //---------------------------------- TableHandle ---------------------------------------------------
48  _table( &context->Tables()[ table_id ] )
49 {
50 }
51 
52 RowHandle TableHandle::Row( std::any const & row_id )
53 {
54  return RowHandle( this->_table, row_id );
55 }
56 
57 //---------------------------------- RowHandle -----------------------------------------------------
58 RowHandle::RowHandle( TableData * _table, std::any const & row_id )
59 {
60  _table->rows.push_back( RowData() );
61  this->_row = &_table->rows[ _table->rows.size() - 1 ];
62  this->_row->identity = row_id;
63 }
64 
65 }
66 
67 }