VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtSubjectObserver.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
14 
15 #include <vrvUtil/templateUtil.h>
17 
18 #include <boost/signal.hpp>
19 #include <boost/bind.hpp>
20 
21 namespace makVrv
22 {
23 
28  template<class T>
29  class DtSubjectObserver : public virtual DtSubjectBinder
30  {
31 
32  public:
33 
39 
40  virtual ~DtSubjectObserver();
41 
42  virtual void slot_activate(T* subject) = 0;
43 
44  virtual void slot_deactivate(T* subject) = 0;
45 
46  protected:
47 
48  virtual void connect(DtDe& de);
49 
51 
52  };
53 
54  template<class T>
56  {
59 
60  myBindFunctionList.push_back(functor);
61  }
62 
63  template<class T>
65  {
66 
67  }
68 
69  template<class T>
71  {
76 
77  if(announcer)
78  {
80  mySignalConnectionManager += announcer->signal_activate.connect(
82 
84  // w/ each activated subject instance.
85  typename std::list<T*>::iterator curIter = announcer->activatedList().begin();
86  typename std::list<T*>::iterator endIter = announcer->activatedList().end();
87  for(;curIter != endIter; ++curIter)
88  {
89  this->slot_activate(*curIter);
90  }
91  }
92  }
93 
97 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)