Commit e9e5d6b8 authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

Add a pagination API

parent 3931dc44
......@@ -37,6 +37,7 @@ libmedialibrary_la_HEADERS = \
include/medialibrary/Types.h \
include/medialibrary/IDeviceLister.h \
include/medialibrary/IFolder.h \
include/medialibrary/IQuery.h \
$(NULL)
libmedialibrary_la_SOURCES = \
......
/*****************************************************************************
* Media Library
*****************************************************************************
* Copyright (C) 2015 Hugo Beauzée-Luyssen, Videolabs
*
* Authors: Hugo Beauzée-Luyssen<hugo@beauzee.fr>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#pragma once
#include <vector>
#include <memory>
namespace medialibrary
{
template <typename T>
class IQuery
{
public:
using Result = std::vector<std::shared_ptr<T>>;
virtual ~IQuery() = default;
virtual size_t count() = 0;
virtual Result items( uint32_t nbItems, uint32_t offset ) = 0;
virtual Result all() = 0;
};
template <typename T>
using Query = std::unique_ptr<IQuery<T>>;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment