FNSS ns-3 adapter
ns-3 adapter for the Fast Network Simulation Setup (FNSS) toolchain
 All Classes Files Functions Typedefs Pages
fnss-node.h
1 #ifndef FNSS_NODE_H
2 #define FNSS_NODE_H
3 
4 #include "property-container.h"
5 #include "protocol-stack.h"
6 #include "fnss-application.h"
7 
8 #include <string>
9 #include <map>
10 #include <exception>
11 
12 namespace fnss {
13 
23 class Node : public PropertyContainer {
24 public:
30  Node(const ProtocolStack &stack = ProtocolStack());
31 
38 
44  void setProtocolStack(const ProtocolStack &stack);
45 
54  Application getApplication(const std::string &name) const;
55 
65  // Application getApplication(const std::string &name, bool &found) const;
66 
72  void setApplication(const Application &application);
73 
82  Application removeApplication(const std::string &name);
83 
93  // Application removeApplication(const std::string &name, bool &found);
94 
101  std::set <std::string> getAllApplications() const;
102 
103  class ApplicationNotFoundException : public std::exception {
104  public:
105  ApplicationNotFoundException(const std::string &name) throw() {
106  this->exceptionStr = "The application named " + name + " was not found.";
107  }
108 
109  ~ApplicationNotFoundException() throw() {
110  }
111 
112  const char* what() const throw() {
113  return this->exceptionStr.c_str();
114  }
115 
116  private:
117  std::string exceptionStr;
118  };
119 
120 private:
124  typedef std::map <std::string, Application> ApplicationsType;
125  std::map <std::string, Application> applications;
126 
130  ProtocolStack stack;
131 };
132 
133 } //namespace
134 
135 #endif //FNSS_NODE_H
Definition: fnss-node.h:103
void setApplication(const Application &application)
Definition: fnss-node.cpp:41
void setProtocolStack(const ProtocolStack &stack)
Definition: fnss-node.cpp:13
Definition: fnss-application.h:19
ProtocolStack getProtocolStack() const
Definition: fnss-node.cpp:9
Definition: protocol-stack.h:18
Application getApplication(const std::string &name) const
Definition: fnss-node.cpp:17
Node(const ProtocolStack &stack=ProtocolStack())
Definition: fnss-node.cpp:5
Definition: fnss-node.h:23
std::set< std::string > getAllApplications() const
Definition: fnss-node.cpp:72
Definition: property-container.h:15
Application removeApplication(const std::string &name)
Definition: fnss-node.cpp:45