blob: 92100b6ae4202c3273f23a48279e6d4398e8124f [file] [log] [blame]
Junxiao Shicbba04c2014-01-26 14:21:22 -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#ifndef NFD_TEST_FACE_DUMMY_FACE_HPP
8#define NFD_TEST_FACE_DUMMY_FACE_HPP
9
10#include "face/face.hpp"
Alexander Afanasyevbd220a02014-02-20 00:29:56 -080011#include "face/local-face.hpp"
Junxiao Shicbba04c2014-01-26 14:21:22 -070012
Alexander Afanasyev18bbf812014-01-29 01:40:23 -080013namespace nfd {
Junxiao Shicbba04c2014-01-26 14:21:22 -070014
15/** \class DummyFace
16 * \brief provides a Face that cannot communicate
17 * for unit testing only
18 */
Alexander Afanasyevbd220a02014-02-20 00:29:56 -080019template<class FaceBase>
20class DummyFaceImpl : public FaceBase
Junxiao Shicbba04c2014-01-26 14:21:22 -070021{
22public:
Junxiao Shicbba04c2014-01-26 14:21:22 -070023 virtual void
Junxiao Shi8c8d2182014-01-30 22:33:00 -070024 sendInterest(const Interest& interest)
Junxiao Shicbba04c2014-01-26 14:21:22 -070025 {
26 }
27
28 virtual void
Junxiao Shi8c8d2182014-01-30 22:33:00 -070029 sendData(const Data& data)
Junxiao Shicbba04c2014-01-26 14:21:22 -070030 {
31 }
Alexander Afanasyeva0a10fb2014-02-13 19:56:15 -080032
33 virtual void
34 close()
35 {
36 }
Alexander Afanasyev93ce75e2014-02-18 19:45:34 -080037
Alexander Afanasyev93ce75e2014-02-18 19:45:34 -080038private:
Junxiao Shicbba04c2014-01-26 14:21:22 -070039};
40
Alexander Afanasyevbd220a02014-02-20 00:29:56 -080041typedef DummyFaceImpl<Face> DummyFace;
42typedef DummyFaceImpl<LocalFace> DummyLocalFace;
43
Alexander Afanasyev18bbf812014-01-29 01:40:23 -080044} // namespace nfd
Junxiao Shicbba04c2014-01-26 14:21:22 -070045
46#endif // TEST_FACE_DUMMY_FACE_HPP