[Liblas-commits] hg-main-tree: added readBegin..readEnd sequence; most of these c...

liblas-commits at liblas.org liblas-commits at liblas.org
Tue Aug 2 18:44:00 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/0d5423c96f98
changeset: 996:0d5423c96f98
user:      Michael P. Gerlek <mpg at flaxen.com>
date:      Tue Aug 02 15:43:51 2011 -0700
description:
added readBegin..readEnd sequence; most of these changes are just renaming readImpl to readBufferImpl

diffstat:

 include/pdal/FilterIterator.hpp                     |   6 +-
 include/pdal/MultiFilterIterator.hpp                |   2 +-
 include/pdal/StageIterator.hpp                      |  33 +++++++++++++-
 include/pdal/drivers/faux/Iterator.hpp              |   4 +-
 include/pdal/drivers/las/Iterator.hpp               |   4 +-
 include/pdal/drivers/liblas/Iterator.hpp            |   6 +-
 include/pdal/drivers/oci/Iterator.hpp               |   4 +-
 include/pdal/drivers/qfit/Iterator.hpp              |   4 +-
 include/pdal/drivers/terrasolid/Iterator.hpp        |   4 +-
 include/pdal/filters/ByteSwapFilterIterator.hpp     |   2 +-
 include/pdal/filters/CacheFilterIterator.hpp        |   4 +-
 include/pdal/filters/ChipperIterator.hpp            |   2 +-
 include/pdal/filters/ColorFilterIterator.hpp        |   2 +-
 include/pdal/filters/CropFilterIterator.hpp         |   2 +-
 include/pdal/filters/DecimationFilterIterator.hpp   |   2 +-
 include/pdal/filters/MosaicFilterIterator.hpp       |   2 +-
 include/pdal/filters/ReprojectionFilterIterator.hpp |   2 +-
 include/pdal/filters/ScalingFilterIterator.hpp      |   2 +-
 src/StageIterator.cpp                               |  48 ++++++++++++++++++++-
 src/drivers/faux/Iterator.cpp                       |   4 +-
 src/drivers/las/Iterator.cpp                        |   4 +-
 src/drivers/liblas/Iterator.cpp                     |  10 ++--
 src/drivers/oci/Iterator.cpp                        |   6 +-
 src/drivers/qfit/Iterator.cpp                       |   4 +-
 src/drivers/terrasolid/Iterator.cpp                 |   4 +-
 src/filters/ByteSwapFilterIterator.cpp              |   2 +-
 src/filters/CacheFilterIterator.cpp                 |   4 +-
 src/filters/ChipperIterator.cpp                     |   2 +-
 src/filters/ColorFilterIterator.cpp                 |   2 +-
 src/filters/CropFilterIterator.cpp                  |   2 +-
 src/filters/DecimationFilterIterator.cpp            |   2 +-
 src/filters/MosaicFilterIterator.cpp                |   2 +-
 src/filters/ReprojectionFilterIterator.cpp          |   2 +-
 src/filters/ScalingFilterIterator.cpp               |   2 +-
 34 files changed, 129 insertions(+), 58 deletions(-)

diffs (truncated from 683 to 300 lines):

diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/FilterIterator.hpp
--- a/include/pdal/FilterIterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/FilterIterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -51,7 +51,7 @@
 
 protected:
     // from StageSequentialIterator
-    virtual boost::uint32_t readImpl(PointBuffer&) = 0;
+    virtual boost::uint32_t readBufferImpl(PointBuffer&) = 0;
     virtual boost::uint64_t skipImpl(boost::uint64_t pointNum) = 0;
     virtual bool atEndImpl() const = 0;
 
@@ -72,7 +72,7 @@
 
 protected:
     // from StageRandomIterator
-    virtual boost::uint32_t readImpl(PointBuffer&) = 0;
+    virtual boost::uint32_t readBufferImpl(PointBuffer&) = 0;
     virtual boost::uint64_t seekImpl(boost::uint64_t pointNum) = 0;
 
     StageRandomIterator& getPrevIterator();
@@ -91,7 +91,7 @@
 
 protected:
     // from StageRandomIterator
