NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ndn-app-face.h
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
2 /*
3  * Copyright (c) 2011 University of California, Los Angeles
4  *
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  *
18  * Authors: Alexander Afanasyev <alexander.afanasyev@ucla.edu>
19  Ilya Moiseenko <iliamo@cs.ucla.edu>
20  */
21 
22 #ifndef NDN_APP_FACE_H
23 #define NDN_APP_FACE_H
24 
25 #include "ndn-face.h"
26 #include "ns3/traced-callback.h"
27 
28 namespace ns3 {
29 
30 class Packet;
31 
32 namespace ndn {
33 
34 class Interest;
35 class Data;
36 
37 typedef Interest InterestHeader;
38 typedef Data DataHeader;
39 
40 class App;
41 
52 class AppFace : public Face
53 {
54 public:
55  static TypeId
56  GetTypeId ();
57 
61  AppFace (Ptr<App> app);
62  virtual ~AppFace();
63 
65  // methods overloaded from Face
66  virtual bool
67  SendInterest (Ptr<const Interest> interest);
68 
69  virtual bool
70  SendData (Ptr<const Data> data);
71 
72 public:
73  virtual std::ostream&
74  Print (std::ostream &os) const;
76 
77 private:
78  AppFace ();
79  AppFace (const AppFace &);
80  AppFace& operator= (const AppFace &);
81 
82 private:
83  Ptr<App> m_app;
84 };
85 
86 } // namespace ndn
87 } // namespace ns3
88 
89 #endif // NDN_APP_FACE_H
virtual bool SendData(Ptr< const Data > data)
Send out Dat packet through the face.
virtual std::ostream & Print(std::ostream &os) const
Print information about the face into the stream.
Virtual class defining NDN face.
Definition: ndn-face.h:58
Implementation of application Ndn face.
Definition: ndn-app-face.h:52
virtual bool SendInterest(Ptr< const Interest > interest)
Send out interest through the face.
Definition: ndn-app-face.cc:86