A
lgorithmique
N
umérique
D
istribuée
Public GIT Repository
projects
/
simgrid.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add "const" to some getters of Activities.
[simgrid.git]
/
src
/
s4u
/
s4u_Comm.cpp
diff --git
a/src/s4u/s4u_Comm.cpp
b/src/s4u/s4u_Comm.cpp
index
4391ce0
..
b088052
100644
(file)
--- a/
src/s4u/s4u_Comm.cpp
+++ b/
src/s4u/s4u_Comm.cpp
@@
-97,7
+97,7
@@
CommPtr Comm::set_dst_data(void** buff)
return this;
}
return this;
}
-size_t Comm::get_dst_data_size()
+size_t Comm::get_dst_data_size()
const
{
xbt_assert(state_ == State::FINISHED, "You cannot use %s before your communication terminated", __FUNCTION__);
return dst_buff_size_;
{
xbt_assert(state_ == State::FINISHED, "You cannot use %s before your communication terminated", __FUNCTION__);
return dst_buff_size_;
@@
-177,7
+177,7
@@
Comm* Comm::wait_for(double timeout)
break;
case State::STARTED:
break;
case State::STARTED:
- simcall_comm_wait(
pimpl_
, timeout);
+ simcall_comm_wait(
get_impl()
, timeout);
on_completion(*Actor::self());
state_ = State::FINISHED;
this->release_dependencies();
on_completion(*Actor::self());
state_ = State::FINISHED;
this->release_dependencies();
@@
-233,7
+233,7
@@
bool Comm::test()
if (state_ == State::INITED || state_ == State::STARTING)
this->vetoable_start();
if (state_ == State::INITED || state_ == State::STARTING)
this->vetoable_start();
- if (simcall_comm_test(
pimpl_
)) {
+ if (simcall_comm_test(
get_impl()
)) {
state_ = State::FINISHED;
this->release_dependencies();
return true;
state_ = State::FINISHED;
this->release_dependencies();
return true;
@@
-241,12
+241,12
@@
bool Comm::test()
return false;
}
return false;
}
-Mailbox* Comm::get_mailbox()
+Mailbox* Comm::get_mailbox()
const
{
return mailbox_;
}
{
return mailbox_;
}
-Actor* Comm::get_sender()
+Actor* Comm::get_sender()
const
{
return sender_ ? sender_->ciface() : nullptr;
}
{
return sender_ ? sender_->ciface() : nullptr;
}
@@
-254,16
+254,18
@@
Actor* Comm::get_sender()
} // namespace s4u
} // namespace simgrid
/* **************************** Public C interface *************************** */
} // namespace s4u
} // namespace simgrid
/* **************************** Public C interface *************************** */
-int sg_comm_wait_any_for(const xbt_dynar_t comms, double timeout)
+int sg_comm_wait_any(sg_comm_t* comms, size_t count)
+{
+ return sg_comm_wait_any_for(comms, count, -1);
+}
+int sg_comm_wait_any_for(sg_comm_t* comms, size_t count, double timeout)
{
std::vector<simgrid::s4u::CommPtr> s4u_comms;
{
std::vector<simgrid::s4u::CommPtr> s4u_comms;
- unsigned int i;
- sg_comm_t comm;
- xbt_dynar_foreach (comms, i, comm) {
- s4u_comms.emplace_back(comm);
+ for (unsigned int i = 0; i < count; i++) {
+ s4u_comms.emplace_back(comms[i]);
}
int pos = simgrid::s4u::Comm::wait_any_for(&s4u_comms, timeout);
if (pos != -1)
}
int pos = simgrid::s4u::Comm::wait_any_for(&s4u_comms, timeout);
if (pos != -1)
-
intrusive_ptr_release(xbt_dynar_get_as(comms, pos, sg_comm_t)
);
+
s4u_comms[pos]->unref(
);
return pos;
}
return pos;
}