[Liblas-commits] hg-main-tree: supportsIterator is a const method

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Apr 1 16:48:23 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/a3923ec16e23
changeset: 491:a3923ec16e23
user:      Howard Butler <hobu.inc at gmail.com>
date:      Fri Apr 01 15:48:01 2011 -0500
description:
supportsIterator is a const method
Subject: hg-main-tree: move most reading functions into the IteratorBase

details:   http://hg.libpc.orghg-main-tree/rev/b2d9c7ff4041
changeset: 492:b2d9c7ff4041
user:      Howard Butler <hobu.inc at gmail.com>
date:      Fri Apr 01 15:48:16 2011 -0500
description:
move most reading functions into the IteratorBase

diffstat:

 include/libpc/Stage.hpp                    |    2 +-
 include/libpc/drivers/faux/Reader.hpp      |    2 +-
 include/libpc/drivers/las/Reader.hpp       |    2 +-
 include/libpc/drivers/liblas/Reader.hpp    |    2 +-
 include/libpc/drivers/oci/Common.hpp       |   31 ++
 include/libpc/drivers/oci/Iterator.hpp     |   16 +-
 include/libpc/drivers/oci/Reader.hpp       |   54 +----
 include/libpc/filters/CacheFilter.hpp      |    2 +-
 include/libpc/filters/Chipper.hpp          |    2 +-
 include/libpc/filters/ColorFilter.hpp      |    2 +-
 include/libpc/filters/CropFilter.hpp       |    2 +-
 include/libpc/filters/DecimationFilter.hpp |    2 +-
 include/libpc/filters/MosaicFilter.hpp     |    2 +-
 src/Writer.cpp                             |   53 +++-
 src/drivers/oci/Iterator.cpp               |  292 +++++++++++++++++++++++++++-
 src/drivers/oci/Reader.cpp                 |  303 +----------------------------
 16 files changed, 391 insertions(+), 378 deletions(-)

diffs (truncated from 1053 to 300 lines):

diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/Stage.hpp
--- a/include/libpc/Stage.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/Stage.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -72,7 +72,7 @@
     const SpatialReference& getSpatialReference() const;
     const Metadata::Array& getMetadata() const;
 
-    virtual bool supportsIterator (StageIteratorType) const { return false; }
+    virtual bool supportsIterator (StageIteratorType) const = 0;
 
     virtual SequentialIterator* createSequentialIterator() const { return NULL; }
     virtual RandomIterator* createRandomIterator() const  { return NULL; }
diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/drivers/faux/Reader.hpp
--- a/include/libpc/drivers/faux/Reader.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/drivers/faux/Reader.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -81,7 +81,7 @@
 
     Mode getMode() const;
     
-    bool supportsIterator (StageIteratorType t) 
+    bool supportsIterator (StageIteratorType t) const
     {   
         if (t == StageIterator_Sequential ) return true;
         if (t == StageIterator_Random ) return true;
diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/drivers/las/Reader.hpp
--- a/include/libpc/drivers/las/Reader.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/drivers/las/Reader.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -59,7 +59,7 @@
 
     const std::string& getFileName() const;
 
-    bool supportsIterator (StageIteratorType t) 
+    bool supportsIterator (StageIteratorType t) const
     {   
         if (t == StageIterator_Sequential ) return true;
         if (t == StageIterator_Random ) return true;
diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/drivers/liblas/Reader.hpp
--- a/include/libpc/drivers/liblas/Reader.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/drivers/liblas/Reader.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -70,7 +70,7 @@
     bool hasColorData() const;
     bool hasWaveData() const;
 
-    bool supportsIterator (StageIteratorType t) 
+    bool supportsIterator (StageIteratorType t) const
     {   
         if (t == StageIterator_Sequential ) return true;
         if (t == StageIterator_Random ) return true;
diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/drivers/oci/Common.hpp
--- a/include/libpc/drivers/oci/Common.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/drivers/oci/Common.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -64,6 +64,37 @@
 #define compare_no_case(a,b,n)  strncasecmp( (a), (b), (n) )
 #endif
 
+enum QueryType
+{
+    QUERY_SDO_PC,
+    QUERY_SDO_PC_BLK,
+    QUERY_BLK_TABLE,
+    QUERY_UNKNOWN
+};
+
+class Block
+{
+    
+public:
+    
+    Block() {};
+    
+    boost::int32_t           obj_id;
+    boost::int32_t           blk_id;
+    sdo_geometry*   blk_extent;
+    sdo_orgscl_type* blk_domain;
+
+    double           pcblk_min_res;
+    double           pcblk_max_res;
+    boost::int32_t           num_points;
+    boost::int32_t           num_unsorted_points;
+    boost::int32_t           pt_sort_dim;
+
+
+private:
+    boost::uint32_t m_capacity;
+};
+
 class LIBPC_DLL Options
 {
 
diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/drivers/oci/Iterator.hpp
--- a/include/libpc/drivers/oci/Iterator.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/drivers/oci/Iterator.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -40,12 +40,12 @@
 #include <libpc/Iterator.hpp>
 
 #include <libpc/drivers/oci/Common.hpp>
+#include <libpc/drivers/oci/Reader.hpp>
 
 #include <string>
 
 namespace libpc { namespace drivers { namespace oci {
 
-class Reader;
 
 class IteratorBase
 {
@@ -58,13 +58,25 @@
     
     boost::uint32_t readBuffer(PointBuffer& data);
 
+    Statement m_statement;
     bool m_at_end;
+    QueryType m_querytype;
+    Block* m_block;
+    OCILobLocator* m_locator;
+
+    sdo_pc* m_pc;
+    sdo_pc_blk* m_block_table_type;
+    std::vector<boost::uint8_t> m_points;
+    boost::uint32_t m_blob_read_byte_size;    
 
 private:
     const Reader& m_reader;
     
     IteratorBase& operator=(const IteratorBase&); // not implemented
-    IteratorBase(const IteratorBase&); // not implemented};
+    IteratorBase(const IteratorBase&); // not implemented;
+    
+    void doBlockTableDefine();
+    QueryType describeQueryType() const;
 
 };
 
diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/drivers/oci/Reader.hpp
--- a/include/libpc/drivers/oci/Reader.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/drivers/oci/Reader.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -47,28 +47,7 @@
 
 namespace libpc { namespace drivers { namespace oci {
 
-class Block
-{
-    
-public:
-    
-    Block() {};
-    
-    boost::int32_t           obj_id;
-    boost::int32_t           blk_id;
-    sdo_geometry*   blk_extent;
-    sdo_orgscl_type* blk_domain;
 
-    double           pcblk_min_res;
-    double           pcblk_max_res;
-    boost::int32_t           num_points;
-    boost::int32_t           num_unsorted_points;
-    boost::int32_t           pt_sort_dim;
-
-
-private:
-    boost::uint32_t m_capacity;
-};
 
 class LIBPC_DLL Reader : public libpc::Stage
 {
@@ -79,29 +58,20 @@
     
     const std::string& getName() const;
  
-    bool supportsIterator (StageIteratorType t) 
+    bool supportsIterator (StageIteratorType t) const
     {   
         if (t == StageIterator_Sequential ) return true;
         return false;
     }
 
-    enum QueryType
-    {
-        QUERY_SDO_PC,
-        QUERY_SDO_PC_BLK,
-        QUERY_BLK_TABLE,
-        QUERY_UNKNOWN
-    };
+
     
     libpc::SequentialIterator* createSequentialIterator() const;
     Connection getConnection () const { return m_connection;}
     Options& getOptions() const { return m_options; }
-    
-    sdo_pc* getPCObject() const { return m_pc; }
-    sdo_pc_blk* getPCBlockObject() const { return m_block_table_type; }
-    
-    Block* getBlock() const { return m_block_table; }
-    bool fetchNext() const;
+    std::string getQuery() const;
+    bool isVerbose() const;
+
 private:
 
     Reader& operator=(const Reader&); // not implemented
@@ -111,21 +81,11 @@
     void Debug();
     void registerFields();
     void fetchPCFields();
-    QueryType describeQueryType();
-    void doBlockTableDefine();
+    // void doBlockTableDefine();
 
     Options& m_options;
     Connection m_connection;
-    Statement m_statement;
-    bool m_verbose;
-    QueryType m_qtype;
-    
-    sdo_pc* m_pc;
-    sdo_pc_blk* m_block_table_type;
-    Block* m_block_table;
-    OCILobLocator* m_locator;
-    std::vector<boost::uint8_t> m_points;
-    boost::uint32_t m_blob_read_byte_size;
+
 
 };
 
diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/filters/CacheFilter.hpp
--- a/include/libpc/filters/CacheFilter.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/filters/CacheFilter.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -89,7 +89,7 @@
                        boost::uint64_t& numCacheInsertMisses,
                        boost::uint64_t& numCacheInsertHits) const;
 
-    bool supportsIterator (StageIteratorType t) 
+    bool supportsIterator (StageIteratorType t) const
     {   
         if (t == StageIterator_Sequential ) return true;
         if (t == StageIterator_Random ) return true;
diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/filters/Chipper.hpp
--- a/include/libpc/filters/Chipper.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/filters/Chipper.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -167,7 +167,7 @@
 
     const std::string& getName() const ;
 
-    bool supportsIterator (StageIteratorType t) 
+    bool supportsIterator (StageIteratorType t) const
     {   
         if (t == StageIterator_Sequential ) return true;
         return false;
diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/filters/ColorFilter.hpp
--- a/include/libpc/filters/ColorFilter.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/filters/ColorFilter.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -62,7 +62,7 @@
 
     void getColor(float value, boost::uint8_t& red, boost::uint8_t& green, boost::uint8_t& blue) const;
 
-    bool supportsIterator (StageIteratorType t) 
+    bool supportsIterator (StageIteratorType t) const
     {   
         if (t == StageIterator_Sequential ) return true;
 
diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/filters/CropFilter.hpp
--- a/include/libpc/filters/CropFilter.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/filters/CropFilter.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -59,7 +59,7 @@
 
     const std::string& getName() const;
 
-    bool supportsIterator (StageIteratorType t) 
+    bool supportsIterator (StageIteratorType t) const
     {   
         if (t == StageIterator_Sequential ) return true;
 
diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/filters/DecimationFilter.hpp
--- a/include/libpc/filters/DecimationFilter.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/filters/DecimationFilter.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -57,7 +57,7 @@
 
     const std::string& getName() const;
 
-    bool supportsIterator (StageIteratorType t) 
+    bool supportsIterator (StageIteratorType t) const
     {   
         if (t == StageIterator_Sequential ) return true;
 
diff -r 1747c2f81b4a -r b2d9c7ff4041 include/libpc/filters/MosaicFilter.hpp
--- a/include/libpc/filters/MosaicFilter.hpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/include/libpc/filters/MosaicFilter.hpp	Fri Apr 01 15:48:16 2011 -0500
@@ -59,7 +59,7 @@
 
     const std::vector<const Stage*>& getPrevStages() const;
 
-    bool supportsIterator (StageIteratorType t) 
+    bool supportsIterator (StageIteratorType t) const
     {   
         if (t == StageIterator_Sequential ) return true;
         if (t == StageIterator_Random) return false; // BUG: could be true
diff -r 1747c2f81b4a -r b2d9c7ff4041 src/Writer.cpp
--- a/src/Writer.cpp	Fri Apr 01 13:53:59 2011 -0500
+++ b/src/Writer.cpp	Fri Apr 01 15:48:16 2011 -0500
@@ -79,7 +79,20 @@


More information about the Liblas-commits mailing list