1 | /*
|
---|
2 | * TOPPERS/JSP Kernel
|
---|
3 | * Toyohashi Open Platform for Embedded Real-Time Systems/
|
---|
4 | * Just Standard Profile Kernel
|
---|
5 | *
|
---|
6 | * Copyright (C) 2003 by Embedded and Real-Time Systems Laboratory
|
---|
7 | * Toyohashi Univ. of Technology, JAPAN
|
---|
8 | *
|
---|
9 | * ä¸è¨è使¨©è
|
---|
10 | ã¯ï¼ä»¥ä¸ã® (1)ã(4) ã®æ¡ä»¶ãï¼Free Software Foundation
|
---|
11 | * ã«ãã£ã¦å
|
---|
12 | ¬è¡¨ããã¦ãã GNU General Public License ã® Version 2 ã«è¨
|
---|
13 | * è¿°ããã¦ããæ¡ä»¶ãæºããå ´åã«éãï¼æ¬ã½ããã¦ã§ã¢ï¼æ¬ã½ããã¦ã§ã¢
|
---|
14 | * ãæ¹å¤ãããã®ãå«ãï¼ä»¥ä¸åãï¼ã使ç¨ã»è¤è£½ã»æ¹å¤ã»åé
|
---|
15 | å¸ï¼ä»¥ä¸ï¼
|
---|
16 | * å©ç¨ã¨å¼ã¶ï¼ãããã¨ãç¡åã§è¨±è«¾ããï¼
|
---|
17 | * (1) æ¬ã½ããã¦ã§ã¢ãã½ã¼ã¹ã³ã¼ãã®å½¢ã§å©ç¨ããå ´åã«ã¯ï¼ä¸è¨ã®èä½
|
---|
18 | * 権表示ï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãï¼ãã®ã¾ã¾ã®å½¢ã§ã½ã¼
|
---|
19 | * ã¹ã³ã¼ãä¸ã«å«ã¾ãã¦ãããã¨ï¼
|
---|
20 | * (2) æ¬ã½ããã¦ã§ã¢ãï¼ã©ã¤ãã©ãªå½¢å¼ãªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
21 | * ç¨ã§ããå½¢ã§åé
|
---|
22 | å¸ããå ´åã«ã¯ï¼åé
|
---|
23 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨
|
---|
24 | * è
|
---|
25 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è使¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨
|
---|
26 | * ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
27 | * (3) æ¬ã½ããã¦ã§ã¢ãï¼æ©å¨ã«çµã¿è¾¼ããªã©ï¼ä»ã®ã½ããã¦ã§ã¢éçºã«ä½¿
|
---|
28 | * ç¨ã§ããªãå½¢ã§åé
|
---|
29 | å¸ããå ´åã«ã¯ï¼æ¬¡ã®ããããã®æ¡ä»¶ãæºããã
|
---|
30 | * ã¨ï¼
|
---|
31 | * (a) åé
|
---|
32 | å¸ã«ä¼´ãããã¥ã¡ã³ãï¼å©ç¨è
|
---|
33 | ããã¥ã¢ã«ãªã©ï¼ã«ï¼ä¸è¨ã®è
|
---|
34 | * 使¨©è¡¨ç¤ºï¼ãã®å©ç¨æ¡ä»¶ããã³ä¸è¨ã®ç¡ä¿è¨¼è¦å®ãæ²è¼ãããã¨ï¼
|
---|
35 | * (b) åé
|
---|
36 | å¸ã®å½¢æ
|
---|
37 | ãï¼å¥ã«å®ããæ¹æ³ã«ãã£ã¦ï¼TOPPERSããã¸ã§ã¯ãã«
|
---|
38 | * å ±åãããã¨ï¼
|
---|
39 | * (4) æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´æ¥çã¾ãã¯éæ¥çã«çãããããªãæ
|
---|
40 | * 害ãããï¼ä¸è¨è使¨©è
|
---|
41 | ããã³TOPPERSããã¸ã§ã¯ããå
|
---|
42 | 責ãããã¨ï¼
|
---|
43 | *
|
---|
44 | * æ¬ã½ããã¦ã§ã¢ã¯ï¼ç¡ä¿è¨¼ã§æä¾ããã¦ãããã®ã§ããï¼ä¸è¨è使¨©è
|
---|
45 | ã
|
---|
46 | * ãã³TOPPERSããã¸ã§ã¯ãã¯ï¼æ¬ã½ããã¦ã§ã¢ã«é¢ãã¦ï¼ãã®é©ç¨å¯è½æ§ã
|
---|
47 | * å«ãã¦ï¼ãããªãä¿è¨¼ãè¡ããªãï¼ã¾ãï¼æ¬ã½ããã¦ã§ã¢ã®å©ç¨ã«ããç´
|
---|
48 | * æ¥çã¾ãã¯éæ¥çã«çãããããªãæå®³ã«é¢ãã¦ãï¼ãã®è²¬ä»»ãè² ããªãï¼
|
---|
49 | *
|
---|
50 | * @(#) $Id: jsp_common.h,v 1.8 2004/09/06 15:00:49 honda Exp $
|
---|
51 | */
|
---|
52 |
|
---|
53 | // $Header: /home/CVS/configurator/jsp/jsp_common.h,v 1.8 2004/09/06 15:00:49 honda Exp $
|
---|
54 |
|
---|
55 |
|
---|
56 | #ifndef JSP_COMMON_H
|
---|
57 | #define JSP_COMMON_H
|
---|
58 |
|
---|
59 | #include "base/testsuite.h"
|
---|
60 |
|
---|
61 | #include "base/mpstrstream.h"
|
---|
62 | #include "base/collection.h"
|
---|
63 | #include "base/except.h"
|
---|
64 | #include "base/event.h"
|
---|
65 |
|
---|
66 | #include <string>
|
---|
67 |
|
---|
68 |
|
---|
69 | namespace ToppersJsp {
|
---|
70 |
|
---|
71 | //ã«ã¼ãã«æ§æãã¡ã¤ã«
|
---|
72 | class SpecialtyFile : public MultipartStream, public RuntimeObject
|
---|
73 | {
|
---|
74 | protected:
|
---|
75 | SpecialtyFile(void) throw();
|
---|
76 |
|
---|
77 | template<class T>
|
---|
78 | static T * createInstance(std::string filename) throw(Exception)
|
---|
79 | {
|
---|
80 | T * old;
|
---|
81 | T * result = 0;
|
---|
82 |
|
---|
83 | //ROTç»é²è§£é¤ ãªãã¸ã§ã¯ãåé¤ (å¯ä¸æ§ã®ä¿é (ã ãã©ã·ã³ã°ã«ãã³ã§ã¯ãªã) )
|
---|
84 | old = dynamic_cast<T *>(RuntimeObjectTable::getInstance(typeid(T)));
|
---|
85 | if(old != 0)
|
---|
86 | delete old;
|
---|
87 |
|
---|
88 | result = new(std::nothrow) T;
|
---|
89 | if(result == 0)
|
---|
90 | ExceptionMessage("Internal error : Object creation failure [ToppersJsp::KernelCfg::createKernelCfg]","å
|
---|
91 | é¨ã¨ã©ã¼ : ãªãã¸ã§ã¯ãçææã¨ã©ã¼ [createKernelCfg]") << throwException;
|
---|
92 |
|
---|
93 | try {
|
---|
94 | result->setFilename(filename);
|
---|
95 | }
|
---|
96 | catch(...) {
|
---|
97 | if(result != 0)
|
---|
98 | delete result;
|
---|
99 | throw;
|
---|
100 | }
|
---|
101 | return result;
|
---|
102 | }
|
---|
103 |
|
---|
104 | };
|
---|
105 |
|
---|
106 |
|
---|
107 | /*
|
---|
108 | * Visual C++ 6.0 : fatal error C1001: INTERNAL COMPILER ERROR (msc1.cpp:1794) 対ç
|
---|
109 | * (ã¨ãããããå¤éç»é²ãã¦ãå¤ãã¤ã³ã¹ã¿ã³ã¹ã®ç»é²ãã§ãã¯ãããªã)
|
---|
110 | */
|
---|
111 | #if defined(_MSC_VER) && (_MSC_VER < 1300)
|
---|
112 | # define SPECIALTY_FILE(x) \
|
---|
113 | class x : public SpecialtyFile { \
|
---|
114 | public: \
|
---|
115 | struct CreationEvent { class x * file; }; \
|
---|
116 | static inline x * createInstance(std::string filename) throw(Exception) \
|
---|
117 | { \
|
---|
118 | x * instance = new(std::nothrow) x; \
|
---|
119 | if(instance != 0) \
|
---|
120 | instance->setFilename(filename); \
|
---|
121 | return instance; \
|
---|
122 | } \
|
---|
123 | }
|
---|
124 | #else
|
---|
125 | # define SPECIALTY_FILE(x) \
|
---|
126 | class x : public SpecialtyFile { \
|
---|
127 | public: \
|
---|
128 | struct CreationEvent { class x * file; }; \
|
---|
129 | static inline x * createInstance(std::string filename) throw(Exception) \
|
---|
130 | { return SpecialtyFile::createInstance<x>(filename); } \
|
---|
131 | }
|
---|
132 | #endif
|
---|
133 |
|
---|
134 | //TOPPERS/JSPã®ã³ã³ãã£ã®ã¥ã¬ã¼ã·ã§ã³ã§åºã¦ããç¹æ®ãªãã¡ã¤ã«
|
---|
135 | SPECIALTY_FILE(KernelCfg);
|
---|
136 | SPECIALTY_FILE(KernelID);
|
---|
137 |
|
---|
138 | //ãã¼ã¸ã§ã³éãè¶ãã夿ãªã©
|
---|
139 | std::string conv_includefile(std::string file) throw(); //ã¤ã³ã¯ã«ã¼ããã¡ã¤ã«å
|
---|
140 | std::string conv_kernelobject(std::string obj) throw(); //ã«ã¼ãã«ã®å¤æ°å
|
---|
141 |
|
---|
142 | //宿°ãªã©
|
---|
143 | // std::string get_agreement(std::string filename = "") throw(); //æè¨ã®åå¾
|
---|
144 | }
|
---|
145 |
|
---|
146 | #endif
|
---|
147 |
|
---|