mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-23 00:02:38 -05:00
Added a minor update to the untwine_to_qgis.bash script as it was getting confused about the "untwine" subfolders and copying sources one level deeper as supposed to
45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
/*****************************************************************************
|
|
* Copyright (c) 2020, Hobu, Inc. (info@hobu.co) *
|
|
* *
|
|
* All rights reserved. *
|
|
* *
|
|
* This program 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. *
|
|
* *
|
|
****************************************************************************/
|
|
|
|
|
|
#pragma once
|
|
|
|
#include <deque>
|
|
#include <mutex>
|
|
#include <condition_variable>
|
|
|
|
#include "EpfTypes.hpp"
|
|
|
|
namespace untwine
|
|
{
|
|
namespace epf
|
|
{
|
|
|
|
// This is simply a cache of data buffers to avoid continuous allocation and deallocation.
|
|
class BufferCache
|
|
{
|
|
public:
|
|
BufferCache() : m_count(0)
|
|
{}
|
|
|
|
DataVecPtr fetch(std::unique_lock<std::mutex>& lock, bool nonblock);
|
|
void replace(DataVecPtr&& buf);
|
|
|
|
private:
|
|
std::deque<DataVecPtr> m_buffers;
|
|
std::condition_variable m_cv;
|
|
int m_count;
|
|
};
|
|
|
|
} // namespace epf
|
|
} // namespace untwine
|