VR-Forces 4.3.1 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 
12 #include <vrvCore/vrvCore.h>
13 #include <vrvCore/DtDe.h>
16 
17 #include <vrvUtil/templateUtil.h>
18 
19 #include <boost/signal.hpp>
20 #include <boost/bind.hpp>
21 
22 namespace makVrv
23 {
24 
29  template<class T>
30  class DtSubjectObserver : public virtual DtSubjectBinder
31  {
32 
33  public:
34 
40 
41  virtual ~DtSubjectObserver();
42 
43  virtual void slot_activate(T* subject) = 0;
44 
45  virtual void slot_deactivate(T* subject) = 0;
46 
47  protected:
48 
49  virtual void connect(DtDe& de);
50 
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  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 Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)