Commit 2de2606e authored by KLOCZKO Thibaud's avatar KLOCZKO Thibaud
Browse files

Modify signature of data() method for transmitter so taht const reference is...

Modify signature of data() method for transmitter so taht const reference is returned instead of a copy.
parent 28ec584c
......@@ -4,9 +4,9 @@
* Copyright (C) 2011 - Thibaud Kloczko, Inria.
* Created: Mon Jan 30 16:37:29 2012 (+0100)
* Version: $Id$
* Last-Updated: Wed May 9 14:28:56 2012 (+0200)
* Last-Updated: Thu May 10 11:02:30 2012 (+0200)
* By: tkloczko
* Update #: 202
* Update #: 203
*/
/* Commentary:
......@@ -52,7 +52,7 @@ dtkComposerTransmitter::~dtkComposerTransmitter(void)
d = NULL;
}
QVariant dtkComposerTransmitter::variant(void) const
const QVariant& dtkComposerTransmitter::variant(void) const
{
return d->variant;
}
......
......@@ -4,9 +4,9 @@
* Copyright (C) 2011 - Thibaud Kloczko, Inria.
* Created: Mon Jan 30 16:36:09 2012 (+0100)
* Version: $Id$
* Last-Updated: Wed May 9 14:28:51 2012 (+0200)
* Last-Updated: Thu May 10 11:02:22 2012 (+0200)
* By: tkloczko
* Update #: 155
* Update #: 156
*/
/* Commentary:
......@@ -55,7 +55,7 @@ public:
virtual QString kindName(void) const = 0;
public:
QVariant variant(void) const;
const QVariant& variant(void) const;
public:
virtual const dtkAbstractContainer& container(void);
......
......@@ -4,9 +4,9 @@
* Copyright (C) 2011 - Thibaud Kloczko, Inria.
* Created: Tue Feb 14 10:33:49 2012 (+0100)
* Version: $Id$
* Last-Updated: Mon May 7 15:58:23 2012 (+0200)
* Last-Updated: Thu May 10 10:43:52 2012 (+0200)
* By: tkloczko
* Update #: 69
* Update #: 70
*/
/* Commentary:
......@@ -38,7 +38,7 @@ public:
public:
inline void setData(const T& data);
inline T data(void);
inline const T& data(void);
public:
inline void setVector(const dtkContainerVector<T>& vector);
......
......@@ -4,9 +4,9 @@
* Copyright (C) 2011 - Thibaud Kloczko, Inria.
* Created: Tue Feb 14 10:37:37 2012 (+0100)
* Version: $Id$
* Last-Updated: Mon May 7 16:57:01 2012 (+0200)
* Last-Updated: Thu May 10 10:44:00 2012 (+0200)
* By: tkloczko
* Update #: 155
* Update #: 156
*/
/* Commentary:
......@@ -61,7 +61,7 @@ template <typename T> inline void dtkComposerTransmitterEmitter<T>::setData(cons
/*!
*
*/
template <typename T> inline T dtkComposerTransmitterEmitter<T>::data(void)
template <typename T> inline const T& dtkComposerTransmitterEmitter<T>::data(void)
{
return m_data;
};
......
......@@ -4,9 +4,9 @@
* Copyright (C) 2011 - Thibaud Kloczko, Inria.
* Created: Tue Feb 14 11:39:15 2012 (+0100)
* Version: $Id$
* Last-Updated: Mon May 7 16:02:14 2012 (+0200)
* Last-Updated: Thu May 10 10:45:47 2012 (+0200)
* By: tkloczko
* Update #: 73
* Update #: 74
*/
/* Commentary:
......@@ -41,7 +41,7 @@ public:
~dtkComposerTransmitterReceiver(void);
public:
T data(void);
const T& data(void);
public:
const dtkAbstractContainer& container(void) const;
......
......@@ -4,9 +4,9 @@
* Copyright (C) 2011 - Thibaud Kloczko, Inria.
* Created: Tue Feb 14 12:56:04 2012 (+0100)
* Version: $Id$
* Last-Updated: Mon May 7 16:02:30 2012 (+0200)
* Last-Updated: Thu May 10 10:50:16 2012 (+0200)
* By: tkloczko
* Update #: 208
* Update #: 212
*/
/* Commentary:
......@@ -55,13 +55,13 @@ template <typename T> dtkComposerTransmitterReceiver<T>::~dtkComposerTransmitter
/*!
*
*/
template <typename T> T dtkComposerTransmitterReceiver<T>::data(void)
template <typename T> const T& dtkComposerTransmitterReceiver<T>::data(void)
{
if (active_emitter)
return active_emitter->data();
if (active_variant)
return qvariant_cast<T>(active_variant->data());
m_data = qvariant_cast<T>(active_variant->data());
return m_data;
};
......
......@@ -4,9 +4,9 @@
* Copyright (C) 2011 - Thibaud Kloczko, Inria.
* Created: Sat Mar 3 17:51:22 2012 (+0100)
* Version: $Id$
* Last-Updated: Wed May 9 14:28:36 2012 (+0200)
* Last-Updated: Thu May 10 11:02:08 2012 (+0200)
* By: tkloczko
* Update #: 396
* Update #: 401
*/
/* Commentary:
......@@ -80,7 +80,7 @@ void dtkComposerTransmitterVariant::setData(const dtkAbstractContainer& data)
}
}
QVariant dtkComposerTransmitterVariant::data(void)
const QVariant& dtkComposerTransmitterVariant::data(void)
{
if (e->twinned)
return d->variant;
......
......@@ -4,9 +4,9 @@
* Copyright (C) 2011 - Thibaud Kloczko, Inria.
* Created: Fri Mar 2 16:19:20 2012 (+0100)
* Version: $Id$
* Last-Updated: Wed May 9 14:28:43 2012 (+0200)
* Last-Updated: Thu May 10 10:40:21 2012 (+0200)
* By: tkloczko
* Update #: 71
* Update #: 72
*/
/* Commentary:
......@@ -39,7 +39,7 @@ public:
void setData(const QVariant& data);
void setData(const dtkAbstractContainer& data);
QVariant data(void);
const QVariant& data(void);
QVariantList allData(void);
......
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