blob: 3ce32e34146f1b7b53570000f9fdc90283f6bb3c [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
Steve DiBenedetto2c2b8892014-02-27 11:46:48 -070013#include "command-validator.hpp"
14
Steve DiBenedetto5b433982014-01-29 17:14:27 -070015namespace nfd {
16
17class InternalFace : public Face, public AppFace
18{
19public:
Alexander Afanasyeva0a10fb2014-02-13 19:56:15 -080020 /**
21 * \brief InternalFace-related error
22 */
23 struct Error : public Face::Error
24 {
25 Error(const std::string& what) : Face::Error(what) {}
26 };
Steve DiBenedetto5b433982014-01-29 17:14:27 -070027
Steve DiBenedetto3970c892014-01-31 23:31:13 -070028 InternalFace();
Steve DiBenedetto5b433982014-01-29 17:14:27 -070029
Steve DiBenedetto2c2b8892014-02-27 11:46:48 -070030 CommandValidator&
31 getValidator();
32
33 virtual
34 ~InternalFace();
35
Steve DiBenedetto5b433982014-01-29 17:14:27 -070036 // Overridden Face methods for forwarder
37
38 virtual void
39 sendInterest(const Interest& interest);
40
41 virtual void
42 sendData(const Data& data);
43
Alexander Afanasyeva0a10fb2014-02-13 19:56:15 -080044 virtual void
45 close();
46
Steve DiBenedetto5b433982014-01-29 17:14:27 -070047 // Methods implementing AppFace interface. Do not invoke from forwarder.
48
49 virtual void
50 setInterestFilter(const Name& filter,
51 OnInterest onInterest);
52
53 virtual void
54 put(const Data& data);
55
Steve DiBenedetto5b433982014-01-29 17:14:27 -070056private:
57
Steve DiBenedetto5b433982014-01-29 17:14:27 -070058 std::map<Name, OnInterest> m_interestFilters;
Steve DiBenedetto2c2b8892014-02-27 11:46:48 -070059 CommandValidator m_validator;
Steve DiBenedetto5b433982014-01-29 17:14:27 -070060};
61
Steve DiBenedetto2c2b8892014-02-27 11:46:48 -070062inline CommandValidator&
63InternalFace::getValidator()
64{
65 return m_validator;
66}
67
68
Steve DiBenedetto5b433982014-01-29 17:14:27 -070069} // namespace nfd
70
71#endif //NFD_MGMT_INTERNAL_FACE_HPP