Debian Codegraph @

modules/lsp-r3d-iface/include/lsp-plug.in/r3d/iface/factory.h

raw
1 /*
2 * Copyright (C) 2020 Linux Studio Plugins Project <https://lsp-plug.in/>
3 * (C) 2020 Vladimir Sadovnikov <[email protected]>
4 *
5 * This file is part of lsp-r3d-iface
6 * Created on: 24 апр. 2019 г.
7 *
8 * lsp-r3d-iface is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * any later version.
12 *
13 * lsp-r3d-iface is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with lsp-r3d-iface. If not, see <https://www.gnu.org/licenses/>.
20 */
21
22 #ifndef LSP_PLUG_IN_R3D_IFACE_FACTORY_H_
23 #define LSP_PLUG_IN_R3D_IFACE_FACTORY_H_
24
25 #include <lsp-plug.in/r3d/iface/version.h>
26
27 #include <lsp-plug.in/r3d/iface/backend.h>
28 #include <lsp-plug.in/r3d/iface/types.h>
29
30 #define LSP_R3D_FACTORY_FUNCTION_NAME "lsp_r3d_factory"
31 #define LSP_R3D_FACTORY_FUNCTION_HEADER(index) ::lsp::r3d::factory_t *lsp_r3d_factory(int index)
32
33 namespace lsp
34 {
35 namespace r3d
36 {
37 /**
38 * Factory for obtaining 3D rendering backend metadata and
39 * constructing 3D backend instance
40 */
41 typedef struct factory_t
42 {
43 /**
44 * Get backend metadata
45 * @param id backend identifier, starting with 0
46 * @return status of operation or NULL if there is no such backend
47 */
48 const backend_metadata_t *(* metadata)(factory_t *_this, size_t id);
49
50 /**
51 * Create backend
52 * @param id backend identifier
53 * @return status of operation
54 */
55 backend_t *(* create)(factory_t *_this, size_t id);
56
57 } factory_t;
58
59 /**
60 * Factory function prototype
61 * @param index the enumeration factory number starting with 0
62 * @return pointer to the factory function or NULL if there are no more items in enumeration
63 */
64 typedef factory_t *(* factory_function_t)(int index);
65 }
66 }
67
68 #endif /* LSP_PLUG_IN_R3D_IFACE_FACTORY_H_ */