Remove dynamic exceptions
[anna.git] / include / anna / comm / functions.hpp
1 // ANNA - Anna is Not Nothingness Anymore                                                         //
2 //                                                                                                //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
4 //                                                                                                //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite                           //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
7
8
9 #ifndef anna_comm_functions_hpp
10 #define anna_comm_functions_hpp
11
12 #include <vector>
13
14 #include <anna/app/functions.hpp>
15
16 namespace anna {
17
18 namespace comm {
19
20 class Application;
21 class Server;
22 class Service;
23
24 /**
25    functions - Methods and variables
26 */
27 struct functions : public anna::app::functions {
28   /**
29      Returns the host name over which we are executing our process.
30      @return host name over which we are executing our process.
31   */
32   static std::string getHostName() noexcept(false);
33
34
35   /**
36      Resolves the host name provided with the first IP returned by the system.
37      Aliases and their addresses are traced as well as the official host name.
38
39      @param hostname Logical name for the server used to resolve (could be www.gopher.net i.e.).
40
41      @return First IP address returned by the system.
42
43      \see man gethostbyname.
44    */
45   static std::string resolveIP(const char* hostname) noexcept(false);
46
47   /**
48      Returns our application instance on anna.comm layer.
49      @return Reference to our application instance on anna.comm layer.
50   */
51   static comm::Application& getApp() noexcept(false);
52 };
53
54 }
55 }
56
57 #endif
58
59