/* * TOPPERS/JSP Kernel * Toyohashi Open Platform for Embedded Real-Time Systems/ * Just Standard Profile Kernel * * Copyright (C) 2000-2003 by Embedded and Real-Time Systems Laboratory * Toyohashi Univ. of Technology, JAPAN * * 上記著作権者は,以下の (1)〜(4) の条件か,Free Software Foundation * によって公表されている GNU General Public License の Version 2 に記 * 述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア * を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下, * 利用と呼ぶ)することを無償で許諾する. * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー * スコード中に含まれていること. * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記 * の無保証規定を掲載すること. * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使 * 用できない形で再配布する場合には,次のいずれかの条件を満たすこ * と. * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著 * 作権表示,この利用条件および下記の無保証規定を掲載すること. * (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに * 報告すること. * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること. * * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お * よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も * 含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直 * 接的または間接的に生じたいかなる損害に関しても,その責任を負わない. * * @(#) $Id: kernellog.h,v 1.2 2003/12/20 09:19:59 takayuki Exp $ */ // KernelLog.h : CKernelLog の宣言 #ifndef __KERNELLOG_H_ #define __KERNELLOG_H_ #include "resource.h" // メイン シンボル #include "devicemanagerCP.h" ///////////////////////////////////////////////////////////////////////////// // CKernelLog class ATL_NO_VTABLE CKernelLog : public CComObjectRootEx, public CComCoClass, public IConnectionPointContainerImpl, public IKernelLog, public CProxy_IKernelLogEvents< CKernelLog > { public: CKernelLog(); ~CKernelLog(); DECLARE_REGISTRY_RESOURCEID(IDR_KERNELLOG) DECLARE_PROTECT_FINAL_CONSTRUCT() BEGIN_COM_MAP(CKernelLog) COM_INTERFACE_ENTRY(IKernelLog) COM_INTERFACE_ENTRY(IConnectionPointContainer) COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer) END_COM_MAP() BEGIN_CONNECTION_POINT_MAP(CKernelLog) CONNECTION_POINT_ENTRY(IID__IKernelLogEvents) END_CONNECTION_POINT_MAP() // IKernelLog public: }; #endif //__KERNELLOG_H_ #if 0 template class CProxy_IKernelLogEvents : public IConnectionPointImpl { public: bool onKernelStart_Performed; CProxy_IKernelLogEvents(void) : onKernelStart_Performed(false) {}; //Warning this class may be recreated by the wizard. public: HRESULT Fire_OnKernelStart() { HRESULT ret; T* pT = static_cast(this); int nConnectionIndex; int nConnections = m_vec.GetSize(); for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++) { pT->Lock(); CComPtr sp = m_vec.GetAt(nConnectionIndex); pT->Unlock(); _IKernelLogEvents* p_IKernelLogEvents = reinterpret_cast<_IKernelLogEvents*>(sp.p); if (p_IKernelLogEvents != NULL) ret = p_IKernelLogEvents->OnKernelStart(); } onKernelStart_Performed = true; return ret; } HRESULT Fire_OnKernelExit() { HRESULT ret; T* pT = static_cast(this); int nConnectionIndex; int nConnections = m_vec.GetSize(); for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++) { pT->Lock(); CComPtr sp = m_vec.GetAt(nConnectionIndex); pT->Unlock(); _IKernelLogEvents* p_IKernelLogEvents = reinterpret_cast<_IKernelLogEvents*>(sp.p); if (p_IKernelLogEvents != NULL) ret = p_IKernelLogEvents->OnKernelExit(); } onKernelStart_Performed = false; return ret; } HRESULT Fire_OnLogEvent(LONG sz, unsigned char * data) { HRESULT ret; T* pT = static_cast(this); int nConnectionIndex; int nConnections = m_vec.GetSize(); for (nConnectionIndex = 0; nConnectionIndex < nConnections; nConnectionIndex++) { pT->Lock(); CComPtr sp = m_vec.GetAt(nConnectionIndex); pT->Unlock(); _IKernelLogEvents* p_IKernelLogEvents = reinterpret_cast<_IKernelLogEvents*>(sp.p); if (p_IKernelLogEvents != NULL) { if(!onKernelStart_Performed) p_IKernelLogEvents->OnKernelStart(); ret = p_IKernelLogEvents->OnLogEvent(sz, data); } } onKernelStart_Performed = true; return ret; } }; #endif