Browse Source

[2208] Constify and use references in some args

Mukund Sivaraman 12 years ago
parent
commit
503a7b06ae

+ 1 - 1
src/lib/datasrc/memory/zone_table.cc

@@ -47,7 +47,7 @@ typedef boost::function<void(ZoneData*)> ZoneDataDeleterType;
 }
 
 ZoneTable*
-ZoneTable::create(util::MemorySegment& mem_sgmt, RRClass zone_class) {
+ZoneTable::create(util::MemorySegment& mem_sgmt, const RRClass& zone_class) {
     SegmentObjectHolder<ZoneTableTree, ZoneDataDeleterType> holder(
         mem_sgmt, ZoneTableTree::create(mem_sgmt),
         boost::bind(deleteZoneData, &mem_sgmt, _1, zone_class));

+ 3 - 3
src/lib/datasrc/memory/zone_table.h

@@ -102,7 +102,7 @@ private:
     /// This constructor internally involves resource allocation, and if
     /// it fails, a corresponding standard exception will be thrown.
     /// It never throws an exception otherwise.
-    ZoneTable(dns::RRClass rrclass, ZoneTableTree* zones) :
+    ZoneTable(const dns::RRClass& rrclass, ZoneTableTree* zones) :
         rrclass_(rrclass),
         zones_(zones)
     {}
@@ -121,7 +121,7 @@ public:
     /// \param zone_class The RR class of the zone.  It must be the RR class
     /// that is supposed to be associated to the zone table.
     static ZoneTable* create(util::MemorySegment& mem_sgmt,
-                             dns::RRClass zone_class);
+                             const dns::RRClass& zone_class);
 
     /// \brief Destruct and deallocate \c ZoneTable
     ///
@@ -186,7 +186,7 @@ public:
     FindResult findZone(const isc::dns::Name& name) const;
 
 private:
-    dns::RRClass rrclass_;
+    const dns::RRClass rrclass_;
     boost::interprocess::offset_ptr<ZoneTableTree> zones_;
 };
 }

+ 1 - 1
src/lib/datasrc/memory/zone_table_segment.cc

@@ -22,7 +22,7 @@ namespace datasrc {
 namespace memory {
 
 ZoneTableSegment*
-ZoneTableSegment::create(const isc::data::Element&, RRClass rrclass) {
+ZoneTableSegment::create(const isc::data::Element&, const RRClass& rrclass) {
     /// FIXME: For now, we always return ZoneTableSegmentLocal. This
     /// should be updated eventually to parse the passed Element
     /// argument and construct a corresponding ZoneTableSegment

+ 1 - 1
src/lib/datasrc/memory/zone_table_segment.h

@@ -98,7 +98,7 @@ public:
     ///               is returned.
     /// \return Returns a ZoneTableSegment object
     static ZoneTableSegment* create(const isc::data::Element& config,
-                                    isc::dns::RRClass rrclass);
+                                    const isc::dns::RRClass& rrclass);
 
     /// \brief Destroy a ZoneTableSegment
     ///