]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: improve const-correctness in the front-end infrastructure.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Tue, 26 Jul 2016 10:17:58 +0000 (12:17 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 21 Oct 2016 20:57:17 +0000 (22:57 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/rgw_client_io.cc
src/rgw/rgw_client_io.h
src/rgw/rgw_lib.h

index 090636bbf90d338f4606eb2149d445f9fb51fb56..659d31c0ae62dc8767a1180e3deb93acd4a76076 100644 (file)
@@ -22,6 +22,7 @@ void RGWClientIO::init(CephContext *cct) {
   }
 }
 
+
 int RGWStreamIOBase::print(const char *format, ...)
 {
 #define LARGE_ENOUGH 128
@@ -76,6 +77,7 @@ int RGWStreamIOBase::read(char *buf, int max, int *actual, bool hash /* = false
   return 0;
 }
 
+
 int RGWStreamIO::write(const char* const buf, const int len)
 {
   const auto ret = RGWStreamIOBase::write(buf, len);
index 98234f65d03c1a05d871953598d9cee9a81d39ef..f3fc1e245d403e7eafb8d59878856b2cfcaeb920 100644 (file)
@@ -23,12 +23,14 @@ public:
   virtual ~RGWClientIO() {}
 
   void init(CephContext *cct);
-  RGWEnv& get_env() { return env; }
+  RGWEnv& get_env() {
+    return env;
+  }
 
   virtual int complete_request() = 0; /* XXX signature likely changing */
 
-  virtual uint64_t get_bytes_sent() = 0;
-  virtual uint64_t get_bytes_received() = 0;
+  virtual uint64_t get_bytes_sent() const = 0;
+  virtual uint64_t get_bytes_received() const = 0;
 }; /* RGWClient IO */
 
 class RGWStreamIOBase : public RGWClientIO {
@@ -57,7 +59,9 @@ class RGWStreamIO : public RGWStreamIOBase {
 
   SHA256 *sha256_hash;
 
-  bool account() { return _account; }
+  bool account() const {
+    return _account;
+  }
 
 public:
   virtual ~RGWStreamIO() {}
@@ -77,11 +81,11 @@ public:
     _account = _accnt;
   }
 
-  uint64_t get_bytes_sent() override {
+  uint64_t get_bytes_sent() const override {
     return bytes_sent;
   }
 
-  uint64_t get_bytes_received() override {
+  uint64_t get_bytes_received() const override {
     return bytes_received;
   }
 }; /* RGWStreamIO */
index 1689d67e4dfe324e5207b303c02848d6aeb2241b..5c66c2b26df0732140c195bfa55cbdb557efde3b 100644 (file)
@@ -60,7 +60,7 @@ namespace rgw {
     RGWLibIO(const RGWUserInfo &_user_info)
       : user_info(_user_info) {}
 
-    virtual void init_env(CephContext *cct) {}
+    virtual void init_env(CephContext *cct) override {}
 
     const RGWUserInfo& get_user() {
       return user_info;
@@ -75,15 +75,15 @@ namespace rgw {
     int complete_header();
     int send_content_length(uint64_t len);
 
-    int complete_request() { /* XXX */
+    int complete_request() override { /* XXX */
       return 0;
     };
 
-    uint64_t get_bytes_sent() override {
+    uint64_t get_bytes_sent() const override {
       return 0;
     }
 
-    uint64_t get_bytes_received() override {
+    uint64_t get_bytes_received() const override {
       return 0;
     }