Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Adam Osuchowski
Kea
Commits
df5cb12f
Commit
df5cb12f
authored
Jan 28, 2013
by
Mukund Sivaraman
Browse files
[2435] Make ZoneUpdater return a isc::dns::RRsetCollectionBase reference
parent
72383e89
Changes
7
Hide whitespace changes
Inline
Side-by-side
src/lib/datasrc/database.cc
View file @
df5cb12f
...
...
@@ -1439,7 +1439,7 @@ public:
virtual
ZoneFinder
&
getFinder
()
{
return
(
*
finder_
);
}
virtual
isc
::
d
atasrc
::
RRsetCollectionBase
&
getRRsetCollection
()
{
virtual
isc
::
d
ns
::
RRsetCollectionBase
&
getRRsetCollection
()
{
if
(
!
rrset_collection_
)
{
// This is only assigned the first time and remains for the
// lifetime of the DatabaseUpdater.
...
...
src/lib/datasrc/rrset_collection_base.h
View file @
df5cb12f
...
...
@@ -22,9 +22,6 @@
namespace
isc
{
namespace
datasrc
{
/// \brief A forward declaration
class
ZoneUpdater
;
/// \brief datasrc derivation of \c isc::dns::RRsetCollectionBase.
///
/// This is a default datasrc implementation of
...
...
src/lib/datasrc/tests/database_unittest.cc
View file @
df5cb12f
...
...
@@ -4244,7 +4244,7 @@ public:
{}
ZoneUpdaterPtr
updater
;
isc
::
d
atasrc
::
RRsetCollectionBase
&
collection
;
isc
::
d
ns
::
RRsetCollectionBase
&
collection
;
};
TYPED_TEST
(
RRsetCollectionTest
,
find
)
{
...
...
@@ -4429,7 +4429,7 @@ TYPED_TEST(RRsetCollectionAndUpdaterTest, updateThrows) {
// Test that using an RRsetCollection after calling commit() on the
// ZoneUpdater throws, as the RRsetCollection is disabled.
TYPED_TEST
(
RRsetCollectionAndUpdaterTest
,
useAfterCommitThrows
)
{
isc
::
d
atasrc
::
RRsetCollectionBase
&
collection
=
isc
::
d
ns
::
RRsetCollectionBase
&
collection
=
this
->
updater_
->
getRRsetCollection
();
// find() must not throw here.
...
...
src/lib/datasrc/tests/master_loader_callbacks_test.cc
View file @
df5cb12f
...
...
@@ -65,7 +65,7 @@ public:
virtual
ZoneFinder
&
getFinder
()
{
isc_throw
(
isc
::
NotImplemented
,
"Not to be called in this test"
);
}
virtual
isc
::
d
atasrc
::
RRsetCollectionBase
&
getRRsetCollection
()
{
virtual
isc
::
d
ns
::
RRsetCollectionBase
&
getRRsetCollection
()
{
isc_throw
(
isc
::
NotImplemented
,
"Not to be called in this test"
);
}
virtual
void
deleteRRset
(
const
isc
::
dns
::
AbstractRRset
&
)
{
...
...
src/lib/datasrc/tests/zone_loader_unittest.cc
View file @
df5cb12f
...
...
@@ -14,6 +14,7 @@
#include
<datasrc/zone_loader.h>
#include
<datasrc/data_source.h>
#include
<datasrc/rrset_collection_base.h>
#include
<datasrc/memory/zone_table_segment.h>
#include
<datasrc/memory/memory_client.h>
...
...
@@ -77,24 +78,16 @@ public:
RRClass
rrclass_
;
};
// Test implementation of RRsetCollectionBase.
// Test implementation of RRsetCollectionBase. This is currently just a
// wrapper around \c isc::datasrc::RRsetCollectionBase;
// \c isc::datasrc::RRsetCollectionBase may become an abstract class in
// the future.
class
TestRRsetCollection
:
public
isc
::
datasrc
::
RRsetCollectionBase
{
public:
TestRRsetCollection
(
ZoneUpdater
&
updater
,
const
isc
::
dns
::
RRClass
&
rrclass
)
:
isc
::
datasrc
::
RRsetCollectionBase
(
updater
,
rrclass
)
{}
virtual
~
TestRRsetCollection
()
{}
protected:
virtual
RRsetCollectionBase
::
IterPtr
getBeginning
()
{
isc_throw
(
isc
::
NotImplemented
,
"This method is not implemented."
);
}
virtual
RRsetCollectionBase
::
IterPtr
getEnd
()
{
isc_throw
(
isc
::
NotImplemented
,
"This method is not implemented."
);
}
};
// The updater isn't really correct according to the API. For example,
...
...
@@ -111,7 +104,7 @@ public:
virtual
ZoneFinder
&
getFinder
()
{
return
(
finder_
);
}
virtual
isc
::
d
atasrc
::
RRsetCollectionBase
&
getRRsetCollection
()
{
virtual
isc
::
d
ns
::
RRsetCollectionBase
&
getRRsetCollection
()
{
if
(
!
rrset_collection_
)
{
rrset_collection_
.
reset
(
new
TestRRsetCollection
(
*
this
,
client_
->
rrclass_
));
...
...
src/lib/datasrc/zone.h
View file @
df5cb12f
...
...
@@ -21,7 +21,7 @@
#include
<datasrc/exceptions.h>
#include
<datasrc/result.h>
#include
<d
atasrc
/rrset_collection_base.h>
#include
<d
ns
/rrset_collection_base.h>
#include
<utility>
#include
<vector>
...
...
@@ -741,9 +741,6 @@ typedef boost::shared_ptr<ZoneFinder::Context> ZoneFinderContextPtr;
/// \c ZoneFinder::Context object.
typedef
boost
::
shared_ptr
<
ZoneFinder
::
Context
>
ConstZoneFinderContextPtr
;
/// \brief A forward declaration
class
RRsetCollectionBase
;
/// The base class to make updates to a single zone.
///
/// On construction, each derived class object will start a "transaction"
...
...
@@ -863,7 +860,7 @@ public:
/// If an \c RRsetCollection is disabled, using methods such as \c find()
/// and using its iterator would cause an exception to be thrown. See
/// \c isc::datasrc::RRsetCollectionBase for details.
virtual
isc
::
d
atasrc
::
RRsetCollectionBase
&
getRRsetCollection
()
=
0
;
virtual
isc
::
d
ns
::
RRsetCollectionBase
&
getRRsetCollection
()
=
0
;
/// Add an RRset to a zone via the updater
///
...
...
src/lib/datasrc/zone_loader.cc
View file @
df5cb12f
...
...
@@ -20,12 +20,12 @@
#include
<datasrc/iterator.h>
#include
<datasrc/zone.h>
#include
<datasrc/logger.h>
#include
<datasrc/rrset_collection_base.h>
#include
<dns/rrset.h>
#include
<dns/zone_checker.h>
#include
<dns/name.h>
#include
<dns/rrclass.h>
#include
<dns/rrset_collection_base.h>
#include
<boost/bind.hpp>
...
...
@@ -33,6 +33,7 @@
using
isc
::
dns
::
Name
;
using
isc
::
dns
::
ConstRRsetPtr
;
using
isc
::
dns
::
RRsetCollectionBase
;
using
isc
::
dns
::
MasterLoader
;
namespace
isc
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment