00001
00010 #ifndef PY_BS_TABLE_2D_H_
00011 #define PY_BS_TABLE_2D_H_
00012
00013 #ifdef _DEBUG
00014
00015 #include "table_2d.h"
00016
00017 namespace blue_sky
00018 {
00019 namespace python
00020 {
00021
00022 template <typename strategy_t>
00023 class py_data_row
00024 {
00025 public:
00026 typedef table::data_row<strategy_t> data_row_t;
00027
00028 py_data_row ()
00029 {
00030
00031 }
00032
00033 py_data_row (const data_row_t &r)
00034 : row (r)
00035 {
00036
00037 }
00038
00039 typename strategy_t::item_t get (int column_index) const
00040 {
00041 return row[column_index];
00042 }
00043
00044 private:
00045
00046 data_row_t row;
00047
00048 };
00049
00050 template <typename strategy_t>
00051 class py_data_group
00052 {
00053 public:
00054 typedef table::data_group<strategy_t> data_group_t;
00055
00056 py_data_group ()
00057 : group (0, 0, 0)
00058 {
00059
00060 }
00061
00062 py_data_group (const data_group_t &g)
00063 : group (g)
00064 {
00065
00066 }
00067
00068 int get_rows_count () const
00069 {
00070 return group.get_rows_count ();
00071 }
00072 int get_columns_count () const
00073 {
00074 return group.get_columns_count ();
00075 }
00076
00077 py_data_row<strategy_t> get_row (int row_index) const
00078 {
00079 return py_data_row<strategy_t> (group.get_row (row_index));
00080 }
00081
00082 private:
00083
00084
00085 data_group_t group;
00086
00087 };
00088
00089 template <typename strategy_t>
00090 class py_table_2d
00091 {
00092 public:
00093 typedef table::table_2d<strategy_t> table_2d_t;
00094
00095 py_table_2d ()
00096 : data (0)
00097 {
00098
00099 }
00100
00101 py_table_2d (const table_2d_t &d)
00102 : data (d)
00103 {
00104
00105 }
00106
00107 int get_groups_count () const
00108 {
00109 return data.get_groups_count ();
00110 }
00111
00112 py_data_group<strategy_t> get_data_group (int group_index)
00113 {
00114 return py_data_group<strategy_t> (data.get_data_group (group_index));
00115 }
00116
00117 private:
00118
00119 table_2d_t data;
00120
00121 };
00122
00123 void
00124 py_export_table_2d ();
00125
00126
00127 }
00128 }
00129
00130
00131 #endif // #ifdef _DEBUG
00132
00133
00134 #endif // #ifdef PY_BS_TABLE_2D_H_