Commit 503a7b06 authored by Mukund Sivaraman's avatar Mukund Sivaraman
Browse files

[2208] Constify and use references in some args

parent 4ea73cff
......@@ -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));
......
......@@ -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_;
};
}
......
......@@ -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
......
......@@ -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
///
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment