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

Document ID: Generated on Thu Mar 23 18:54:12 EDT 2017 from SVN revision 174804
Copyright © 2005-2017 VT MÄK. All Rights Reserved (www.mak.com)