Hi all, I am not quite sure if we should merge this change later on into the main trunk of PoDoFo. On the one hand, the argument from Borland regarding the warning is valid. On the other hand, there are also often performance issues which make inline a valid choice for small methods.
Clearly, we do not have the time to profile all of PoDoFo and decide which methods to inline and which not. One suggestion could be, to inline all getter and setter methods and do not inline operator=, copy constructor etc. - because they should not be inlined in a library as they prevent future extentabillity. Some more information can be found here: http://stackoverflow.com/questions/1932311/when-to-use-inline-function-and-when-not-to-use-it How do others feel on this matter? Cheers, Dominik On Sun, May 26, 2013 at 9:08 PM, <a...@users.sourceforge.net> wrote: > > Revision: 1542 > http://sourceforge.net/p/podofo/code/1542 > Author: aja_ > Date: 2013-05-26 19:08:15 +0000 (Sun, 26 May 2013) > Log Message: > ----------- > Avoid code in public header files > > Borland C++ Builder XE2 has a warning for code in library (package) > header files; see [1] for more information. I agre with them, hence > this massive change. > > [1] > http://docwiki.embarcadero.com/RADStudio/XE2/en/W8118_Inline_member_function_in_Package_class > > Modified Paths: > -------------- > podofo/branches/_dev/zyx_integration/src/CMakeLists.txt > podofo/branches/_dev/zyx_integration/src/base/PdfArray.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfArray.h > podofo/branches/_dev/zyx_integration/src/base/PdfCanvas.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfCanvas.h > podofo/branches/_dev/zyx_integration/src/base/PdfColor.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfColor.h > podofo/branches/_dev/zyx_integration/src/base/PdfContentsTokenizer.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfContentsTokenizer.h > podofo/branches/_dev/zyx_integration/src/base/PdfData.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfData.h > podofo/branches/_dev/zyx_integration/src/base/PdfDataType.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfDataType.h > podofo/branches/_dev/zyx_integration/src/base/PdfDate.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfDate.h > podofo/branches/_dev/zyx_integration/src/base/PdfDictionary.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfDictionary.h > podofo/branches/_dev/zyx_integration/src/base/PdfEncoding.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfEncoding.h > podofo/branches/_dev/zyx_integration/src/base/PdfEncrypt.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfEncrypt.h > podofo/branches/_dev/zyx_integration/src/base/PdfError.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfError.h > podofo/branches/_dev/zyx_integration/src/base/PdfFileStream.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfFileStream.h > podofo/branches/_dev/zyx_integration/src/base/PdfFilter.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfFilter.h > podofo/branches/_dev/zyx_integration/src/base/PdfFiltersPrivate.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfFiltersPrivate.h > podofo/branches/_dev/zyx_integration/src/base/PdfImmediateWriter.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfImmediateWriter.h > podofo/branches/_dev/zyx_integration/src/base/PdfInputDevice.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfInputDevice.h > podofo/branches/_dev/zyx_integration/src/base/PdfInputStream.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfInputStream.h > podofo/branches/_dev/zyx_integration/src/base/PdfMemStream.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfMemStream.h > podofo/branches/_dev/zyx_integration/src/base/PdfName.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfName.h > podofo/branches/_dev/zyx_integration/src/base/PdfObject.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfObject.h > podofo/branches/_dev/zyx_integration/src/base/PdfOutputDevice.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfOutputDevice.h > podofo/branches/_dev/zyx_integration/src/base/PdfOutputStream.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfOutputStream.h > podofo/branches/_dev/zyx_integration/src/base/PdfParser.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfParser.h > podofo/branches/_dev/zyx_integration/src/base/PdfParserObject.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfParserObject.h > podofo/branches/_dev/zyx_integration/src/base/PdfRect.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfRect.h > podofo/branches/_dev/zyx_integration/src/base/PdfRefCountedBuffer.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfRefCountedBuffer.h > > podofo/branches/_dev/zyx_integration/src/base/PdfRefCountedInputDevice.cpp > > podofo/branches/_dev/zyx_integration/src/base/PdfRefCountedInputDevice.h > podofo/branches/_dev/zyx_integration/src/base/PdfReference.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfReference.h > podofo/branches/_dev/zyx_integration/src/base/PdfStream.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfStream.h > podofo/branches/_dev/zyx_integration/src/base/PdfString.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfString.h > podofo/branches/_dev/zyx_integration/src/base/PdfTokenizer.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfTokenizer.h > podofo/branches/_dev/zyx_integration/src/base/PdfVariant.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfVariant.h > podofo/branches/_dev/zyx_integration/src/base/PdfVecObjects.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfVecObjects.h > podofo/branches/_dev/zyx_integration/src/base/PdfWriter.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfWriter.h > podofo/branches/_dev/zyx_integration/src/base/PdfXRef.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfXRef.h > podofo/branches/_dev/zyx_integration/src/base/PdfXRefStream.cpp > podofo/branches/_dev/zyx_integration/src/base/PdfXRefStream.h > > podofo/branches/_dev/zyx_integration/src/base/PdfXRefStreamParserObject.cpp > > podofo/branches/_dev/zyx_integration/src/base/PdfXRefStreamParserObject.h > podofo/branches/_dev/zyx_integration/src/base/util/PdfMutex.h > podofo/branches/_dev/zyx_integration/src/base/util/PdfMutexImpl_noop.h > > podofo/branches/_dev/zyx_integration/src/base/util/PdfMutexImpl_pthread.h > > podofo/branches/_dev/zyx_integration/src/base/util/PdfMutexImpl_win32.h > podofo/branches/_dev/zyx_integration/src/base/util/PdfMutexWrapper.h > podofo/branches/_dev/zyx_integration/src/doc/PdfAcroForm.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfAcroForm.h > podofo/branches/_dev/zyx_integration/src/doc/PdfAction.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfAction.h > podofo/branches/_dev/zyx_integration/src/doc/PdfAnnotation.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfAnnotation.h > podofo/branches/_dev/zyx_integration/src/doc/PdfContents.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfContents.h > podofo/branches/_dev/zyx_integration/src/doc/PdfDestination.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfDestination.h > podofo/branches/_dev/zyx_integration/src/doc/PdfDifferenceEncoding.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfDifferenceEncoding.h > podofo/branches/_dev/zyx_integration/src/doc/PdfDocument.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfDocument.h > podofo/branches/_dev/zyx_integration/src/doc/PdfElement.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfElement.h > podofo/branches/_dev/zyx_integration/src/doc/PdfExtGState.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfExtGState.h > podofo/branches/_dev/zyx_integration/src/doc/PdfField.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfField.h > podofo/branches/_dev/zyx_integration/src/doc/PdfFont.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfFont.h > podofo/branches/_dev/zyx_integration/src/doc/PdfFontCache.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfFontCache.h > podofo/branches/_dev/zyx_integration/src/doc/PdfFontConfigWrapper.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfFontConfigWrapper.h > podofo/branches/_dev/zyx_integration/src/doc/PdfFontMetrics.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfFontMetrics.h > podofo/branches/_dev/zyx_integration/src/doc/PdfFontMetricsBase14.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfFontMetricsBase14.h > > podofo/branches/_dev/zyx_integration/src/doc/PdfFontMetricsFreetype.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfFontMetricsFreetype.h > podofo/branches/_dev/zyx_integration/src/doc/PdfFontTTFSubset.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfFontTTFSubset.h > podofo/branches/_dev/zyx_integration/src/doc/PdfIdentityEncoding.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfIdentityEncoding.h > podofo/branches/_dev/zyx_integration/src/doc/PdfImage.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfImage.h > podofo/branches/_dev/zyx_integration/src/doc/PdfInfo.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfInfo.h > podofo/branches/_dev/zyx_integration/src/doc/PdfMemDocument.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfMemDocument.h > podofo/branches/_dev/zyx_integration/src/doc/PdfNamesTree.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfNamesTree.h > podofo/branches/_dev/zyx_integration/src/doc/PdfOutlines.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfOutlines.h > podofo/branches/_dev/zyx_integration/src/doc/PdfPage.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfPage.h > podofo/branches/_dev/zyx_integration/src/doc/PdfPagesTree.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfPagesTree.h > podofo/branches/_dev/zyx_integration/src/doc/PdfPagesTreeCache.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfPagesTreeCache.h > podofo/branches/_dev/zyx_integration/src/doc/PdfPainter.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfPainter.h > podofo/branches/_dev/zyx_integration/src/doc/PdfPainterMM.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfPainterMM.h > podofo/branches/_dev/zyx_integration/src/doc/PdfShadingPattern.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfShadingPattern.h > podofo/branches/_dev/zyx_integration/src/doc/PdfSignOutputDevice.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfSignOutputDevice.h > podofo/branches/_dev/zyx_integration/src/doc/PdfStreamedDocument.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfStreamedDocument.h > podofo/branches/_dev/zyx_integration/src/doc/PdfTTFWriter.h > podofo/branches/_dev/zyx_integration/src/doc/PdfTable.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfTable.h > podofo/branches/_dev/zyx_integration/src/doc/PdfTilingPattern.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfTilingPattern.h > podofo/branches/_dev/zyx_integration/src/doc/PdfXObject.cpp > podofo/branches/_dev/zyx_integration/src/doc/PdfXObject.h > > Added Paths: > ----------- > podofo/branches/_dev/zyx_integration/src/base/util/PdfMutex.cpp > > Modified: podofo/branches/_dev/zyx_integration/src/CMakeLists.txt > =================================================================== > --- podofo/branches/_dev/zyx_integration/src/CMakeLists.txt 2013-05-26 > 16:12:58 UTC (rev 1541) > +++ podofo/branches/_dev/zyx_integration/src/CMakeLists.txt 2013-05-26 > 19:08:15 UTC (rev 1542) > @@ -9,6 +9,7 @@ > "Which PoDoFo library target to depend on when building tools and > tests") > > SET(PODOFO_BASE_SOURCES > + base/util/PdfMutex.cpp > base/PdfArray.cpp > base/PdfCanvas.cpp > base/PdfColor.cpp > > Modified: podofo/branches/_dev/zyx_integration/src/base/PdfArray.cpp > =================================================================== > --- podofo/branches/_dev/zyx_integration/src/base/PdfArray.cpp 2013-05-26 > 16:12:58 UTC (rev 1541) > +++ podofo/branches/_dev/zyx_integration/src/base/PdfArray.cpp 2013-05-26 > 19:08:15 UTC (rev 1542) > @@ -170,4 +170,163 @@ > } > } > > +void PdfArray::Clear() > +{ > + AssertMutable(); > + > + this->clear(); > +} > + > +size_t PdfArray::GetSize() const > +{ > + return this->size(); > +} > + > +void PdfArray::push_back( const PdfObject & var ) > +{ > + AssertMutable(); > + > + PdfArrayBaseClass::push_back( var ); > + m_bDirty = true; > +} > + > +size_t PdfArray::size() const > +{ > + return PdfArrayBaseClass::size(); > +} > + > +bool PdfArray::empty() const > +{ > + return PdfArrayBaseClass::empty(); > +} > + > +PdfObject& PdfArray::operator[](size_type __n) > +{ > + AssertMutable(); > + > + m_bDirty = true; > + return PdfArrayBaseClass::operator[](__n); > +} > + > +const PdfObject& PdfArray::operator[](size_type __n) const > +{ > + return PdfArrayBaseClass::operator[](__n); > +} > + > +void PdfArray::resize(size_t __n, value_type __x) > +{ > + PdfArrayBaseClass::resize(__n, __x); > +} > + > +PdfArray::iterator PdfArray::begin() > +{ > + return PdfArrayBaseClass::begin(); > +} > + > +PdfArray::const_iterator PdfArray::begin() const > +{ > + return PdfArrayBaseClass::begin(); > +} > + > +PdfArray::iterator PdfArray::end() > +{ > + return PdfArrayBaseClass::end(); > +} > + > +PdfArray::const_iterator PdfArray::end() const > +{ > + return PdfArrayBaseClass::end(); > +} > + > +PdfArray::reverse_iterator PdfArray::rbegin() > +{ > + return PdfArrayBaseClass::rbegin(); > +} > + > +PdfArray::const_reverse_iterator PdfArray::rbegin() const > +{ > + return PdfArrayBaseClass::rbegin(); > +} > + > +PdfArray::reverse_iterator PdfArray::rend() > +{ > + return PdfArrayBaseClass::rend(); > +} > + > +PdfArray::const_reverse_iterator PdfArray::rend() const > +{ > + return PdfArrayBaseClass::rend(); > +} > + > +void PdfArray::insert(PdfArray::iterator __position, > + PdfArray::iterator __first, > + PdfArray::iterator __last) > +{ > + AssertMutable(); > + > + PdfArrayBaseClass::insert( __position, __first, __last ); > + m_bDirty = true; > +} > + > +PdfArray::iterator PdfArray::insert(const iterator& __position, const > PdfObject & val ) > +{ > + AssertMutable(); > + > + m_bDirty = true; > + return PdfArrayBaseClass::insert( __position, val ); > +} > + > +void PdfArray::erase( const iterator& pos ) > +{ > + AssertMutable(); > + > + PdfArrayBaseClass::erase( pos ); > + m_bDirty = true; > +} > + > +void PdfArray::erase( const iterator& first, const iterator& last ) > +{ > + AssertMutable(); > + > + PdfArrayBaseClass::erase( first, last ); > + m_bDirty = true; > +} > + > +void PdfArray::reserve(size_type __n) > +{ > + PdfArrayBaseClass::reserve( __n ); > +} > + > +PdfObject & PdfArray::front() > +{ > + return PdfArrayBaseClass::front(); > +} > + > +const PdfObject & PdfArray::front() const > +{ > + return PdfArrayBaseClass::front(); > +} > + > +PdfObject & PdfArray::back() > +{ > + return PdfArrayBaseClass::back(); > +} > + > +const PdfObject & PdfArray::back() const > +{ > + return PdfArrayBaseClass::back(); > +} > + > +bool PdfArray::operator==( const PdfArray & rhs ) const > +{ > + //TODO: This operator does not check for m_bDirty. Add comparison or > add explanation why it should not be there > + return (static_cast< PdfArrayBaseClass >(*this) == static_cast< > PdfArrayBaseClass >(rhs) ); > +} > + > +bool PdfArray::operator!=( const PdfArray & rhs ) const > +{ > + //TODO: This operator does not check for m_bDirty. Add comparison or > add explanation why it should not be there > + return (static_cast< PdfArrayBaseClass >(*this) != static_cast< > PdfArrayBaseClass >(rhs) ); > +} > + > }; > > Modified: podofo/branches/_dev/zyx_integration/src/base/PdfArray.h > =================================================================== > --- podofo/branches/_dev/zyx_integration/src/base/PdfArray.h 2013-05-26 > 16:12:58 UTC (rev 1541) > +++ podofo/branches/_dev/zyx_integration/src/base/PdfArray.h 2013-05-26 > 19:08:15 UTC (rev 1542) > @@ -78,11 +78,11 @@ > /** > * \returns the size of the array > */ > - inline size_t GetSize() const; > + size_t GetSize() const; > > /** Remove all elements from the array > */ > - inline void Clear(); > + void Clear(); > > /** Write the array to an output device. > * This is an overloaded member function. > @@ -118,127 +118,120 @@ > * This will set the dirty flag of this object. > * \see IsDirty > */ > - inline void push_back( const PdfObject & var ); > + void push_back( const PdfObject & var ); > > /** > * \returns the size of the array > */ > - inline size_t size() const; > + size_t size() const; > > /** > * \returns true if the array is empty. > */ > - inline bool empty() const; > + bool empty() const; > > - inline PdfObject & operator[](size_type __n); > - inline const PdfObject & operator[](size_type __n) const; > + PdfObject & operator[](size_type __n); > + const PdfObject & operator[](size_type __n) const; > > /** > * Resize the internal vector. > * \param __n new size > */ > - inline void resize(size_t __n, value_type __x = > PdfArrayBaseClass::value_type()); > + void resize(size_t __n, value_type __x = > PdfArrayBaseClass::value_type()); > > /** > * Returns a read/write iterator that points to the first > * element in the array. Iteration is done in ordinary > * element order. > */ > - inline iterator begin(); > + iterator begin(); > > /** > * Returns a read-only (constant) iterator that points to the > * first element in the array. Iteration is done in ordinary > * element order. > */ > - inline const_iterator begin() const; > + const_iterator begin() const; > > /** > * Returns a read/write iterator that points one past the last > * element in the array. Iteration is done in ordinary > * element order. > */ > - inline iterator end(); > + iterator end(); > > /** > * Returns a read-only (constant) iterator that points one past > * the last element in the array. Iteration is done in > * ordinary element order. > */ > - inline const_iterator end() const; > + const_iterator end() const; > > /** > * Returns a read/write reverse iterator that points to the > * last element in the array. Iteration is done in reverse > * element order. > */ > - inline reverse_iterator rbegin(); > + reverse_iterator rbegin(); > > /** > * Returns a read-only (constant) reverse iterator that points > * to the last element in the array. Iteration is done in > * reverse element order. > */ > - inline const_reverse_iterator rbegin() const; > + const_reverse_iterator rbegin() const; > > /** > * Returns a read/write reverse iterator that points to one > * before the first element in the array. Iteration is done > * in reverse element order. > */ > - inline reverse_iterator rend(); > + reverse_iterator rend(); > > /** > * Returns a read-only (constant) reverse iterator that points > * to one before the first element in the array. Iteration > * is done in reverse element order. > */ > - inline const_reverse_iterator rend() const; > + const_reverse_iterator rend() const; > > -#if defined(_MSC_VER) && _MSC_VER <= 1200 // workaround > template-error in Visualstudio 6 > - inline void insert(iterator __position, > + void insert(iterator __position, > iterator __first, > iterator __last); > -#else > - template<typename _InputIterator> > - void insert(const iterator& __position, > - const _InputIterator& __first, > - const _InputIterator& __last); > -#endif > > - inline PdfArray::iterator insert(const iterator& __position, const > PdfObject & val ); > + PdfArray::iterator insert(const iterator& __position, const PdfObject > & val ); > > - inline void erase( const iterator& pos ); > - inline void erase( const iterator& first, const iterator& last ); > + void erase( const iterator& pos ); > + void erase( const iterator& first, const iterator& last ); > > - inline void reserve(size_type __n); > + void reserve(size_type __n); > > /** > * \returns a read/write reference to the data at the first > * element of the array. > */ > - inline reference front(); > + reference front(); > > /** > ...... ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may _______________________________________________ Podofo-users mailing list Podofo-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/podofo-users