Commit 9ae5baaa authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas
Browse files

fix put & set

parent 8988f7dc
......@@ -76,7 +76,7 @@ qlonglong dtkDistributedCommunicator::allocate(qlonglong count, qlonglong size,
void dtkDistributedCommunicator::get(qint32 from, qlonglong position, void *array, qlonglong buffer_id)
{
}
QByteArray dtkDistributedCommunicator::get(qint32 from, qlonglong position, qlonglong size, qlonglong buffer_id)
......@@ -84,7 +84,7 @@ QByteArray dtkDistributedCommunicator::get(qint32 from, qlonglong position, qlon
return QByteArray();
}
void dtkDistributedCommunicator::put(qint32 dest, qlonglong position, qlonglong size, const QByteArray &data, qlonglong buffer_id)
void dtkDistributedCommunicator::put(qint32 dest, qlonglong position, void *data, qlonglong buffer_id)
{
}
......
......@@ -48,11 +48,7 @@ public:
virtual QByteArray get(qint32 from, qlonglong position, qlonglong size, qlonglong buffer_id);
public:
virtual void put(qint32 dest, qlonglong position, qlonglong size, const QByteArray &data, qlonglong buffer_id);
// public:
// template<class T> T * get(qint32 from, qlonglong position, qlonglong size, qlonglong buffer_id);
// template<class T> void put(qint32 dest, qlonglong position, qlonglong size, const T &data, qlonglong buffer_id);
virtual void put(qint32 dest, qlonglong position, void *data, qlonglong buffer_id);
public:
virtual qint32 pid(void);
......
......@@ -3,9 +3,9 @@
* Author: Thibaud Kloczko
* Created: Tue Feb 5 14:12:49 2013 (+0100)
* Version:
* Last-Updated: lun. févr. 11 11:08:38 2013 (+0100)
* Last-Updated: lun. févr. 11 13:53:13 2013 (+0100)
* By: Nicolas Niclausse
* Update #: 177
* Update #: 182
*/
/* Change Log:
......@@ -55,7 +55,9 @@ template <typename T> qlonglong dtkDistributedContainer<T>::size(void) const
template <typename T> void dtkDistributedContainer<T>::set(const qlonglong& global_id, const T& value)
{
m_buffer[m_mapper->globalToLocal(global_id)] = value;
qint32 owner = static_cast<qint32>(m_mapper->owner(global_id));
qlonglong pos = m_mapper->globalToLocal(global_id);
m_comm->put(owner, pos, &(const_cast<T&>(value)), m_buffer_id);
};
template <typename T> void dtkDistributedContainer<T>::setLocal(const qlonglong& local_id, const T& value)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment