From b93d23d75765599b7bcac4b39bb129ac6fb16ef6 Mon Sep 17 00:00:00 2001 From: Mathias Rav Date: Thu, 26 Jul 2012 16:27:16 +0200 Subject: [PATCH] Reorder file_base_crtp members in order of public/protected/private --- tpie/file_base_crtp.h | 51 ++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 27 deletions(-) diff --git a/tpie/file_base_crtp.h b/tpie/file_base_crtp.h index 36dd2be5e..9274d8771 100644 --- a/tpie/file_base_crtp.h +++ b/tpie/file_base_crtp.h @@ -47,9 +47,6 @@ namespace tpie { /////////////////////////////////////////////////////////////////////////////// template class file_base_crtp { - child_t & self() {return *static_cast(this);} - const child_t & self() const {return *static_cast(this);} - public: //////////////////////////////////////////////////////////////////////////////// /// Check if we can read from the file. @@ -199,24 +196,6 @@ class file_base_crtp { return m_fileAccessor->path(); } -protected: - inline void open_inner(const std::string & path, - access_type accessType, - memory_size_type userDataSize, - cache_hint cacheHint) throw(stream_exception) { - m_canRead = accessType == access_read || accessType == access_read_write; - m_canWrite = accessType == access_write || accessType == access_read_write; - m_fileAccessor->open(path, m_canRead, m_canWrite, m_itemSize, m_blockSize, userDataSize, cacheHint); - m_size = m_fileAccessor->size(); - m_open = true; - } - - - file_base_crtp(memory_size_type itemSize, double blockFactor, - file_accessor::file_accessor * fileAccessor); - - -public: ///////////////////////////////////////////////////////////////////////// /// \brief Open a file. /// @@ -278,12 +257,6 @@ class file_base_crtp { return m_open; } -protected: - template - void read_block(BT & b, stream_size_type block); - void get_block_check(stream_size_type block); - -public: ///////////////////////////////////////////////////////////////////////// /// \brief Get the size of the file measured in items. /// If there are streams of this file that have extended the stream length @@ -297,6 +270,26 @@ class file_base_crtp { } protected: + inline void open_inner(const std::string & path, + access_type accessType, + memory_size_type userDataSize, + cache_hint cacheHint) throw(stream_exception) { + m_canRead = accessType == access_read || accessType == access_read_write; + m_canWrite = accessType == access_write || accessType == access_read_write; + m_fileAccessor->open(path, m_canRead, m_canWrite, m_itemSize, m_blockSize, userDataSize, cacheHint); + m_size = m_fileAccessor->size(); + m_open = true; + } + + + file_base_crtp(memory_size_type itemSize, double blockFactor, + file_accessor::file_accessor * fileAccessor); + + + template + void read_block(BT & b, stream_size_type block); + void get_block_check(stream_size_type block); + memory_size_type m_blockItems; memory_size_type m_blockSize; bool m_canRead; @@ -307,6 +300,10 @@ class file_base_crtp { tpie::auto_ptr m_ownedTempFile; temp_file * m_tempFile; stream_size_type m_size; + +private: + child_t & self() {return *static_cast(this);} + const child_t & self() const {return *static_cast(this);} }; } // namespace tpie