KiCad PCB EDA Suite
Loading...
Searching...
No Matches
model_import_queue.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or (at your option)
9 * any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/old-licenses/gpl-3.0.html
19 */
20
21#ifndef MODEL_IMPORT_QUEUE_H
22#define MODEL_IMPORT_QUEUE_H
23
24#include <cstdint>
25#include <functional>
26#include <memory>
27#include <string>
28
30
31namespace S3D
32{
44{
45public:
46 using COMPLETION = std::function<void( std::uint64_t aGeneration, MODEL_IMPORT_RESULT aResult )>;
47
50
53
59 std::uint64_t Submit( std::string aFileName, const MODEL_IMPORT_OPTIONS& aOptions, COMPLETION aCompletion );
60
64 void Cancel();
65
70 void Shutdown();
71
75 std::uint64_t CurrentGeneration() const;
76
77private:
78 struct STATE;
79
80 std::shared_ptr<STATE> m_state;
81};
82} // namespace S3D
83
84#endif // MODEL_IMPORT_QUEUE_H
void Cancel()
Abandon the pending and running requests without stopping the worker.
std::function< void(std::uint64_t aGeneration, MODEL_IMPORT_RESULT aResult)> COMPLETION
MODEL_IMPORT_QUEUE & operator=(const MODEL_IMPORT_QUEUE &)=delete
void Shutdown()
Abandon everything and join the worker.
std::uint64_t Submit(std::string aFileName, const MODEL_IMPORT_OPTIONS &aOptions, COMPLETION aCompletion)
Supersede any pending or running request with aFileName.
MODEL_IMPORT_QUEUE(const MODEL_IMPORT_QUEUE &)=delete
std::uint64_t CurrentGeneration() const
The generation of the most recent Submit(), for hosts that track staleness themselves.
std::shared_ptr< STATE > m_state
#define KICAD_3D_IMPORT_API