Steve DiBenedetto | 5b43398 | 2014-01-29 17:14:27 -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_MGMT_INTERNAL_FACE_HPP |
| 8 | #define NFD_MGMT_INTERNAL_FACE_HPP |
| 9 | |
| 10 | #include "face/face.hpp" |
| 11 | #include "app-face.hpp" |
| 12 | |
| 13 | namespace nfd { |
| 14 | |
| 15 | class InternalFace : public Face, public AppFace |
| 16 | { |
| 17 | public: |
Alexander Afanasyev | a0a10fb | 2014-02-13 19:56:15 -0800 | [diff] [blame] | 18 | /** |
| 19 | * \brief InternalFace-related error |
| 20 | */ |
| 21 | struct Error : public Face::Error |
| 22 | { |
| 23 | Error(const std::string& what) : Face::Error(what) {} |
| 24 | }; |
Steve DiBenedetto | 5b43398 | 2014-01-29 17:14:27 -0700 | [diff] [blame] | 25 | |
Steve DiBenedetto | 3970c89 | 2014-01-31 23:31:13 -0700 | [diff] [blame] | 26 | InternalFace(); |
Steve DiBenedetto | 5b43398 | 2014-01-29 17:14:27 -0700 | [diff] [blame] | 27 | |
| 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 Afanasyev | a0a10fb | 2014-02-13 19:56:15 -0800 | [diff] [blame] | 36 | virtual void |
| 37 | close(); |
| 38 | |
Steve DiBenedetto | 5b43398 | 2014-01-29 17:14:27 -0700 | [diff] [blame] | 39 | // Methods implementing AppFace interface. Do not invoke from forwarder. |
| 40 | |
| 41 | virtual void |
| 42 | setInterestFilter(const Name& filter, |
| 43 | OnInterest onInterest); |
| 44 | |
| 45 | virtual void |
| 46 | put(const Data& data); |
| 47 | |
| 48 | virtual |
| 49 | ~InternalFace(); |
| 50 | |
| 51 | private: |
| 52 | |
| 53 | // void |
| 54 | // onConfig(ConfigFile::Node section, bool isDryRun); |
| 55 | |
| 56 | std::map<Name, OnInterest> m_interestFilters; |
Steve DiBenedetto | 5b43398 | 2014-01-29 17:14:27 -0700 | [diff] [blame] | 57 | }; |
| 58 | |
| 59 | } // namespace nfd |
| 60 | |
| 61 | #endif //NFD_MGMT_INTERNAL_FACE_HPP |