OSDN Git Service

boost.type_erasureを使う実装に変更
[gikomona/libcore.git] / include / application-type.hpp
1
2 #ifndef GIKOMONA_CORE_APPLICATION_TYPE_HPP
3 #define GIKOMONA_CORE_APPLICATION_TYPE_HPP
4
5 #include "GikoMona.hpp"
6
7 namespace monazilla { namespace GikoMona { namespace core {
8
9 enum class application_type : communicate_id {
10     COMMUNICATE_ID_APP = -1,
11     GM_U2, // GikoMona Update Utility
12     
13     GIKOMONA,
14     PNUTS,
15     
16     END_OF_COMMUNICATE_ID_APP = 100,
17     
18     /* 100-1000 は予約されている */
19     
20     COMMUNICATE_ID_USER = 1000
21 };
22
23 communicate_id to_communicate_id(const application_type val) {
24     return static_cast<communicate_id>(val);
25 }
26
27 std::string to_string(const application_type val) {
28     switch (val) {
29         case application_type::GM_U2:
30             return "update-utility";
31             
32         case application_type::GIKOMONA:
33             return "gikomona";
34             
35         case application_type::PNUTS:
36             return "pnuts";
37     }
38 }
39
40 } } }
41
42 #endif // GIKOMONA_CORE_APPLICATION_TYPE_HPP