DoorKeeper/include/doorkeeper/implem/iterableviewport.hpp

51 lines
1.5 KiB
C++
Raw Normal View History

2015-08-31 15:11:11 +00:00
/* Copyright 2015, Michele Santullo
* This file is part of DoorKeeper.
*
* DoorKeeper is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DoorKeeper 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with DoorKeeper. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef idD358B9737CC045D3B35F2B5C2FCF84FA
#define idD358B9737CC045D3B35F2B5C2FCF84FA
#include "doorkeeper/components/viewport.hpp"
#include <cstdint>
namespace dk {
template <uint32_t D>
class LayerBase;
template <uint32_t D>
class IterableViewport {
public:
typedef typename Viewport<D>::const_iterator const_iterator;
IterableViewport ( const Viewport<D>* parViewport, const LayerBase<D>* parLayerBase ) :
m_viewport(parViewport),
m_layer(parLayerBase)
{
DK_ASSERT(m_viewport);
DK_ASSERT(m_layer);
}
const_iterator begin ( void ) const { return m_viewport->begin(m_layer); }
const_iterator end ( void ) const { return m_viewport->end(m_layer); }
private:
const Viewport<D>* const m_viewport;
const LayerBase<D>* const m_layer;
};
} //namespace dk
#endif