face: consistently use the template method pattern in ProtocolFactory
Change-Id: Ied0bf02cfcdffc7e9b2c28c5452441c01f98ccbc
diff --git a/daemon/face/ethernet-factory.cpp b/daemon/face/ethernet-factory.cpp
index aab8aa4..7603343 100644
--- a/daemon/face/ethernet-factory.cpp
+++ b/daemon/face/ethernet-factory.cpp
@@ -37,7 +37,7 @@
NFD_REGISTER_PROTOCOL_FACTORY(EthernetFactory);
const std::string&
-EthernetFactory::getId()
+EthernetFactory::getId() noexcept
{
static std::string id("ether");
return id;
@@ -53,8 +53,8 @@
}
void
-EthernetFactory::processConfig(OptionalConfigSection configSection,
- FaceSystem::ConfigContext& context)
+EthernetFactory::doProcessConfig(OptionalConfigSection configSection,
+ FaceSystem::ConfigContext& context)
{
// ether
// {
@@ -165,18 +165,15 @@
}
void
-EthernetFactory::createFace(const CreateFaceRequest& req,
- const FaceCreatedCallback& onCreated,
- const FaceCreationFailedCallback& onFailure)
+EthernetFactory::doCreateFace(const CreateFaceRequest& req,
+ const FaceCreatedCallback& onCreated,
+ const FaceCreationFailedCallback& onFailure)
{
- BOOST_ASSERT(req.remoteUri.isCanonical());
-
if (!req.localUri || req.localUri->getScheme() != "dev") {
NFD_LOG_TRACE("Cannot create unicast Ethernet face without dev:// LocalUri");
onFailure(406, "Creation of unicast Ethernet faces requires a LocalUri with dev:// scheme");
return;
}
- BOOST_ASSERT(req.localUri->isCanonical());
if (req.params.persistency == ndn::nfd::FACE_PERSISTENCY_ON_DEMAND) {
NFD_LOG_TRACE("createFace does not support FACE_PERSISTENCY_ON_DEMAND");
@@ -228,12 +225,11 @@
auto channel = std::make_shared<EthernetChannel>(localEndpoint, idleTimeout);
m_channels[localEndpoint->getName()] = channel;
-
return channel;
}
std::vector<shared_ptr<const Channel>>
-EthernetFactory::getChannels() const
+EthernetFactory::doGetChannels() const
{
return getChannelsFromMap(m_channels);
}
@@ -348,7 +344,7 @@
}
void
-EthernetFactory::applyConfig(const FaceSystem::ConfigContext& context)
+EthernetFactory::applyConfig(const FaceSystem::ConfigContext&)
{
if (m_unicastConfig.isEnabled) {
providedSchemes.insert("ether");