Program Listing for File format_implementation.h
↰ Return to documentation for file (src/sparsebase/format/format_implementation.h
)
#include "sparsebase/format/format.h"
#ifndef SPARSEBASE_PROJECT_FORMAT_IMPLEMENTATION_H
#define SPARSEBASE_PROJECT_FORMAT_IMPLEMENTATION_H
namespace sparsebase::format {
class FormatImplementation : public Format {
public:
virtual std::vector<DimensionType> get_dimensions() const {
return this->dimension_;
}
virtual DimensionType get_num_nnz() const { return this->nnz_; }
virtual DimensionType get_order() const { return this->order_; }
virtual context::Context *get_context() const {
return this->context_.get().get();
}
virtual std::type_index get_id() const {
return this->context_.get()->get_id();
}
virtual std::shared_ptr<converter::Converter const> get_converter() const {
return this->converter_;
// return
// std::dynamic_pointer_cast<converter::Converter>(this->converter_).get();
};
void set_converter(std::shared_ptr<converter::Converter> converter) {
this->converter_ = converter;
};
protected:
DimensionType order_;
std::vector<DimensionType> dimension_;
DimensionType nnz_;
utils::OnceSettable<std::unique_ptr<sparsebase::context::Context>> context_;
std::shared_ptr<converter::Converter> converter_;
};
} // namespace sparsebase::format
#endif // SPARSEBASE_PROJECT_FORMAT_IMPLEMENTATION_H