Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Meet the coding style (line length <= 100)
[modules/shaper.git]
/
src
/
Events
/
Events_LongOp.cpp
diff --git
a/src/Events/Events_LongOp.cpp
b/src/Events/Events_LongOp.cpp
index ebfeb5677f764ef9826d85d8e4d68c6cfa639389..f298a9ae547692888ab43758c5b2379324c57616 100644
(file)
--- a/
src/Events/Events_LongOp.cpp
+++ b/
src/Events/Events_LongOp.cpp
@@
-1,3
+1,5
@@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
// File: Events_LongOp.cpp
// Created: 29 Jul 2014
// Author: Mikhail PONIKAROV
// File: Events_LongOp.cpp
// Created: 29 Jul 2014
// Author: Mikhail PONIKAROV
@@
-10,7
+12,7
@@
std::map<void*, int> MY_SENDERS;
Events_LongOp::Events_LongOp(void* theSender)
std::map<void*, int> MY_SENDERS;
Events_LongOp::Events_LongOp(void* theSender)
-
: Events_Message(Events_LongOp::error
ID(), theSender)
+
: Events_Message(Events_LongOp::event
ID(), theSender)
{
}
{
}
@@
-18,7
+20,7
@@
Events_LongOp::~Events_LongOp()
{
}
{
}
-Events_ID Events_LongOp::e
rror
ID()
+Events_ID Events_LongOp::e
vent
ID()
{
Events_Loop* aLoop = Events_Loop::loop();
return aLoop->eventByName("LongOperation");
{
Events_Loop* aLoop = Events_Loop::loop();
return aLoop->eventByName("LongOperation");
@@
-26,26
+28,32
@@
Events_ID Events_LongOp::errorID()
void Events_LongOp::start(void* theSender)
{
void Events_LongOp::start(void* theSender)
{
- if (MY_SENDERS.empty()) {
- Events_LongOp anError(theSender);
- Events_Loop::loop()->send(anError);
- }
+ bool toSend = MY_SENDERS.empty();
if (MY_SENDERS.find(theSender) == MY_SENDERS.end())
MY_SENDERS[theSender] = 1;
if (MY_SENDERS.find(theSender) == MY_SENDERS.end())
MY_SENDERS[theSender] = 1;
- else
+ else
MY_SENDERS[theSender]++;
MY_SENDERS[theSender]++;
+
+ if (toSend) {
+ std::shared_ptr<Events_Message> aNewOne =
+ std::shared_ptr<Events_Message>(new Events_LongOp(theSender));
+ Events_Loop::loop()->send(aNewOne);
+ }
}
void Events_LongOp::end(void* theSender)
{
if (MY_SENDERS.find(theSender) != MY_SENDERS.end()) {
int aCount = MY_SENDERS[theSender];
}
void Events_LongOp::end(void* theSender)
{
if (MY_SENDERS.find(theSender) != MY_SENDERS.end()) {
int aCount = MY_SENDERS[theSender];
- if (aCount <= 1) MY_SENDERS.erase(theSender);
- else MY_SENDERS[theSender] = aCount - 1;
+ if (aCount <= 1)
+ MY_SENDERS.erase(theSender);
+ else
+ MY_SENDERS[theSender] = aCount - 1;
}
if (MY_SENDERS.empty()) {
}
if (MY_SENDERS.empty()) {
- Events_LongOp anError(theSender);
- Events_Loop::loop()->send(anError);
+ std::shared_ptr<Events_Message> aNewOne =
+ std::shared_ptr<Events_Message>(new Events_LongOp(theSender));
+ Events_Loop::loop()->send(aNewOne);
}
}
}
}