shared_gc_data.h
1 /*
2 ** ClanLib SDK
3 ** Copyright (c) 1997-2013 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 
32 #pragma once
33 
34 #include "../api_display.h"
35 #include "../../Core/Signals/signal_v0.h"
36 #include "texture.h"
37 #include "../Image/image_import_description.h"
38 #include <vector>
39 #include <map>
40 
41 namespace clan
42 {
45 
46 class GraphicContext;
47 class DisposableObject;
48 class SharedGCData_Impl;
49 class MutexSection;
50 
53 {
54 public:
55 
57  static void add_ref();
58 
60  static void release_ref();
61 
63  static void add_provider(GraphicContextProvider *provider);
64 
66  static void remove_provider(GraphicContextProvider *provider);
67 
73  static GraphicContextProvider *get_provider(std::unique_ptr<MutexSection> &mutex_section);
74 
80  static std::vector<GraphicContextProvider*> &get_gc_providers(std::unique_ptr<MutexSection> &mutex_section);
81 
85  static void add_disposable(DisposableObject *disposable);
86 
90  static void remove_disposable(DisposableObject *disposable);
91 
92 private:
93  SharedGCData();
94  ~SharedGCData();
95 
96  std::shared_ptr<SharedGCData_Impl> impl;
97 };
98 
99 }
100 
102 
static void remove_disposable(DisposableObject *disposable)
Remove disposable.
DisposableObject.
Definition: disposable_object.h:37
Shared Graphic Context Data.
Definition: shared_gc_data.h:52
static GraphicContextProvider * get_provider(std::unique_ptr< MutexSection > &mutex_section)
Get a provider.
Interface for implementing a GraphicContext target.
Definition: graphic_context_provider.h:87
static void add_disposable(DisposableObject *disposable)
Add disposable.
static std::vector< GraphicContextProvider * > & get_gc_providers(std::unique_ptr< MutexSection > &mutex_section)
Get the providers.
static void add_provider(GraphicContextProvider *provider)
Add a provider.
static void release_ref()
Release ref.
static void remove_provider(GraphicContextProvider *provider)
Remove a provider.
static void add_ref()
Add ref.