shared_gc_data.h
1/*
2** ClanLib SDK
3** Copyright (c) 1997-2020 The ClanLib Team
4**
5** This software is provided 'as-is', without any express or implied
6** warranty. In no event will the authors be held liable for any damages
7** arising from the use of this software.
8**
9** Permission is granted to anyone to use this software for any purpose,
10** including commercial applications, and to alter it and redistribute it
11** freely, subject to the following restrictions:
12**
13** 1. The origin of this software must not be misrepresented; you must not
14** claim that you wrote the original software. If you use this software
15** in a product, an acknowledgment in the product documentation would be
16** appreciated but is not required.
17** 2. Altered source versions must be plainly marked as such, and must not be
18** misrepresented as being the original software.
19** 3. This notice may not be removed or altered from any source distribution.
20**
21** Note: Some of the libraries ClanLib may link to may have additional
22** requirements or restrictions.
23**
24** File Author(s):
25**
26** Magnus Norddahl
27** Harry Storbacka
28** Mark Page
29*/
30
31#pragma once
32
33#include <vector>
34#include <memory>
35#include <mutex>
36
37namespace clan
38{
41
42 class GraphicContext;
43 class GraphicContextProvider;
44 class DisposableObject;
45 class SharedGCData_Impl;
46
49 {
50 public:
52 static void add_ref();
53
55 static void release_ref();
56
58 static void add_provider(GraphicContextProvider *provider);
59
62
68 static GraphicContextProvider *get_provider(std::unique_ptr<std::unique_lock<std::recursive_mutex>> &mutex_section);
69
75 static std::vector<GraphicContextProvider*> &get_gc_providers(std::unique_ptr<std::unique_lock<std::recursive_mutex>> &mutex_section);
76
80 static void add_disposable(DisposableObject *disposable);
81
85 static void remove_disposable(DisposableObject *disposable);
86
87 private:
90
91 std::shared_ptr<SharedGCData_Impl> impl;
92 };
93
95}
DisposableObject.
Definition disposable_object.h:35
Interface for implementing a GraphicContext target.
Definition graphic_context_provider.h:86
Shared Graphic Context Data.
Definition shared_gc_data.h:49
static void add_provider(GraphicContextProvider *provider)
Add a provider.
static void remove_disposable(DisposableObject *disposable)
Remove disposable.
static std::vector< GraphicContextProvider * > & get_gc_providers(std::unique_ptr< std::unique_lock< std::recursive_mutex > > &mutex_section)
Get the providers.
static void add_disposable(DisposableObject *disposable)
Add disposable.
static void add_ref()
Add ref.
static void release_ref()
Release ref.
static void remove_provider(GraphicContextProvider *provider)
Remove a provider.
static GraphicContextProvider * get_provider(std::unique_ptr< std::unique_lock< std::recursive_mutex > > &mutex_section)
Get a provider.
Definition clanapp.h:36