.. _program_listing_file_src_sparsebase_object_object.h: Program Listing for File object.h ================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/sparsebase/object/object.h``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /******************************************************* * Copyright (c) 2022 SparCity, Amro Alabsi Aljundi, Taha Atahan Akyildiz, Arda *Sener All rights reserved. * * This file is distributed under MIT license. * The complete license agreement can be obtained at: * https://sparcityeu.github.io/sparsebase/pages/license.html ********************************************************/ #ifndef SPARSEBASE_SPARSEBASE_OBJECT_OBJECT_H_ #define SPARSEBASE_SPARSEBASE_OBJECT_OBJECT_H_ #include #include #include "sparsebase/config.h" #include "sparsebase/format/format.h" #include "sparsebase/format/format_order_one.h" #include "sparsebase/format/format_order_two.h" #include "sparsebase/io/reader.h" namespace sparsebase { namespace object { class Object { public: virtual ~Object(); virtual void VerifyStructure() = 0; }; template class AbstractObject : public Object { protected: std::unique_ptr> connectivity_; public: virtual ~AbstractObject(); AbstractObject(); AbstractObject(const AbstractObject &); AbstractObject(AbstractObject &&); format::Format *get_connectivity() const; format::Format *release_connectivity(); void set_connectivity(format::Format *, bool); bool ConnectivityIsOwned() const; }; template class Graph : public AbstractObject { public: Graph(format::Format *connectivity); Graph(); Graph(const Graph &); Graph(Graph &&); Graph &operator=( const Graph &); void ReadConnectivityToCSR(const io::ReadsCSR &); void ReadConnectivityToCOO(const io::ReadsCOO &); void ReadConnectivityFromMTXToCOO(std::string filename); void ReadConnectivityFromEdgelistToCSR(std::string filename); void InitializeInfoFromConnection(); virtual ~Graph(); void VerifyStructure(); VertexID n_; NumEdges m_; }; // template // class TemporalGraph : public AbstractSparseObject{ // public: // TemporalGraph(SparseFormat * _connectivity){ // // init temporal graph // } // TemporalGraph(Reader * r){ // // init temporal graph from file // } // virtual ~TemporalGraph(){}; // void VerifyStructure(){ // // check order // if (this->connectivity->get_order() != 2) //throw error // // check dimensions // } // VertexID n; // NumEdges m; // // ... // }; } // namespace object } // namespace sparsebase #ifdef _HEADER_ONLY #include "sparsebase/object/object.cc" #endif #endif // SPARSEBASE_SPARSEBASE_OBJECT_OBJECT_H_