Commit d2fdf756 authored by Vincent Carrubba's avatar Vincent Carrubba
Browse files

Adding setters and getters to know if a slot is internal or external ( to...

Adding setters and getters to know if a slot is internal or external ( to avoid complexe hacks in EffectNode during connections)
parent ff88689e
......@@ -61,12 +61,15 @@ public:
QString const getName( void ) const;
quint32 getId( void ) const;
IEffectNode const* getFather( void ) const;
bool isItAnInternalSlot( void ) const;
// SETTING INFOS
void setId( quint32 id );
void setName( QString const & name );
void setFather( EffectNode* father );
void setAsInternal( void );
void setAsExternal( void );
private:
......@@ -95,6 +98,7 @@ private:
quint32 m_id;
QString m_name;
EffectNode* m_father;
bool m_isItAnInternalSlot;
friend class EffectNode;
};
......@@ -109,14 +113,14 @@ T InSlot<T>::m_defaultValue = 0;
// CTOR & DTOR
template<typename T>
InSlot<T>::InSlot() : m_rwl( QReadWriteLock::Recursive ), m_id( 0 ), m_name( "" ), m_father( NULL )
InSlot<T>::InSlot() : m_rwl( QReadWriteLock::Recursive ), m_id( 0 ), m_name( "" ), m_father( NULL ), m_isItAnInternalSlot( false )
{
resetOutSlotPtr();
setCurrentSharedToDefault();
}
template<typename T>
InSlot<T>::InSlot(InSlot const &) : m_rwl( QReadWriteLock::Recursive ), m_id( 0 ), m_name( "" ), m_father( NULL )
InSlot<T>::InSlot(InSlot const &) : m_rwl( QReadWriteLock::Recursive ), m_id( 0 ), m_name( "" ), m_father( NULL ), m_isItAnInternalSlot( false )
{
resetOutSlotPtr();
setCurrentSharedToDefault();
......@@ -129,6 +133,7 @@ InSlot<T>& InSlot<T>::operator=(InSlot const &)
m_id = 0;
m_name = "";
m_father = NULL;
m_isItAnInternalSlot = false;
resetOutSlotPtr();
setCurrentSharedToDefault();
}
......@@ -187,6 +192,14 @@ IEffectNode const * InSlot<T>::getFather( void ) const
return ( m_father );
}
template<typename T>
bool InSlot<T>::isItAnInternalSlot( void ) const
{
QReadLocker rl( &m_rwl );
return ( m_isItAnInternalSlot );
}
// SETTING INFOS
template<typename T>
......@@ -213,6 +226,22 @@ void InSlot<T>::setFather( EffectNode* father )
return ;
}
template<typename T>
void InSlot<T>::setAsInternal( void )
{
QWriteLocker wl( &m_rwl );
m_isItAnInternalSlot = true;
return ;
}
template<typename T>
void InSlot<T>::setAsExternal( void )
{
QWriteLocker wl( &m_rwl );
m_isItAnInternalSlot = false;
return ;
}
//////////////////////////
//// PRIVATES METHODS ////
//////////////////////////
......
......@@ -62,16 +62,18 @@ public:
// GETTING INFOS
InSlot<T>* getInSlotPtr( void ) const;
QString const getName( void ) const;
quint32 getId( void ) const;
IEffectNode const * getFather( void ) const;
bool isItAnInternalSlot( void ) const;
// SRTTING INFOS
void setId( quint32 id );
void setName( QString const & name );
void setFather( EffectNode* father );
void setAsInternal( void );
void setAsExternal( void );
private:
......@@ -95,7 +97,8 @@ private:
quint32 m_id;
QString m_name;
EffectNode* m_father;
EffectNode* m_father;
bool m_isItAnInternalSlot;
};
/////////////////////////
......@@ -105,14 +108,14 @@ private:
// CTOR & DTOR
template<typename T>
OutSlot<T>::OutSlot() : m_rwl( QReadWriteLock::Recursive ), m_id( 0 ), m_name( "" ), m_father( NULL )
OutSlot<T>::OutSlot() : m_rwl( QReadWriteLock::Recursive ), m_id( 0 ), m_name( "" ), m_father( NULL ), m_isItAnInternalSlot( false )
{
resetInSlotPtr();
resetPipe();
}
template<typename T>
OutSlot<T>::OutSlot(OutSlot<T> const & tocopy) : m_rwl( QReadWriteLock::Recursive ), m_id( 0 ), m_name( "" ), m_father( NULL )
OutSlot<T>::OutSlot(OutSlot<T> const & tocopy) : m_rwl( QReadWriteLock::Recursive ), m_id( 0 ), m_name( "" ), m_father( NULL ), m_isItAnInternalSlot( false )
{
resetInSlotPtr();
resetPipe();
......@@ -126,6 +129,7 @@ OutSlot<T>& OutSlot<T>::operator=(OutSlot<T> const & tocopy)
m_id = 0;
m_name = "";
m_father = NULL;
m_isItAnInternalSlot = false;
resetInSlotPtr();
resetPipe();
}
......@@ -208,6 +212,13 @@ IEffectNode const * OutSlot<T>::getFather( void ) const
return ( m_father );
}
template<typename T>
bool OutSlot<T>::isItAnInternalSlot( void ) const
{
QReadLocker rl( &m_rwl );
return ( m_isItAnInternalSlot );
}
// SETTING INFOS
template<typename T>
......@@ -234,6 +245,22 @@ void OutSlot<T>::setFather( EffectNode* father )
return ;
}
template<typename T>
void OutSlot<T>::setAsInternal( void )
{
QWriteLocker wl( &m_rwl );
m_isItAnInternalSlot = true;
return ;
}
template<typename T>
void OutSlot<T>::setAsExternal( void )
{
QWriteLocker wl( &m_rwl );
m_isItAnInternalSlot = false;
return ;
}
//////////////////////////
//// PRIVATES METHODS ////
//////////////////////////
......
Markdown is supported
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