GteGraphicsObject.cpp
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #include <GTEnginePCH.h>
10 using namespace gte;
11 
13 {
14  msLFDMutex.lock();
15  {
16  for (auto listener : msLFDSet)
17  {
18  listener->OnDestroy(this);
19  }
20  }
21  msLFDMutex.unlock();
22 }
23 
25  :
27 {
28 }
29 
30 void GraphicsObject::SubscribeForDestruction(std::shared_ptr<ListenerForDestruction> const& listener)
31 {
32  msLFDMutex.lock();
33  {
34  msLFDSet.insert(listener);
35  }
36  msLFDMutex.unlock();
37 }
38 
39 void GraphicsObject::UnsubscribeForDestruction(std::shared_ptr<ListenerForDestruction> const& listener)
40 {
41  msLFDMutex.lock();
42  {
43  msLFDSet.erase(listener);
44  }
45  msLFDMutex.unlock();
46 }
47 
48 
50 std::set<std::shared_ptr<GraphicsObject::ListenerForDestruction>> GraphicsObject::msLFDSet;
GraphicsObjectType mType
static std::mutex msLFDMutex
static void SubscribeForDestruction(std::shared_ptr< ListenerForDestruction > const &listener)
static void UnsubscribeForDestruction(std::shared_ptr< ListenerForDestruction > const &listener)
static std::set< std::shared_ptr< ListenerForDestruction > > msLFDSet
GT_GRAPHICS_OBJECT


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:00