a Code for the Combination of Indirect and Direct Constraints on High Energy Physics Models Logo
PushedToObserver.hpp
Go to the documentation of this file.
1/*
2 * PushedToObserver.hpp
3 *
4 * Created on: Mar 4, 2012
5 * Author: Ben O'Leary (benjamin.oleary@gmail.com)
6 *
7 * This file is part of BOLlib, released under the
8 * GNU General Public License. Please see the accompanying
9 * README.BOLlib.txt file for a full list of files, brief documentation
10 * on how to use these classes, and further details on the license.
11 */
12
13#ifndef PUSHEDTOOBSERVER_HPP_
14#define PUSHEDTOOBSERVER_HPP_
15
16#include <list>
17#include "BasicObserver.hpp"
18
19namespace BOL
20{
21 // this is a template class for observers which get PushedClass references
22 // pushed to them with their observed subject's updates.
23 template< typename PushedClass >
25 {
26 public:
28 virtual
30
31 virtual void
33 // by default, PushedToObserver instances don't respond without a pushed
34 // value, but this can be over-ridden if it would be useful.
35 virtual void
36 respondToPush( PushedClass const& pushedValue ) = 0;
37 };
38
39
40
41
42
43 template< typename PushedClass >
44 inline
47 {
48 // just an initialization list.
49 }
50
51 template< typename PushedClass >
52 inline
54 {
55 // does nothing.
56 }
57
58
59 template< typename PushedClass >
60 inline void
62 // by default, PushedToObserver instances don't respond without a pushed
63 // value, but this can be over-ridden if it would be useful.
64 {
65 // does nothing.
66 }
67
68}
69
70#endif /* PUSHEDTOOBSERVER_HPP_ */
virtual void respondToObservedSignal()
virtual void respondToPush(PushedClass const &pushedValue)=0