Alexander Afanasyev | 79a5bd6 | 2013-06-23 22:12:39 -0700 | [diff] [blame] | 1 | /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 | /* |
| 3 | * Copyright (c) 2013 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 | * Author: Alexander Afanasyev <alexander.afanasyev@ucla.edu> |
| 19 | */ |
| 20 | |
| 21 | #ifndef NDN_EXAMPLES_API_APP_H |
| 22 | #define NDN_EXAMPLES_API_APP_H |
| 23 | |
| 24 | #include "ns3/core-module.h" |
| 25 | #include "ns3/network-module.h" |
| 26 | #include "ns3/ndnSIM-module.h" |
| 27 | |
Alexander Afanasyev | 7960606 | 2013-07-11 00:57:28 -0700 | [diff] [blame] | 28 | #include "ns3/ndnSIM/ndn.cxx/ndn-api-face.h" |
Alexander Afanasyev | 79a5bd6 | 2013-06-23 22:12:39 -0700 | [diff] [blame] | 29 | |
| 30 | namespace ns3 { |
| 31 | namespace ndn { |
| 32 | |
| 33 | class ApiApp : public Application |
| 34 | { |
| 35 | public: |
| 36 | static TypeId |
| 37 | GetTypeId (); |
| 38 | |
| 39 | ApiApp (); |
| 40 | |
| 41 | private: |
| 42 | void |
| 43 | RequestData (); |
Alexander Afanasyev | 7960606 | 2013-07-11 00:57:28 -0700 | [diff] [blame] | 44 | |
| 45 | void |
Alexander Afanasyev | 772f51b | 2013-08-01 18:53:25 -0700 | [diff] [blame] | 46 | GotData (Ptr<const Interest> origInterest, Ptr<const Data> data); |
Alexander Afanasyev | 79a5bd6 | 2013-06-23 22:12:39 -0700 | [diff] [blame] | 47 | |
| 48 | protected: |
| 49 | // inherited from Application base class. |
| 50 | virtual void |
| 51 | StartApplication (); |
| 52 | |
| 53 | virtual void |
| 54 | StopApplication (); |
Alexander Afanasyev | 7960606 | 2013-07-11 00:57:28 -0700 | [diff] [blame] | 55 | |
Alexander Afanasyev | 79a5bd6 | 2013-06-23 22:12:39 -0700 | [diff] [blame] | 56 | private: |
Alexander Afanasyev | 7960606 | 2013-07-11 00:57:28 -0700 | [diff] [blame] | 57 | Ptr<ApiFace> m_face; |
| 58 | |
| 59 | Name m_name; |
| 60 | Time m_interestLifetime; |
Alexander Afanasyev | 79a5bd6 | 2013-06-23 22:12:39 -0700 | [diff] [blame] | 61 | }; |
| 62 | |
| 63 | } // namespace ndn |
| 64 | } // namespace ns3 |
| 65 | |
| 66 | #endif // NDN_EXAMPLES_API_APP_H |