/* * (C) Copyright 2013 ECMWF. * * This software is licensed under the terms of the Apache Licence Version 2.0 * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. * In applying this licence, ECMWF does not waive the privileges and immunities * granted to it by virtue of its status as an intergovernmental organisation * nor does it submit to any jurisdiction. */ #include "atlas/array/TableView.h" namespace atlas { namespace array { // ---------------------------------------------------------------------------- template TableView::TableView(const Table& table, bool host): host_(host), missing_value_(table.missing_value()), rows_(table.rows()), maxcols_(table.maxcols()), mincols_(table.mincols()), values_(host_ ? make_host_view(*(table.data_[_values_])) : make_device_view(*(table.data_[_values_]))), displs_(host_ ? make_host_view(*(table.data_[_displs_])) : make_device_view(*(table.data_[_displs_]))), counts_(host_ ? make_host_view(*(table.data_[_counts_])) : make_device_view(*(table.data_[_counts_]))), const_access_(this), access_(this) {} // ---------------------------------------------------------------------------- template TableView::TableView(const TableView& other): host_(other.host_), missing_value_(other.missing_value_), rows_(other.rows_), maxcols_(other.maxcols_), mincols_(other.mincols_), values_(other.values_), displs_(other.displs_), counts_(other.counts_), const_access_(this), access_(this) {} // ---------------------------------------------------------------------------- template TableView TableView::operator=(const TableView& other) { host_ = other.host_; missing_value_ = other.missing_value_; rows_ = other.rows_; maxcols_ = other.maxcols_; mincols_ = other.mincols_; values_ = other.values_; displs_ = other.displs_; counts_ = other.counts_; return *this; } // ---------------------------------------------------------------------------- template TableView make_table_view(const Table& table) { return TableView(table); } // ---------------------------------------------------------------------------- template class TableView; template class TableView; template TableView make_table_view(const Table&); template TableView make_table_view(const Table&); // ---------------------------------------------------------------------------- } // namespace array } // namespace atlas