-    virtual boost::uint32_t readImpl(PointBuffer&) = 0;
+    virtual boost::uint32_t readBufferImpl(PointBuffer&) = 0;
     virtual boost::uint64_t seekImpl(boost::uint64_t pointNum) = 0;
 
     StageBlockIterator& getPrevIterator();
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/MultiFilterIterator.hpp
--- a/include/pdal/MultiFilterIterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/MultiFilterIterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -53,7 +53,7 @@
 
 protected:
     // from StageSequentialIterator
-    virtual boost::uint32_t readImpl(PointBuffer&) = 0;
+    virtual boost::uint32_t readBufferImpl(PointBuffer&) = 0;
     virtual boost::uint64_t skipImpl(boost::uint64_t pointNum) = 0;
     virtual bool atEndImpl() const = 0;
 
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/StageIterator.hpp
--- a/include/pdal/StageIterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/StageIterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -60,7 +60,30 @@
     // we need to write into.
     //
     // Returns the number of valid points read.
-    boost::uint32_t read(PointBuffer&);
+    //
+    // (This function really just performs the readBegin..readEnd sequence)
+    boost::uint32_t read(PointBuffer& buffer);
+
+    // These functions just call into the corresponding 'Impls that the derived stage
+    // provides, plus some of them do a little internal bookkeeping we don't want to have 
+    // to make the derived stages keep track of.
+    //
+    // Mortal users are not intended to use these functions.  For read workflows, just
+    // call the above read() method.  For write workflows, Writer::write() will take
+    // care of calling these guys for you.
+    //
+    // Sequence:
+    //    - readBegin
+    //    - for each buffer chunk, do
+    //       . readBufferBegin
+    //       . readBuffer
+    //       . readBufferEnd
+    //    - readEnd
+    void readBegin();
+    void readBufferBegin(PointBuffer&);
+    boost::uint32_t readBuffer(PointBuffer&);
+    void readBufferEnd(PointBuffer&);
+    void readEnd();
 
     // Returns the current point number.  The first point is 0.
     // If this number if > getNumPoints(), then no more points
@@ -76,7 +99,11 @@
     boost::uint32_t getChunkSize() const;
 
 protected:
-    virtual boost::uint32_t readImpl(PointBuffer&) = 0;
+    virtual void readBeginImpl() {}
+    virtual void readBufferBeginImpl(PointBuffer&) {}
+    virtual boost::uint32_t readBufferImpl(PointBuffer&) = 0;
+    virtual void readBufferEndImpl(PointBuffer&) {}
+    virtual void readEndImpl() {}
 
     // This is provided as a sample implementation that some stages could use
     // to implement their own skip or seek functions. It uses the read() call 
@@ -115,7 +142,7 @@
 
 protected:
     // from Iterator
-    virtual boost::uint32_t readImpl(PointBuffer&) = 0;
+    virtual boost::uint32_t readBufferImpl(PointBuffer&) = 0;
 
     virtual boost::uint64_t skipImpl(boost::uint64_t pointNum) = 0;
     virtual bool atEndImpl() const = 0;
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/drivers/faux/Iterator.hpp
--- a/include/pdal/drivers/faux/Iterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/drivers/faux/Iterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -53,7 +53,7 @@
 
 private:
     boost::uint64_t skipImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
     bool atEndImpl() const;
 
     const Reader& m_reader;
@@ -67,7 +67,7 @@
 
 private:
     boost::uint64_t seekImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
 
     const Reader& m_reader;
 };
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/drivers/las/Iterator.hpp
--- a/include/pdal/drivers/las/Iterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/drivers/las/Iterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -85,7 +85,7 @@
 
 private:
     boost::uint64_t skipImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
     bool atEndImpl() const;
 };
 
@@ -98,7 +98,7 @@
 
 private:
     boost::uint64_t seekImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
 };
 
 } } } // namespaces
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/drivers/liblas/Iterator.hpp
--- a/include/pdal/drivers/liblas/Iterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/drivers/liblas/Iterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -65,7 +65,7 @@
     ::liblas::Reader& getExternalReader() const;
     const LiblasReader& getReader() const;
     
-    boost::uint32_t readBuffer(PointBuffer& data);
+    boost::uint32_t myReadBuffer(PointBuffer& data);
 
 private:
     const LiblasReader& m_reader;
