19 */ |
19 */ |
20 |
20 |
21 #ifndef __APPLICATION_H__ |
21 #ifndef __APPLICATION_H__ |
22 #define __APPLICATION_H__ |
22 #define __APPLICATION_H__ |
23 |
23 |
24 // |
|
25 // \brief The base class for all ns3 applicationes |
|
26 // |
|
27 // Class Application is the base class for all ns3 applications. |
|
28 // Applications are associated with individual nodes, and are created |
|
29 // using the AddApplication method in the ApplicationManager capability. |
|
30 // |
|
31 // Conceptually, an application has zero or more Socket |
|
32 // objects associated with it, that are created using the Socket |
|
33 // creation API of the Kernel capability. The Socket object |
|
34 // API is modeled after the |
|
35 // well-known BSD sockets interface, although it is somewhat |
|
36 // simplified for use with ns3. Further, any socket call that |
|
37 // would normally "block" in normal sockets will return immediately |
|
38 // in ns3. A set of "upcalls" are defined that will be called when |
|
39 // the previous blocking call would normally exit. THis is documented |
|
40 // in more detail Socket class in socket.h. |
|
41 // |
|
42 // There is a second application class in ns3, called "ThreadedApplication" |
|
43 // that implements a true sockets interface, which should be used |
|
44 // when porting existing sockets code to ns3. The true |
|
45 // sockets approach is significantly |
|
46 // less memory--efficient using private stacks for each defined application, |
|
47 // so that approach should be used with care. The design and implementation |
|
48 // of the ThreadedApplication are still being discussed. |
|
49 |
|
50 #include "ns3/event-id.h" |
24 #include "ns3/event-id.h" |
51 #include "ns3/nstime.h" |
25 #include "ns3/nstime.h" |
52 #include "ns3/object.h" |
26 #include "ns3/object.h" |
53 #include "ns3/ptr.h" |
27 #include "ns3/ptr.h" |
54 #include "ns3/node.h" |
28 #include "ns3/node.h" |
57 |
31 |
58 class Node; |
32 class Node; |
59 class RandomVariable; |
33 class RandomVariable; |
60 |
34 |
61 /** |
35 /** |
62 * \brief a model for userspace applications. |
36 * \brief The base class for all ns3 applicationes |
|
37 * |
|
38 * Class Application is the base class for all ns3 applications. |
|
39 * Applications are associated with individual nodes. |
|
40 * |
|
41 * Conceptually, an application has zero or more Socket |
|
42 * objects associated with it, that are created using the Socket |
|
43 * creation API of the Kernel capability. The Socket object |
|
44 * API is modeled after the |
|
45 * well-known BSD sockets interface, although it is somewhat |
|
46 * simplified for use with ns3. Further, any socket call that |
|
47 * would normally "block" in normal sockets will return immediately |
|
48 * in ns3. A set of "upcalls" are defined that will be called when |
|
49 * the previous blocking call would normally exit. THis is documented |
|
50 * in more detail Socket class in socket.h. |
63 */ |
51 */ |
64 class Application : public Object |
52 class Application : public Object |
65 { |
53 { |
66 public: |
54 public: |
67 Application(Ptr<Node>); |
55 Application(Ptr<Node>); |