blob: 0e17b3b56a43d0fe188722d8e938e725efadf699 [file] [log] [blame]
Steve DiBenedetto5b433982014-01-29 17:14:27 -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_MGMT_INTERNAL_FACE_HPP
8#define NFD_MGMT_INTERNAL_FACE_HPP
9
10#include "face/face.hpp"
11#include "app-face.hpp"
12
13namespace nfd {
14
15class InternalFace : public Face, public AppFace
16{
17public:
Alexander Afanasyeva0a10fb2014-02-13 19:56:15 -080018 /**
19 * \brief InternalFace-related error
20 */
21 struct Error : public Face::Error
22 {
23 Error(const std::string& what) : Face::Error(what) {}
24 };
Steve DiBenedetto5b433982014-01-29 17:14:27 -070025
Steve DiBenedetto3970c892014-01-31 23:31:13 -070026 InternalFace();
Steve DiBenedetto5b433982014-01-29 17:14:27 -070027
28 // Overridden Face methods for forwarder
29
30 virtual void
31 sendInterest(const Interest& interest);
32
33 virtual void
34 sendData(const Data& data);
35
Alexander Afanasyeva0a10fb2014-02-13 19:56:15 -080036 virtual void
37 close();
38
Alexander Afanasyev93ce75e2014-02-18 19:45:34 -080039 /** \brief Get whether face is connected to a local app
40 *
41 * Always true for a InternalFace.
42 */
43 virtual bool
44 isLocal() const;
45
Steve DiBenedetto5b433982014-01-29 17:14:27 -070046 // Methods implementing AppFace interface. Do not invoke from forwarder.
47
48 virtual void
49 setInterestFilter(const Name& filter,
50 OnInterest onInterest);
51
52 virtual void
53 put(const Data& data);
54
55 virtual
56 ~InternalFace();
57
58private:
59
60 // void
61 // onConfig(ConfigFile::Node section, bool isDryRun);
62
63 std::map<Name, OnInterest> m_interestFilters;
Steve DiBenedetto5b433982014-01-29 17:14:27 -070064};
65
66} // namespace nfd
67
68#endif //NFD_MGMT_INTERNAL_FACE_HPP