@@ -86,7 +86,7 @@
 
 private:
     boost::uint64_t skipImpl(boost::uint64_t count);
-    boost::uint32_t readImpl(PointBuffer& data);
+    boost::uint32_t readBufferImpl(PointBuffer& data);
     bool atEndImpl() const;
 };
 
@@ -99,7 +99,7 @@
 
 private:
     boost::uint64_t seekImpl(boost::uint64_t pos);
-    boost::uint32_t readImpl(PointBuffer& data);
+    boost::uint32_t readBufferImpl(PointBuffer& data);
 };
 
 
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/drivers/oci/Iterator.hpp
--- a/include/pdal/drivers/oci/Iterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/drivers/oci/Iterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -56,7 +56,7 @@
 protected:
     const Reader& getReader() const;
     
-    boost::uint32_t readBuffer(PointBuffer& data);
+    boost::uint32_t myReadBuffer(PointBuffer& data);
     boost::uint32_t unpackOracleData(PointBuffer& data);
     BlockPtr defineBlock(Statement statement);
 
@@ -85,7 +85,7 @@
 
 private:
     boost::uint64_t skipImpl(boost::uint64_t count);
-    boost::uint32_t readImpl(PointBuffer& data);
+    boost::uint32_t readBufferImpl(PointBuffer& data);
     bool atEndImpl() const;
 };
 
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/drivers/qfit/Iterator.hpp
--- a/include/pdal/drivers/qfit/Iterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/drivers/qfit/Iterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -53,7 +53,7 @@
 
 private:
     boost::uint64_t skipImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
     bool atEndImpl() const;
 
     const Reader& m_reader;
@@ -69,7 +69,7 @@
 
 private:
     boost::uint64_t seekImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
 
     const Reader& m_reader;
     std::istream* m_istream;
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/drivers/terrasolid/Iterator.hpp
--- a/include/pdal/drivers/terrasolid/Iterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/drivers/terrasolid/Iterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -53,7 +53,7 @@
 
 private:
     boost::uint64_t skipImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
     bool atEndImpl() const;
 
     const Reader& m_reader;
@@ -69,7 +69,7 @@
 
 private:
     boost::uint64_t seekImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
 
     const Reader& m_reader;
     std::istream* m_istream;
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/filters/ByteSwapFilterIterator.hpp
--- a/include/pdal/filters/ByteSwapFilterIterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/filters/ByteSwapFilterIterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -50,7 +50,7 @@
 
 private:
     boost::uint64_t skipImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
     bool atEndImpl() const;
 
     const ByteSwapFilter& m_swapFilter;
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/filters/CacheFilterIterator.hpp
--- a/include/pdal/filters/CacheFilterIterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/filters/CacheFilterIterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -54,7 +54,7 @@
 
 private:
     boost::uint64_t skipImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
     bool atEndImpl() const;
 
     const CacheFilter& m_filter;
@@ -68,7 +68,7 @@
 
 private:
     boost::uint64_t seekImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
 
     const CacheFilter& m_filter;
 };
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/filters/ChipperIterator.hpp
--- a/include/pdal/filters/ChipperIterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/filters/ChipperIterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -55,7 +55,7 @@
 
 private:
     boost::uint64_t skipImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
     bool atEndImpl() const;
 
     Chipper const& m_chipper;
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/filters/ColorFilterIterator.hpp
--- a/include/pdal/filters/ColorFilterIterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/filters/ColorFilterIterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -50,7 +50,7 @@
 
 private:
     boost::uint64_t skipImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);
     bool atEndImpl() const;
 
     const ColorFilter& m_colorFilter;
diff -r 42aad86c4ce1 -r 0d5423c96f98 include/pdal/filters/CropFilterIterator.hpp
--- a/include/pdal/filters/CropFilterIterator.hpp	Tue Aug 02 13:49:18 2011 -0700
+++ b/include/pdal/filters/CropFilterIterator.hpp	Tue Aug 02 15:43:51 2011 -0700
@@ -52,7 +52,7 @@
 
 private:
     boost::uint64_t skipImpl(boost::uint64_t);
-    boost::uint32_t readImpl(PointBuffer&);
+    boost::uint32_t readBufferImpl(PointBuffer&);


More information about the Liblas-commits mailing list