blob: 3e06597883f4d307f5d622139ca68f5ed41b0111 [file] [log] [blame]
Alexander Afanasyevc74a6022011-08-15 20:01:35 -07001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
Alexander Afanasyev98256102011-08-14 01:00:02 -07002/*
Ilya Moiseenko956d0542012-01-02 15:26:40 -08003 * Copyright (c) 2011 University of California, Los Angeles
Alexander Afanasyev98256102011-08-14 01:00:02 -07004 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
Ilya Moiseenko1cf6b0a2011-08-29 13:02:34 -070018 * Authors: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19 Ilya Moiseenko <iliamo@cs.ucla.edu>
Alexander Afanasyev98256102011-08-14 01:00:02 -070020 */
Ilya Moiseenko1cf6b0a2011-08-29 13:02:34 -070021
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070022#ifndef NDN_APP_FACE_H
23#define NDN_APP_FACE_H
Alexander Afanasyev98256102011-08-14 01:00:02 -070024
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -070025#include "ns3/ndnSIM/model/ndn-common.hpp"
26
Alexander Afanasyev0c395372014-12-20 15:54:02 -080027#include "ndn-face.hpp"
Ilya Moiseenko1a8be032012-01-18 12:51:09 -080028#include "ns3/traced-callback.h"
Alexander Afanasyev98256102011-08-14 01:00:02 -070029
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070030namespace ns3 {
Alexander Afanasyev98256102011-08-14 01:00:02 -070031
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070032class Packet;
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070033
34namespace ndn {
35
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070036class App;
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070037
Alexander Afanasyev98256102011-08-14 01:00:02 -070038/**
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070039 * \ingroup ndn-face
40 * \brief Implementation of application Ndn face
Alexander Afanasyev98256102011-08-14 01:00:02 -070041 *
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070042 * This class defines basic functionality of Ndn face. Face is core
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070043 * component responsible for actual delivery of data packet to and
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070044 * from Ndn stack
Alexander Afanasyev98256102011-08-14 01:00:02 -070045 *
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070046 * \see AppFace, NdnNetDeviceFace, NdnIpv4Face, NdnUdpFace
Alexander Afanasyev98256102011-08-14 01:00:02 -070047 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080048class AppFace : public Face {
Alexander Afanasyev98256102011-08-14 01:00:02 -070049public:
Alexander Afanasyevcbe92ae2011-12-16 13:06:18 -080050 static TypeId
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080051 GetTypeId();
Alexander Afanasyevcbe92ae2011-12-16 13:06:18 -080052
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070053 /**
54 * \brief Default constructor
55 */
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080056 AppFace(Ptr<App> app);
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070057 virtual ~AppFace();
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080058
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070059 ////////////////////////////////////////////////////////////////////
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070060 // methods overloaded from Face
Alexander Afanasyev1c0248b2012-07-24 15:59:50 -070061 virtual bool
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -070062 SendInterest(shared_ptr<const Interest> interest);
Alexander Afanasyev5bee19e2013-07-10 14:33:57 -070063
64 virtual bool
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -070065 SendData(shared_ptr<const Data> data);
Alexander Afanasyev09c7deb2011-11-23 14:50:10 -080066
67public:
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070068 virtual std::ostream&
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080069 Print(std::ostream& os) const;
Alexander Afanasyev56f79ea2011-08-17 23:54:27 -070070 ////////////////////////////////////////////////////////////////////
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080071
Alexander Afanasyev98256102011-08-14 01:00:02 -070072private:
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080073 AppFace();
74 AppFace(const AppFace&); ///< \brief Disabled copy constructor
Spyridon Mastorakis53e922f2014-10-17 17:29:26 -070075
Alexander Afanasyevbe55cf62014-12-20 17:51:09 -080076 AppFace&
77 operator=(const AppFace&); ///< \brief Disabled copy operator
Alexander Afanasyevc5a23e22011-09-07 00:37:36 -070078
79private:
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070080 Ptr<App> m_app;
Alexander Afanasyev98256102011-08-14 01:00:02 -070081};
82
Alexander Afanasyev2b4c9472012-08-09 15:00:38 -070083} // namespace ndn
Alexander Afanasyev98256102011-08-14 01:00:02 -070084} // namespace ns3
85
Alexander Afanasyev4aac5572012-08-09 10:49:55 -070086#endif // NDN_APP_FACE_H