#ifndef __GUICONSOLE_SERVER_G_H #define __GUICONSOLE_SERVER_G_H #pragma once // This code is generated by spgen tool! #include "GUIConsole_def_g.h" namespace GUIConsole { class GUIConsoleService_ServerSessionBase : public CServerSessionBase { public: GUIConsoleService_ServerSessionBase() { /// override by user } virtual ~GUIConsoleService_ServerSessionBase() { /// override by user } virtual bool IsExclusive() { return false; } virtual bool IsSessionOverlap() { return true; } virtual ErrorCodeEnum GetMessageAttr(DWORD dwMessageID, DWORD dwSignature, bool &bOverlap) { ErrorCodeEnum Error = Error_Succeed; switch (dwMessageID) { case GUIConsoleService_Method_OpenLogSender: if (dwSignature == GUIConsoleService_MethodSignature_OpenLogSender) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_CloseLogSender: if (dwSignature == GUIConsoleService_MethodSignature_CloseLogSender) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_OpenEntityMonitor: if (dwSignature == GUIConsoleService_MethodSignature_OpenEntityMonitor) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_CloseEntityMonitor: if (dwSignature == GUIConsoleService_MethodSignature_CloseEntityMonitor) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_OpenPerformanceSender: if (dwSignature == GUIConsoleService_MethodSignature_OpenPerformanceSender) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_ClosePerformanceSender: if (dwSignature == GUIConsoleService_MethodSignature_ClosePerformanceSender) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_VTMSystemControl: if (dwSignature == GUIConsoleService_MethodSignature_VTMSystemControl) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_VTM_controlEntity: if (dwSignature == GUIConsoleService_MethodSignature_VTM_controlEntity) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_GetAllEntityList: if (dwSignature == GUIConsoleService_MethodSignature_GetAllEntityList) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_GetBasicInformation: if (dwSignature == GUIConsoleService_MethodSignature_GetBasicInformation) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_GetHelpInformationArr: if (dwSignature == GUIConsoleService_MethodSignature_GetHelpInformationArr) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_GetHelpDetail: if (dwSignature == GUIConsoleService_MethodSignature_GetHelpDetail) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_OpenCommonPage: if (dwSignature == GUIConsoleService_MethodSignature_OpenCommonPage) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_CloseCommonPage: if (dwSignature == GUIConsoleService_MethodSignature_CloseCommonPage) { bOverlap = true; } else { Error = Error_MethodSignatureFailed; } break; default: Error = Error_MethodNotFound; break; } return Error; } int CheckMessageSignature(DWORD dwMessageID, DWORD dwSignature) { ErrorCodeEnum Error = Error_Succeed; switch (dwMessageID) { case GUIConsoleService_Method_OpenLogSender: if (dwSignature != GUIConsoleService_MethodSignature_OpenLogSender) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_CloseLogSender: if (dwSignature != GUIConsoleService_MethodSignature_CloseLogSender) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_OpenEntityMonitor: if (dwSignature != GUIConsoleService_MethodSignature_OpenEntityMonitor) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_CloseEntityMonitor: if (dwSignature != GUIConsoleService_MethodSignature_CloseEntityMonitor) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_OpenPerformanceSender: if (dwSignature != GUIConsoleService_MethodSignature_OpenPerformanceSender) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_ClosePerformanceSender: if (dwSignature != GUIConsoleService_MethodSignature_ClosePerformanceSender) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_VTMSystemControl: if (dwSignature != GUIConsoleService_MethodSignature_VTMSystemControl) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_VTM_controlEntity: if (dwSignature != GUIConsoleService_MethodSignature_VTM_controlEntity) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_GetAllEntityList: if (dwSignature != GUIConsoleService_MethodSignature_GetAllEntityList) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_GetBasicInformation: if (dwSignature != GUIConsoleService_MethodSignature_GetBasicInformation) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_GetHelpInformationArr: if (dwSignature != GUIConsoleService_MethodSignature_GetHelpInformationArr) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_GetHelpDetail: if (dwSignature != GUIConsoleService_MethodSignature_GetHelpDetail) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_OpenCommonPage: if (dwSignature != GUIConsoleService_MethodSignature_OpenCommonPage) { Error = Error_MethodSignatureFailed; } break; case GUIConsoleService_Method_CloseCommonPage: if (dwSignature != GUIConsoleService_MethodSignature_CloseCommonPage) { Error = Error_MethodSignatureFailed; } break; default: Error = Error_MethodNotFound; break; } return Error; } virtual void Handle_OpenLogSender(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_CloseLogSender(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_OpenEntityMonitor(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_CloseEntityMonitor(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_OpenPerformanceSender(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_ClosePerformanceSender(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_VTMSystemControl(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_VTM_controlEntity(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_GetAllEntityList(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_GetBasicInformation(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_GetHelpInformationArr(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_GetHelpDetail(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_OpenCommonPage(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void Handle_CloseCommonPage(SpReqAnsContext::Pointer ctx) { /// override by user } virtual void OnRequest(CSmartPointer pTransactionContext) { CAutoBuffer Buf; DWORD dwMessageID; DWORD dwMessageSignature; ErrorCodeEnum Error = pTransactionContext->GetReceiveBuffer(dwMessageID, dwMessageSignature, Buf); if (Error == Error_Succeed) { #ifdef DEBUG assert(CheckMessageSignature(dwMessageID, dwMessageSignature) == Error_Succeed); #else if (CheckMessageSignature(dwMessageID, dwMessageSignature) != Error_Succeed) { pTransactionContext->SendAnswer(Error_MethodSignatureFailed); return; } #endif switch (dwMessageID) { case GUIConsoleService_Method_OpenLogSender: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_OpenLogSender(ctx); } break; case GUIConsoleService_Method_CloseLogSender: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_CloseLogSender(ctx); } break; case GUIConsoleService_Method_OpenEntityMonitor: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_OpenEntityMonitor(ctx); } break; case GUIConsoleService_Method_CloseEntityMonitor: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_CloseEntityMonitor(ctx); } break; case GUIConsoleService_Method_OpenPerformanceSender: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_OpenPerformanceSender(ctx); } break; case GUIConsoleService_Method_ClosePerformanceSender: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_ClosePerformanceSender(ctx); } break; case GUIConsoleService_Method_VTMSystemControl: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_VTMSystemControl(ctx); } break; case GUIConsoleService_Method_VTM_controlEntity: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_VTM_controlEntity(ctx); } break; case GUIConsoleService_Method_GetAllEntityList: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_GetAllEntityList(ctx); } break; case GUIConsoleService_Method_GetBasicInformation: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_GetBasicInformation(ctx); } break; case GUIConsoleService_Method_GetHelpInformationArr: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_GetHelpInformationArr(ctx); } break; case GUIConsoleService_Method_GetHelpDetail: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_GetHelpDetail(ctx); } break; case GUIConsoleService_Method_OpenCommonPage: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_OpenCommonPage(ctx); } break; case GUIConsoleService_Method_CloseCommonPage: { SpReqAnsContext::Pointer ctx; ctx.Attach(new SpReqAnsContext(pTransactionContext)); SpBuffer2Object(Buf, ctx->Req); pTransactionContext->GetLinkContext(ctx->link); EntityResource::setLink(ctx->link); Handle_CloseCommonPage(ctx); } break; default: assert(0); break; } } else { pTransactionContext->SendAnswer(Error); } } }; /////////////////////////// } // namespace GUIConsole #endif // __GUICONSOLE_SERVER_G_H