blob: 7709b808fa7c3a43cbee7009d815359191ea2723 [file] [log] [blame]
Alexander Afanasyev79a5bd62013-06-23 22:12:39 -07001/* -*- 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 Afanasyev79606062013-07-11 00:57:28 -070028#include "ns3/ndnSIM/ndn.cxx/ndn-api-face.h"
Alexander Afanasyev79a5bd62013-06-23 22:12:39 -070029
30namespace ns3 {
31namespace ndn {
32
33class ApiApp : public Application
34{
35public:
36 static TypeId
37 GetTypeId ();
38
39 ApiApp ();
40
41private:
42 void
43 RequestData ();
Alexander Afanasyev79606062013-07-11 00:57:28 -070044
45 void
46 GotData (Ptr<const Interest> origInterest, Ptr<const ContentObject> data);
Alexander Afanasyev79a5bd62013-06-23 22:12:39 -070047
48protected:
49 // inherited from Application base class.
50 virtual void
51 StartApplication ();
52
53 virtual void
54 StopApplication ();
Alexander Afanasyev79606062013-07-11 00:57:28 -070055
Alexander Afanasyev79a5bd62013-06-23 22:12:39 -070056private:
Alexander Afanasyev79606062013-07-11 00:57:28 -070057 Ptr<ApiFace> m_face;
58
59 Name m_name;
60 Time m_interestLifetime;
Alexander Afanasyev79a5bd62013-06-23 22:12:39 -070061};
62
63} // namespace ndn
64} // namespace ns3
65
66#endif // NDN_EXAMPLES_API_APP_H