/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/**
 * Copyright (c) 2014-2016,  Regents of the University of California,
 *                           Arizona Board of Regents,
 *                           Colorado State University,
 *                           University Pierre & Marie Curie, Sorbonne University,
 *                           Washington University in St. Louis,
 *                           Beijing Institute of Technology,
 *                           The University of Memphis.
 *
 * This file is part of NFD (Named Data Networking Forwarding Daemon).
 * See AUTHORS.md for complete list of NFD authors and contributors.
 *
 * NFD is free software: you can redistribute it and/or modify it under the terms
 * of the GNU General Public License as published by the Free Software Foundation,
 * either version 3 of the License, or (at your option) any later version.
 *
 * NFD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
 * PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along with
 * NFD, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef NFD_DAEMON_FW_STRATEGY_REGISTRY_HPP
#define NFD_DAEMON_FW_STRATEGY_REGISTRY_HPP

#include "common.hpp"

namespace nfd {

class Forwarder;

namespace fw {

class Strategy;

unique_ptr<Strategy>
makeDefaultStrategy(Forwarder& forwarder);

void
installStrategies(Forwarder& forwarder);


typedef std::function<unique_ptr<Strategy>(Forwarder&)> StrategyCreateFunc;

void
registerStrategyImpl(const Name& strategyName, const StrategyCreateFunc& createFunc);

/** \brief registers a strategy to be installed later
 */
template<typename S>
void
registerStrategy()
{
  registerStrategyImpl(S::STRATEGY_NAME,
                       [] (Forwarder& forwarder) { return make_unique<S>(ref(forwarder)); });
}

/** \brief registers a built-in strategy
 *
 *  This macro should appear once in .cpp of each built-in strategy.
 */
#define NFD_REGISTER_STRATEGY(StrategyType)                       \
static class NfdAuto ## StrategyType ## StrategyRegistrationClass \
{                                                                 \
public:                                                           \
  NfdAuto ## StrategyType ## StrategyRegistrationClass()          \
  {                                                               \
    ::nfd::fw::registerStrategy<StrategyType>();                  \
  }                                                               \
} g_nfdAuto ## StrategyType ## StrategyRegistrationVariable

} // namespace fw
} // namespace nfd

#endif // NFD_DAEMON_FW_STRATEGY_REGISTRY_HPP
