blob: 6fec93fd0cb4358ca4126559af7038347a80fe2c [file] [log] [blame]
Junxiao Shic1e12362014-01-24 20:03:26 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/**
3 * Copyright (C) 2014 Named Data Networking Project
4 * See COPYING for copyright and distribution information.
5 */
6
7#include "fib-nexthop.hpp"
8
Alexander Afanasyev18bbf812014-01-29 01:40:23 -08009namespace nfd {
Junxiao Shic1e12362014-01-24 20:03:26 -070010namespace fib {
11
12NextHop::NextHop(shared_ptr<Face> face)
13 : m_face(face), m_cost(0)
14{
15}
16
17NextHop::NextHop(const NextHop& other)
18 : m_face(other.m_face), m_cost(other.m_cost)
19{
20}
21
22shared_ptr<Face>
23NextHop::getFace() const
24{
25 return m_face;
26}
27
28void
Junxiao Shid9ee45c2014-02-27 15:38:11 -070029NextHop::setCost(uint32_t cost)
Junxiao Shic1e12362014-01-24 20:03:26 -070030{
31 m_cost = cost;
32}
33
Junxiao Shid9ee45c2014-02-27 15:38:11 -070034uint32_t
Junxiao Shic1e12362014-01-24 20:03:26 -070035NextHop::getCost() const
36{
37 return m_cost;
38}
39
40} // namespace fib
Alexander Afanasyev18bbf812014-01-29 01:40:23 -080041} // namespace nfd