{
}
+//====================================================================
+//! Constructor (default)
+//====================================================================
+SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList( const bool skipAllEqal )
+: QValueList<SUIT_DataOwnerPtr>(),
+mySkipEqual( skipAllEqal )
+{
+}
+
//====================================================================
//! Constructor (copy)
//====================================================================
{
}
+//====================================================================
+//! Constructor (copy)
+//====================================================================
+SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList( const SUIT_DataOwnerPtrList& l, const bool skipAllEqal )
+: QValueList<SUIT_DataOwnerPtr>(),
+mySkipEqual( skipAllEqal )
+{
+ if ( skipAllEqal == l.mySkipEqual )
+ operator =( l );
+ else
+ {
+ SUIT_DataOwnerPtrList::const_iterator beginIt = l.begin();
+ SUIT_DataOwnerPtrList::const_iterator endIt = l.end();
+ for( ; beginIt != endIt; ++beginIt )
+ append( *beginIt );
+ }
+}
+
#ifndef QT_NO_STL
//====================================================================
//! Constructor (from stl)
}
#endif
+#ifndef QT_NO_STL
+//====================================================================
+//! Constructor (from stl)
+//====================================================================
+SUIT_DataOwnerPtrList::SUIT_DataOwnerPtrList( const std::list<SUIT_DataOwnerPtr>& l, const bool skipAllEqal )
+: QValueList<SUIT_DataOwnerPtr>(),
+mySkipEqual( skipAllEqal )
+{
+ std::list<SUIT_DataOwnerPtr>::const_iterator beginIt = l.begin();
+ std::list<SUIT_DataOwnerPtr>::const_iterator endIt = l.begin();
+ for( ; beginIt != endIt; ++beginIt )
+ append( *beginIt );
+}
+#endif
+
//====================================================================
//! Appends an item to the list
//====================================================================
{
SUIT_DataOwnerPtrList::iterator it = find( x );
if ( it != end() )
- {
- const _typeinfo& ti1 = typeid( *((*it).operator->()) );
- const _typeinfo& ti2 = typeid( *(x.operator->()) );
+ {
+ if ( mySkipEqual )
+ return it;
+ const _typeinfo& ti1 = typeid( *((*it).operator->()) );
+ const _typeinfo& ti2 = typeid( *(x.operator->()) );
- if (ti1 == ti2)
- return it;
- }
+ if (ti1 == ti2)
+ return it;
+ }
return QValueList<SUIT_DataOwnerPtr>::append( x );
}
{
public:
SUIT_DataOwnerPtrList();//!< constructor
+ SUIT_DataOwnerPtrList( const bool skipAllEqal );//!< constructor
SUIT_DataOwnerPtrList( const SUIT_DataOwnerPtrList& l );//!< copy constructor
+ SUIT_DataOwnerPtrList( const SUIT_DataOwnerPtrList& l, const bool skipAllEqal );//!< copy constructor
#ifndef QT_NO_STL
SUIT_DataOwnerPtrList( const std::list<SUIT_DataOwnerPtr>& l );//!< copy constructor for STL list
+ SUIT_DataOwnerPtrList( const std::list<SUIT_DataOwnerPtr>& l, const bool skipAllEqal );//!< copy constructor for STL list
#endif
iterator append ( const SUIT_DataOwnerPtr& x );//!< append function
iterator insert ( iterator it, const SUIT_DataOwnerPtr& x );//!< hide method
void push_front ( const SUIT_DataOwnerPtr& x );//!< hide method
void push_back ( const SUIT_DataOwnerPtr& x );//!< hide method
+private:
+ bool mySkipEqual;
};
#ifdef WIN32