]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/CompatSet: mark FeatureSet member vars private
authorKefu Chai <kchai@redhat.com>
Mon, 4 May 2015 09:46:11 +0000 (17:46 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 4 May 2015 13:49:02 +0000 (21:49 +0800)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/include/CompatSet.h

index 03bf54d5ec48e10e092d3f726267b1e59916ec74..23381c933861e3092782231822040e6f9ca24e78 100644 (file)
@@ -29,19 +29,26 @@ struct CompatSet {
     Feature(uint64_t _id, const string& _name) : id(_id), name(_name) {}
   };
 
-  struct FeatureSet {
+  class FeatureSet {
     uint64_t mask;
     map <uint64_t,string> names;
 
+  public:
+    friend struct CompatSet;
+    friend class CephCompatSet_AllSet_Test;
+    friend class CephCompatSet_other_Test;
+    friend class CephCompatSet_merge_Test;
+    friend ostream& operator<<(ostream& out, const CompatSet::FeatureSet& fs);
+    friend ostream& operator<<(ostream& out, const CompatSet& compat);
     FeatureSet() : mask(1), names() {}
-    void insert(Feature f) {
+    void insert(const Feature& f) {
       assert(f.id > 0);
       assert(f.id < 64);
       mask |= ((uint64_t)1<<f.id);
       names[f.id] = f.name;
     }
 
-    bool contains(Feature f) const {
+    bool contains(const Feature& f) const {
       return names.count(f.id);
     }
     bool contains(uint64_t f) const {
@@ -55,13 +62,14 @@ struct CompatSet {
       assert(i != names.end());
       return i->second;
     }
+
     void remove(uint64_t f) {
       if (names.count(f)) {
        names.erase(f);
        mask &= ~((uint64_t)1<<f);
       }
     }
-    void remove(Feature f) {
+    void remove(const Feature& f) {
       remove(f.id);
     }