[Liblas-commits] r1014 - in trunk: include/liblas/detail src/detail
liblas-commits at liblas.org
liblas-commits at liblas.org
Wed Feb 11 10:56:03 EST 2009
Author: hobu
Date: Wed Feb 11 10:55:58 2009
New Revision: 1014
URL: http://liblas.org/changeset/1014
Log:
remove redundant GetStream and move istream into abstract Reader:: class
Modified:
trunk/include/liblas/detail/reader.hpp
trunk/include/liblas/detail/reader10.hpp
trunk/include/liblas/detail/reader11.hpp
trunk/include/liblas/detail/reader12.hpp
trunk/include/liblas/detail/writer.hpp
trunk/src/detail/reader.cpp
trunk/src/detail/reader10.cpp
trunk/src/detail/reader11.cpp
trunk/src/detail/reader12.cpp
Modified: trunk/include/liblas/detail/reader.hpp
==============================================================================
--- trunk/include/liblas/detail/reader.hpp (original)
+++ trunk/include/liblas/detail/reader.hpp Wed Feb 11 10:55:58 2009
@@ -55,7 +55,7 @@
{
public:
- Reader();
+ Reader(std::istream& ifs);
virtual ~Reader();
virtual std::size_t GetVersion() const = 0;
virtual bool ReadHeader(LASHeader& header) = 0;
@@ -63,14 +63,16 @@
virtual bool ReadPointAt(std::size_t n, LASPoint& point, const LASHeader& header) = 0;
virtual bool ReadVLR(LASHeader& header) = 0;
virtual bool ReadGeoreference(LASHeader& header) = 0;
- virtual std::istream& GetStream() const = 0;
+ std::istream& GetStream() const;
protected:
+ std::istream& m_ifs;
std::streamoff m_offset;
uint32_t m_size;
uint32_t m_current;
uint32_t m_recordlength;
+
void FillPoint(PointRecord& record, LASPoint& point);
private:
Modified: trunk/include/liblas/detail/reader10.hpp
==============================================================================
--- trunk/include/liblas/detail/reader10.hpp (original)
+++ trunk/include/liblas/detail/reader10.hpp Wed Feb 11 10:55:58 2009
@@ -62,11 +62,7 @@
bool ReadPointAt(std::size_t n, LASPoint& record, const LASHeader& header);
bool ReadVLR(LASHeader& header);
bool ReadGeoreference(LASHeader& header);
- std::istream& GetStream() const;
-private:
-
- std::istream& m_ifs;
};
}}} // namespace liblas::detail::v10
Modified: trunk/include/liblas/detail/reader11.hpp
==============================================================================
--- trunk/include/liblas/detail/reader11.hpp (original)
+++ trunk/include/liblas/detail/reader11.hpp Wed Feb 11 10:55:58 2009
@@ -62,10 +62,7 @@
bool ReadPointAt(std::size_t n, LASPoint& record, const LASHeader& header);
bool ReadGeoreference(LASHeader& header);
bool ReadVLR(LASHeader& header);
- std::istream& GetStream() const;
-private:
- std::istream& m_ifs;
};
}}} // namespace liblas::detail::v11
Modified: trunk/include/liblas/detail/reader12.hpp
==============================================================================
--- trunk/include/liblas/detail/reader12.hpp (original)
+++ trunk/include/liblas/detail/reader12.hpp Wed Feb 11 10:55:58 2009
@@ -62,10 +62,7 @@
bool ReadPointAt(std::size_t n, LASPoint& record, const LASHeader& header);
bool ReadGeoreference(LASHeader& header);
bool ReadVLR(LASHeader& header);
- std::istream& GetStream() const;
-private:
- std::istream& m_ifs;
};
}}} // namespace liblas::detail::v12
Modified: trunk/include/liblas/detail/writer.hpp
==============================================================================
--- trunk/include/liblas/detail/writer.hpp (original)
+++ trunk/include/liblas/detail/writer.hpp Wed Feb 11 10:55:58 2009
@@ -62,7 +62,6 @@
virtual void WritePointRecord(LASPoint const& point, const LASHeader& header) = 0;
virtual void WriteVLR(LASHeader const& header) = 0;
std::ostream& GetStream() const;
- void SetStream(std::ostream& stream);
protected:
PointRecord m_record;
Modified: trunk/src/detail/reader.cpp
==============================================================================
--- trunk/src/detail/reader.cpp (original)
+++ trunk/src/detail/reader.cpp Wed Feb 11 10:55:58 2009
@@ -54,7 +54,7 @@
namespace liblas { namespace detail {
-Reader::Reader() : m_offset(0), m_current(0)
+Reader::Reader(std::istream& ifs) : m_ifs(ifs), m_offset(0), m_current(0)
{
}
@@ -62,6 +62,10 @@
{
}
+std::istream& Reader::GetStream() const
+{
+ return m_ifs;
+}
void Reader::FillPoint(PointRecord& record, LASPoint& point)
{
Modified: trunk/src/detail/reader10.cpp
==============================================================================
--- trunk/src/detail/reader10.cpp (original)
+++ trunk/src/detail/reader10.cpp Wed Feb 11 10:55:58 2009
@@ -62,7 +62,7 @@
namespace liblas { namespace detail { namespace v10 {
-ReaderImpl::ReaderImpl(std::istream& ifs) : Base(), m_ifs(ifs)
+ReaderImpl::ReaderImpl(std::istream& ifs) : Base(ifs)
{
}
@@ -384,10 +384,5 @@
return true;
}
-std::istream& ReaderImpl::GetStream() const
-{
- return m_ifs;
-}
-
}}} // namespace liblas::detail::v10
Modified: trunk/src/detail/reader11.cpp
==============================================================================
--- trunk/src/detail/reader11.cpp (original)
+++ trunk/src/detail/reader11.cpp Wed Feb 11 10:55:58 2009
@@ -62,7 +62,7 @@
namespace liblas { namespace detail { namespace v11 {
-ReaderImpl::ReaderImpl(std::istream& ifs) : Base(), m_ifs(ifs)
+ReaderImpl::ReaderImpl(std::istream& ifs) : Base(ifs)
{
}
@@ -297,10 +297,6 @@
return true;
}
-std::istream& ReaderImpl::GetStream() const
-{
- return m_ifs;
-}
bool ReaderImpl::ReadVLR(LASHeader& header)
{
Modified: trunk/src/detail/reader12.cpp
==============================================================================
--- trunk/src/detail/reader12.cpp (original)
+++ trunk/src/detail/reader12.cpp Wed Feb 11 10:55:58 2009
@@ -63,7 +63,7 @@
namespace liblas { namespace detail { namespace v12 {
-ReaderImpl::ReaderImpl(std::istream& ifs) : Base(), m_ifs(ifs)
+ReaderImpl::ReaderImpl(std::istream& ifs) : Base(ifs)
{
}
@@ -347,11 +347,6 @@
return true;
}
-std::istream& ReaderImpl::GetStream() const
-{
- return m_ifs;
-}
-
bool ReaderImpl::ReadVLR(LASHeader& header)
{
VLRHeader vlrh = { 0 };
More information about the Liblas-commits
mailing list