[Marble-commits] KDE/kdeedu/marble/src/lib
Jens-Michael Hoffmann
jensmh at gmx.de
Tue Jan 26 11:50:33 CET 2010
SVN commit 1080478 by jmhoffmann:
TileId: inline methods.
M +0 -36 TileId.cpp
M +39 -1 TileId.h
--- trunk/KDE/kdeedu/marble/src/lib/TileId.cpp #1080477:1080478
@@ -11,8 +11,6 @@
// Own
#include "TileId.h"
-#include <QtCore/QHash>
-
namespace Marble
{
@@ -26,11 +24,6 @@
{
}
-QString TileId::toString() const
-{
- return QString( "%1:%2:%3" ).arg( m_zoomLevel ).arg( m_tileX ).arg( m_tileY );
-}
-
TileId TileId::fromString( QString const& idStr )
{
int first = idStr.indexOf( ':' );
@@ -41,34 +34,5 @@
idStr.mid( last + 1 ).toInt() );
}
-int TileId::x() const
-{
- return m_tileX;
-}
-int TileId::y() const
-{
- return m_tileY;
}
-
-int TileId::zoomLevel() const
-{
- return m_zoomLevel;
-}
-
-bool operator==( TileId const& lhs, TileId const& rhs )
-{
- return lhs.m_zoomLevel == rhs.m_zoomLevel
- && lhs.m_tileX == rhs.m_tileX
- && lhs.m_tileY == rhs.m_tileY;
-}
-
-uint qHash( TileId const& tid )
-{
- quint64 tmp = ((quint64)(tid.m_zoomLevel) << 36)
- + ((quint64)(tid.m_tileX) << 18)
- + (quint64)(tid.m_tileY);
- return ::qHash( tmp );
-}
-
-}
--- trunk/KDE/kdeedu/marble/src/lib/TileId.h #1080477:1080478
@@ -11,6 +11,7 @@
#ifndef MARBLE_TILE_ID_H
#define MARBLE_TILE_ID_H
+#include <QtCore/QHash>
#include <QtCore/QString>
namespace Marble
@@ -38,10 +39,47 @@
int m_tileY;
};
-
bool operator==( TileId const& lhs, TileId const& rhs );
uint qHash( TileId const& );
+
+// inline definitions
+
+inline int TileId::zoomLevel() const
+{
+ return m_zoomLevel;
}
+inline int TileId::x() const
+{
+ return m_tileX;
+}
+
+inline int TileId::y() const
+{
+ return m_tileY;
+}
+
+inline QString TileId::toString() const
+{
+ return QString( "%1:%2:%3" ).arg( m_zoomLevel ).arg( m_tileX ).arg( m_tileY );
+}
+
+inline bool operator==( TileId const& lhs, TileId const& rhs )
+{
+ return lhs.m_zoomLevel == rhs.m_zoomLevel
+ && lhs.m_tileX == rhs.m_tileX
+ && lhs.m_tileY == rhs.m_tileY;
+}
+
+inline uint qHash( TileId const& tid )
+{
+ const quint64 tmp = (( quint64 )( tid.m_zoomLevel ) << 36 )
+ + (( quint64 )( tid.m_tileX ) << 18 )
+ + ( quint64 )( tid.m_tileY );
+ return ::qHash( tmp );
+}
+
+}
+
#endif
More information about the Marble-commits
mailing list