diff --git a/include/aidge/data/Database.hpp b/include/aidge/data/Database.hpp index 96292f242c801a28ea100120703467b0c1f255ab..04aa008a1d0f850e1a18e965fd107391723ce25c 100644 --- a/include/aidge/data/Database.hpp +++ b/include/aidge/data/Database.hpp @@ -2,40 +2,38 @@ #define Database_H_ #include <cstring> +#include <memory> +#include <vector> +#include <tuple> #include "aidge/data/Tensor.hpp" -namespace Aidge{ +namespace Aidge { /** - * @brief Database. An abstract class representing a database. All databases should inherit from this class. All subclasses should overwrite :cpp:function:`Database::get_item` to fetch data from a given index. - * @todo Make the dataset generic. Always ground truth. + * @brief Database. An abstract class representing a map from a key to data. All databases should inherit from this class. All subclasses should overwrite :cpp:function:`Database::getItem` to fetch data from a given index. */ class Database { public: - + Database() = default; virtual ~Database() = default; /** - * @brief Fetch a data sample and its corresponding ground_truth - * @param index index of the pair (```data```, ```ground truth```) to fetch from the database - * @return A pair of pointers to the data (first) and its corresping ground truth (second) + * @brief Fetch an item of the database. + * @param index index of the item. + * @return vector of data mapped to index. */ - virtual std::pair<std::shared_ptr<Tensor>,std::shared_ptr<Tensor>> get_item(unsigned int index) = 0; + virtual std::vector<std::shared_ptr<Tensor>> getItem(std::size_t index) = 0; - /** - * @return The number of data samples in the database. + /** + * @brief Get the number of items in the database + * + * @return std::size_t */ - virtual unsigned int get_len() = 0; - -protected: - - std::vector<std::shared_ptr<Tensor>> mData; - std::vector<std::shared_ptr<Tensor>> mLabel; + virtual std::size_t getLen() = 0; }; - -} +} // namespace Aidge #endif /* Database_H_ */ \ No newline at end of file