COOLFluiD
Release kernel
COOLFluiD is a Collaborative Simulation Environment (CSE) focused on complex MultiPhysics simulations.
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
cf3
Tools
solver
Notifier.cpp
Go to the documentation of this file.
1
// Copyright (C) 2010-2013 von Karman Institute for Fluid Dynamics, Belgium
2
//
3
// This software is distributed under the terms of the
4
// GNU Lesser General Public License version 3 (LGPLv3).
5
// See doc/lgpl.txt and doc/gpl.txt for the license text.
6
7
#include "
common/PE/Manager.hpp
"
8
9
#include "
Tools/solver/Notifier.hpp
"
10
11
using namespace
cf3::common
;
12
14
15
namespace
cf3
{
16
namespace
Tools {
17
namespace
solver
{
18
20
21
Notifier::Notifier(
const
Handle<common::PE::Manager>
&
manager
)
22
: m_manager(manager)
23
{
24
cf3_assert
(
is_not_null
(manager) );
25
26
m_observed_queue
=
m_manager
->
notification_queue
();
27
}
28
30
31
Notifier::~Notifier
()
32
{
33
34
}
35
37
38
void
Notifier::listen_to_event
(
const
std::string &
name
,
bool
notifyOnce)
39
{
40
m_observed_queue
->
add_notifier
(name, &
Notifier::new_event
,
this
);
41
42
if
(notifyOnce)
43
m_once_notifying_events
[
name
] =
false
;
44
}
45
47
48
void
Notifier::begin_notify
()
49
{
50
std::map<std::string, bool>::iterator it =
m_once_notifying_events
.begin();
51
52
for
( ; it !=
m_once_notifying_events
.end() ; it++)
53
it->second =
false
;
54
}
55
57
58
void
Notifier::new_event
(
const
std::string &
name
,
SignalArgs
& args)
59
{
60
std::map<std::string, bool>::iterator it =
m_once_notifying_events
.find(name);
61
62
if
( it ==
m_once_notifying_events
.end() || !it->second )
63
{
64
event_occured
(name, args);
65
67
m_manager
->
new_event
(args);
68
69
if
(it !=
m_once_notifying_events
.end())
70
it->second =
true
;
71
}
72
}
73
75
76
}
// solver
77
}
// Tools
78
}
// cf3
cf3::python::name
std::string name(ComponentWrapper &self)
Definition:
ComponentWrapper.cpp:340
cf3::Tools::solver::Notifier::m_observed_queue
common::NotificationQueue * m_observed_queue
Definition:
Notifier.hpp:50
cf3::Handle< common::PE::Manager >
atest-boussinesq.solver
tuple solver
Definition:
atest-boussinesq.py:21
Manager.hpp
cf3_assert
#define cf3_assert(a)
Definition:
Assertions.hpp:93
cf3::common::PE::Manager::new_event
void new_event(SignalArgs &args)
Definition:
Manager.cpp:205
utest-math-variablemanager.manager
tuple manager
Definition:
utest-math-variablemanager.py:3
cf3::common::XML::SignalFrame
Manages a set of maps.
Definition:
SignalFrame.hpp:31
cf3::Tools::solver::Notifier::m_manager
Handle< common::PE::Manager > m_manager
Definition:
Notifier.hpp:54
cf3::Tools::solver::Notifier::event_occured
boost::signals2::signal< void(const std::string &, common::SignalArgs &) > event_occured
Definition:
Notifier.hpp:42
cf3::common::PE::Manager::notification_queue
common::NotificationQueue * notification_queue()
Definition:
Manager.hpp:59
cf3
Top-level namespace for coolfluid.
Definition:
Action.cpp:18
Notifier.hpp
cf3::Tools::solver::Notifier::new_event
void new_event(const std::string &name, common::SignalArgs &args)
Definition:
Notifier.cpp:58
cf3::common::NotificationQueue::add_notifier
void add_notifier(const std::string &name, void(NOTIFIER::*fcnt)(const std::string &, SignalArgs &args), NOTIFIER *receiver)
Adds a notifier.
cf3::Tools::solver::Notifier::begin_notify
void begin_notify()
Definition:
Notifier.cpp:48
cf3::Tools::solver::Notifier::listen_to_event
void listen_to_event(const std::string &name, bool notify_once)
Definition:
Notifier.cpp:38
cf3::Tools::solver::Notifier::~Notifier
~Notifier()
Definition:
Notifier.cpp:31
cf3::Tools::solver::Notifier::m_once_notifying_events
std::map< std::string, bool > m_once_notifying_events
Definition:
Notifier.hpp:52
cf3::common
Most basic kernel library.
Definition:
Action.cpp:19
cf3::is_not_null
bool is_not_null(T ptr)
predicate for comparison to nullptr
Definition:
CF.hpp:147
Generated on Sun Jun 14 2015 21:20:14 for COOLFluiD by
1.8.9.1
Send comments to:
COOLFluiD Web Admin