Loading src/core/tnlCurve.h +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ template< class T > class tnlCurve : public tnlObject, public tnlList< tnlCurveE //! Erase the curve void Erase() { tnlList< tnlCurveElement< T > > :: EraseAll(); tnlList< tnlCurveElement< T > >::reset(); }; //! Method for saving the object to a file as a binary data Loading src/core/tnlList.h +22 −12 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ #ifndef mListH #define mListH #include <assert.h> #include <core/tnlAssert.h> #include <stdlib.h> #include <iostream> #include <core/tnlDataElement.h> Loading Loading @@ -88,7 +88,7 @@ template< class T > class tnlList }; //! Destructor ~tnlList() { EraseAll(); }; ~tnlList() { reset(); }; //! If the list is empty return 'true' bool isEmpty() const { return ! size; }; Loading @@ -99,7 +99,7 @@ template< class T > class tnlList //! Indexing operator T& operator[] ( int ind ) { assert( ind < size ); tnlAssert( ind < size, ); //if( ! size ) return NULL; // find fastest way to element with index i // we can use iterator as it is set now or Loading Loading @@ -142,7 +142,7 @@ template< class T > class tnlList iterator = iterator -> Next(); index ++; } assert( iterator ); tnlAssert( iterator, ); } return iterator -> Data(); }; Loading @@ -164,7 +164,7 @@ template< class T > class tnlList { if( ! first ) { assert( ! last ); tnlAssert( ! last, ); first = last = new tnlDataElement< T >( data ); if( ! first ) return false; } Loading @@ -172,7 +172,7 @@ template< class T > class tnlList { tnlDataElement< T >* new_element = new tnlDataElement< T >( data, last, 0 ); if( ! new_element ) return false; assert( last ); tnlAssert( last, ); last = last -> Next() = new_element; } size ++; Loading @@ -184,7 +184,7 @@ template< class T > class tnlList { if( ! first ) { assert( ! last ); tnlAssert( ! last, ); first = last = new tnlDataElement< T >( data ); if( ! first ) return false; } Loading @@ -202,7 +202,7 @@ template< class T > class tnlList //! Insert new data element at given position bool Insert( const T& data, int ind ) { assert( ind <= size || ! size ); tnlAssert( ind <= size || ! size, ); if( ind == 0 ) return Prepend( data ); if( ind == size ) return Append( data ); operator[]( ind ); Loading Loading @@ -239,6 +239,16 @@ template< class T > class tnlList return true; }; template< typename Array > void toArray( Array& array ) { tnlAssert( this->getSize() <= array.getSize(), cerr << "this->getSize() = " << this->getSize() << " array.getSize() = " << array.getSize() << endl; ); for( int i = 0; i < this->getSize(); i++ ) array[ i ] = ( *this )[ i ]; } //! Erase data element at given position void Erase( int ind ) { Loading Loading @@ -269,13 +279,13 @@ template< class T > class tnlList }; //! Erase all data elements void EraseAll() void reset() { iterator = first; tnlDataElement< T >* tmp_it; while( iterator ) { assert( iterator ); tnlAssert( iterator, ); tmp_it = iterator; iterator = iterator -> Next(); delete tmp_it; Loading Loading @@ -356,7 +366,7 @@ template< class T > class tnlList } return true; #else EraseAll(); reset(); int _size; file. read( &_size, 1 ); if( _size < 0 ) Loading Loading @@ -395,7 +405,7 @@ template< class T > class tnlList } return true; #else EraseAll(); reset(); int _size; file. read( &_size ); if( _size < 0 ) Loading src/implementation/core/tnlObject.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ bool getObjectType( const tnlString& fileName, tnlString& type ) bool parseObjectType( const tnlString& objectType, tnlList< tnlString >& parsedObjectType ) { parsedObjectType. EraseAll(); parsedObjectType.reset(); int objectTypeLength = objectType. getLength(); int i = 0; /**** Loading src/implementation/core/tnlString.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include <cstring> #include <string.h> #include <assert.h> #include <core/tnlString.h> #include <debug/tnlDebug.h> #include <core/tnlAssert.h> Loading Loading @@ -389,7 +390,7 @@ bool tnlString :: getLine( istream& stream ) int tnlString :: parse( tnlList< tnlString >& list, const char separator ) const { dbgFunctionName( "tnlString", "parse" ); list. EraseAll(); list.reset(); tnlString copy( *this ); int len = copy. getLength(); for( int i = 0; i < len; i ++ ) Loading src/implementation/matrices/tnlMatrixReader_impl.h +1 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,7 @@ bool tnlMatrixReader< Matrix >::readMtxHeader( std::istream& file, return false; } parsedLine. EraseAll(); parsedLine.reset(); line. parse( parsedLine ); if( parsedLine. getSize() != 3 ) { Loading Loading
src/core/tnlCurve.h +1 −1 Original line number Diff line number Diff line Loading @@ -104,7 +104,7 @@ template< class T > class tnlCurve : public tnlObject, public tnlList< tnlCurveE //! Erase the curve void Erase() { tnlList< tnlCurveElement< T > > :: EraseAll(); tnlList< tnlCurveElement< T > >::reset(); }; //! Method for saving the object to a file as a binary data Loading
src/core/tnlList.h +22 −12 Original line number Diff line number Diff line Loading @@ -18,7 +18,7 @@ #ifndef mListH #define mListH #include <assert.h> #include <core/tnlAssert.h> #include <stdlib.h> #include <iostream> #include <core/tnlDataElement.h> Loading Loading @@ -88,7 +88,7 @@ template< class T > class tnlList }; //! Destructor ~tnlList() { EraseAll(); }; ~tnlList() { reset(); }; //! If the list is empty return 'true' bool isEmpty() const { return ! size; }; Loading @@ -99,7 +99,7 @@ template< class T > class tnlList //! Indexing operator T& operator[] ( int ind ) { assert( ind < size ); tnlAssert( ind < size, ); //if( ! size ) return NULL; // find fastest way to element with index i // we can use iterator as it is set now or Loading Loading @@ -142,7 +142,7 @@ template< class T > class tnlList iterator = iterator -> Next(); index ++; } assert( iterator ); tnlAssert( iterator, ); } return iterator -> Data(); }; Loading @@ -164,7 +164,7 @@ template< class T > class tnlList { if( ! first ) { assert( ! last ); tnlAssert( ! last, ); first = last = new tnlDataElement< T >( data ); if( ! first ) return false; } Loading @@ -172,7 +172,7 @@ template< class T > class tnlList { tnlDataElement< T >* new_element = new tnlDataElement< T >( data, last, 0 ); if( ! new_element ) return false; assert( last ); tnlAssert( last, ); last = last -> Next() = new_element; } size ++; Loading @@ -184,7 +184,7 @@ template< class T > class tnlList { if( ! first ) { assert( ! last ); tnlAssert( ! last, ); first = last = new tnlDataElement< T >( data ); if( ! first ) return false; } Loading @@ -202,7 +202,7 @@ template< class T > class tnlList //! Insert new data element at given position bool Insert( const T& data, int ind ) { assert( ind <= size || ! size ); tnlAssert( ind <= size || ! size, ); if( ind == 0 ) return Prepend( data ); if( ind == size ) return Append( data ); operator[]( ind ); Loading Loading @@ -239,6 +239,16 @@ template< class T > class tnlList return true; }; template< typename Array > void toArray( Array& array ) { tnlAssert( this->getSize() <= array.getSize(), cerr << "this->getSize() = " << this->getSize() << " array.getSize() = " << array.getSize() << endl; ); for( int i = 0; i < this->getSize(); i++ ) array[ i ] = ( *this )[ i ]; } //! Erase data element at given position void Erase( int ind ) { Loading Loading @@ -269,13 +279,13 @@ template< class T > class tnlList }; //! Erase all data elements void EraseAll() void reset() { iterator = first; tnlDataElement< T >* tmp_it; while( iterator ) { assert( iterator ); tnlAssert( iterator, ); tmp_it = iterator; iterator = iterator -> Next(); delete tmp_it; Loading Loading @@ -356,7 +366,7 @@ template< class T > class tnlList } return true; #else EraseAll(); reset(); int _size; file. read( &_size, 1 ); if( _size < 0 ) Loading Loading @@ -395,7 +405,7 @@ template< class T > class tnlList } return true; #else EraseAll(); reset(); int _size; file. read( &_size ); if( _size < 0 ) Loading
src/implementation/core/tnlObject.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -165,7 +165,7 @@ bool getObjectType( const tnlString& fileName, tnlString& type ) bool parseObjectType( const tnlString& objectType, tnlList< tnlString >& parsedObjectType ) { parsedObjectType. EraseAll(); parsedObjectType.reset(); int objectTypeLength = objectType. getLength(); int i = 0; /**** Loading
src/implementation/core/tnlString.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ #include <cstring> #include <string.h> #include <assert.h> #include <core/tnlString.h> #include <debug/tnlDebug.h> #include <core/tnlAssert.h> Loading Loading @@ -389,7 +390,7 @@ bool tnlString :: getLine( istream& stream ) int tnlString :: parse( tnlList< tnlString >& list, const char separator ) const { dbgFunctionName( "tnlString", "parse" ); list. EraseAll(); list.reset(); tnlString copy( *this ); int len = copy. getLength(); for( int i = 0; i < len; i ++ ) Loading
src/implementation/matrices/tnlMatrixReader_impl.h +1 −1 Original line number Diff line number Diff line Loading @@ -213,7 +213,7 @@ bool tnlMatrixReader< Matrix >::readMtxHeader( std::istream& file, return false; } parsedLine. EraseAll(); parsedLine.reset(); line. parse( parsedLine ); if( parsedLine. getSize() != 3 ) { Loading