Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 1 | /* -*- 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 | #ifndef NFD_TEST_FACE_DUMMY_FACE_HPP |
| 8 | #define NFD_TEST_FACE_DUMMY_FACE_HPP |
| 9 | |
| 10 | #include "face/face.hpp" |
| 11 | |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 12 | namespace nfd { |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 13 | |
| 14 | /** \class DummyFace |
| 15 | * \brief provides a Face that cannot communicate |
| 16 | * for unit testing only |
| 17 | */ |
| 18 | class DummyFace : public Face |
| 19 | { |
| 20 | public: |
Alexander Afanasyev | 93ce75e | 2014-02-18 19:45:34 -0800 | [diff] [blame^] | 21 | explicit |
| 22 | DummyFace(bool isLocal = false) |
| 23 | : m_isLocal(isLocal) |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 24 | { |
| 25 | } |
| 26 | |
| 27 | virtual void |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 28 | sendInterest(const Interest& interest) |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 29 | { |
| 30 | } |
| 31 | |
| 32 | virtual void |
Junxiao Shi | 8c8d218 | 2014-01-30 22:33:00 -0700 | [diff] [blame] | 33 | sendData(const Data& data) |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 34 | { |
| 35 | } |
Alexander Afanasyev | a0a10fb | 2014-02-13 19:56:15 -0800 | [diff] [blame] | 36 | |
| 37 | virtual void |
| 38 | close() |
| 39 | { |
| 40 | } |
Alexander Afanasyev | 93ce75e | 2014-02-18 19:45:34 -0800 | [diff] [blame^] | 41 | |
| 42 | virtual bool |
| 43 | isLocal() const |
| 44 | { |
| 45 | return m_isLocal; |
| 46 | } |
| 47 | |
| 48 | private: |
| 49 | bool m_isLocal; |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 50 | }; |
| 51 | |
Alexander Afanasyev | 18bbf81 | 2014-01-29 01:40:23 -0800 | [diff] [blame] | 52 | } // namespace nfd |
Junxiao Shi | cbba04c | 2014-01-26 14:21:22 -0700 | [diff] [blame] | 53 | |
| 54 | #endif // TEST_FACE_DUMMY_FACE_HPP |