📄 component.h
字号:
/* * TOPPERS/JSP Kernel * Toyohashi Open Platform for Embedded Real-Time Systems/ * Just Standard Profile Kernel * * Copyright (C) 2000-2002 by Embedded and Real-Time Systems Laboratory * Toyohashi Univ. of Technology, JAPAN * * 惧淡螟侯涪荚は·Free Software Foundation によって给山されている * GNU General Public License の Version 2 に淡揭されている掘凤か·笆 * 布の(1)×(4)の掘凤を塔たす眷圭に嘎り·塑ソフトウェア∈塑ソフトウェ * アを猖恃したものを崔むˉ笆布票じ∷を蝗脱ˇ剩澜ˇ猖恃ˇ浩芹邵∈笆布· * 网脱と钙ぶ∷することを痰浸で钓满するˉ * (1) 塑ソフトウェアをソ〖スコ〖ドの妨で网脱する眷圭には·惧淡の螟侯 * 涪山绩·この网脱掘凤および布淡の痰瘦沮惮年が·そのままの妨でソ〖 * スコ〖ド面に崔まれていることˉ * (2) 塑ソフトウェアを浩网脱材墙なバイナリコ〖ド∈リロケ〖タブルオブ * ジェクトファイルやライブラリなど∷の妨で网脱する眷圭には·网脱 * に燃うドキュメント∈网脱荚マニュアルなど∷に·惧淡の螟侯涪山绩· * この网脱掘凤および布淡の痰瘦沮惮年を非很することˉ * (3) 塑ソフトウェアを浩网脱稍材墙なバイナリコ〖ドの妨または怠达に寥 * み哈んだ妨で网脱する眷圭には·肌のいずれかの掘凤を塔たすことˉ * (a) 网脱に燃うドキュメント∈网脱荚マニュアルなど∷に·惧淡の螟侯 * 涪山绩·この网脱掘凤および布淡の痰瘦沮惮年を非很することˉ * (b) 网脱の妨轮を·侍に年める数恕によって·惧淡螟侯涪荚に鼠桂する * ことˉ * (4) 塑ソフトウェアの网脱により木儡弄または粗儡弄に栏じるいかなる禄 * 巢からも·惧淡螟侯涪荚を倘勒することˉ * * 塑ソフトウェアは·痰瘦沮で捏丁されているものであるˉ惧淡螟侯涪荚は· * 塑ソフトウェアに簇して·その努脱材墙拉も崔めて·いかなる瘦沮も乖わ * ないˉまた·塑ソフトウェアの网脱により木儡弄または粗儡弄に栏じたい * かなる禄巢に簇しても·その勒扦を砷わないˉ * * @(#) $Id: component.h,v 1.2 2002/04/05 08:48:31 takayuki Exp $ */// $Header: /home/CVS/configurator/component.h,v 1.2 2002/04/05 08:48:31 takayuki Exp $#ifndef __COMPONENT#define __COMPONENT#ifdef _MSC_VER #pragma warning(disable:4786)#endif#include <list>#include <map>#include <string>#include "except.h"#include "directorymap.h"#define DEFAULT_PARAMETER " "//------class Component{public: enum tagBarrier { EXTENSION, IGNORE_UNKNOWN_API };protected: static std::list<Component *> componentList; static std::list<Component *> activatedComponentList; static int barrierFlag; static Component * findComponent(const char *); static bool findOption(Directory &, const char *, const char * = 0, std::string * = 0); static Directory * getOption(Directory &, const char *, const char * = 0); static Directory * mergeOption(Directory &, const char *, const char *); static void enable(enum tagBarrier); static void disable(enum tagBarrier); static void dumpContainerSnapshot(Directory &, bool = false); virtual void parseOption(Directory &) {}; virtual void body(Directory &) {};public: Component(void); virtual ~Component(void); void activateComponent(bool = true); static bool isEnabled(enum tagBarrier); static void barrier(enum tagBarrier, const Message & reason); static void parseOption(int, char **, Directory &); static void executeComponents(Directory &);};#include <iostream>inline Component::Component(void){ componentList.push_back(this); }inline bool Component::findOption(Directory & container, const char * id, const char * longId, std::string * value){ Directory * node = getOption(container, id, longId); if(node != 0) { if(value != 0) *value = node->toString(); return true; } return false;}inline void Component::enable(enum tagBarrier bf){ barrierFlag |= 1 << (int)bf; }inline void Component::disable(enum tagBarrier bf){ barrierFlag &= ~(1 << (int)bf); }inline bool Component::isEnabled(enum tagBarrier bf){ return (barrierFlag & (1 << (int)bf)) != 0; }inline void Component::barrier(enum tagBarrier bf, const Message & reason){ if((barrierFlag & (1 << (int)bf)) == 0) Exception("The operation detailed below is not permitted.\n %s\n","肌の拎侯は钓材されていません\n %s\n").format(((std::string &)reason).c_str()); if(!((std::string &)reason).empty()) VerboseMessage("Configurator allows the operation below\n %s\n","肌の拎侯を钓材しました\n %s\n").format(((std::string &)reason).c_str());}#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -