123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461 |
- #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<GUIConsoleService_OpenLogSender_Req, GUIConsoleService_OpenLogSender_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_CloseLogSender(SpReqAnsContext<GUIConsoleService_CloseLogSender_Req, GUIConsoleService_CloseLogSender_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_OpenEntityMonitor(SpReqAnsContext<GUIConsoleService_OpenEntityMonitor_Req, GUIConsoleService_OpenEntityMonitor_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_CloseEntityMonitor(SpReqAnsContext<GUIConsoleService_CloseEntityMonitor_Req, GUIConsoleService_CloseEntityMonitor_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_OpenPerformanceSender(SpReqAnsContext<GUIConsoleService_OpenPerformanceSender_Req, GUIConsoleService_OpenPerformanceSender_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_ClosePerformanceSender(SpReqAnsContext<GUIConsoleService_ClosePerformanceSender_Req, GUIConsoleService_ClosePerformanceSender_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_VTMSystemControl(SpReqAnsContext<GUIConsoleService_VTMSystemControl_Req, GUIConsoleService_VTMSystemControl_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_VTM_controlEntity(SpReqAnsContext<GUIConsoleService_VTM_controlEntity_Req, GUIConsoleService_VTM_controlEntity_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_GetAllEntityList(SpReqAnsContext<GUIConsoleService_GetAllEntityList_Req, GUIConsoleService_GetAllEntityList_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_GetBasicInformation(SpReqAnsContext<GUIConsoleService_GetBasicInformation_Req, GUIConsoleService_GetBasicInformation_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_GetHelpInformationArr(SpReqAnsContext<GUIConsoleService_GetHelpInformationArr_Req, GUIConsoleService_GetHelpInformationArr_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_GetHelpDetail(SpReqAnsContext<GUIConsoleService_GetHelpDetail_Req, GUIConsoleService_GetHelpDetail_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_OpenCommonPage(SpReqAnsContext<GUIConsoleService_OpenCommonPage_Req, GUIConsoleService_OpenCommonPage_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void Handle_CloseCommonPage(SpReqAnsContext<GUIConsoleService_CloseCommonPage_Req, GUIConsoleService_CloseCommonPage_Ans>::Pointer ctx)
- {
- /// override by user
- }
- virtual void OnRequest(CSmartPointer<ITransactionContext> 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<GUIConsoleService_OpenLogSender_Req,GUIConsoleService_OpenLogSender_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_OpenLogSender_Req,GUIConsoleService_OpenLogSender_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_OpenLogSender(ctx);
- }
- break;
- case GUIConsoleService_Method_CloseLogSender:
- {
- SpReqAnsContext<GUIConsoleService_CloseLogSender_Req,GUIConsoleService_CloseLogSender_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_CloseLogSender_Req,GUIConsoleService_CloseLogSender_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_CloseLogSender(ctx);
- }
- break;
- case GUIConsoleService_Method_OpenEntityMonitor:
- {
- SpReqAnsContext<GUIConsoleService_OpenEntityMonitor_Req,GUIConsoleService_OpenEntityMonitor_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_OpenEntityMonitor_Req,GUIConsoleService_OpenEntityMonitor_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_OpenEntityMonitor(ctx);
- }
- break;
- case GUIConsoleService_Method_CloseEntityMonitor:
- {
- SpReqAnsContext<GUIConsoleService_CloseEntityMonitor_Req,GUIConsoleService_CloseEntityMonitor_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_CloseEntityMonitor_Req,GUIConsoleService_CloseEntityMonitor_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_CloseEntityMonitor(ctx);
- }
- break;
- case GUIConsoleService_Method_OpenPerformanceSender:
- {
- SpReqAnsContext<GUIConsoleService_OpenPerformanceSender_Req,GUIConsoleService_OpenPerformanceSender_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_OpenPerformanceSender_Req,GUIConsoleService_OpenPerformanceSender_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_OpenPerformanceSender(ctx);
- }
- break;
- case GUIConsoleService_Method_ClosePerformanceSender:
- {
- SpReqAnsContext<GUIConsoleService_ClosePerformanceSender_Req,GUIConsoleService_ClosePerformanceSender_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_ClosePerformanceSender_Req,GUIConsoleService_ClosePerformanceSender_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_ClosePerformanceSender(ctx);
- }
- break;
- case GUIConsoleService_Method_VTMSystemControl:
- {
- SpReqAnsContext<GUIConsoleService_VTMSystemControl_Req,GUIConsoleService_VTMSystemControl_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_VTMSystemControl_Req,GUIConsoleService_VTMSystemControl_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_VTMSystemControl(ctx);
- }
- break;
- case GUIConsoleService_Method_VTM_controlEntity:
- {
- SpReqAnsContext<GUIConsoleService_VTM_controlEntity_Req,GUIConsoleService_VTM_controlEntity_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_VTM_controlEntity_Req,GUIConsoleService_VTM_controlEntity_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_VTM_controlEntity(ctx);
- }
- break;
- case GUIConsoleService_Method_GetAllEntityList:
- {
- SpReqAnsContext<GUIConsoleService_GetAllEntityList_Req,GUIConsoleService_GetAllEntityList_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_GetAllEntityList_Req,GUIConsoleService_GetAllEntityList_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_GetAllEntityList(ctx);
- }
- break;
- case GUIConsoleService_Method_GetBasicInformation:
- {
- SpReqAnsContext<GUIConsoleService_GetBasicInformation_Req,GUIConsoleService_GetBasicInformation_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_GetBasicInformation_Req,GUIConsoleService_GetBasicInformation_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_GetBasicInformation(ctx);
- }
- break;
- case GUIConsoleService_Method_GetHelpInformationArr:
- {
- SpReqAnsContext<GUIConsoleService_GetHelpInformationArr_Req,GUIConsoleService_GetHelpInformationArr_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_GetHelpInformationArr_Req,GUIConsoleService_GetHelpInformationArr_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_GetHelpInformationArr(ctx);
- }
- break;
- case GUIConsoleService_Method_GetHelpDetail:
- {
- SpReqAnsContext<GUIConsoleService_GetHelpDetail_Req,GUIConsoleService_GetHelpDetail_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_GetHelpDetail_Req,GUIConsoleService_GetHelpDetail_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_GetHelpDetail(ctx);
- }
- break;
- case GUIConsoleService_Method_OpenCommonPage:
- {
- SpReqAnsContext<GUIConsoleService_OpenCommonPage_Req,GUIConsoleService_OpenCommonPage_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_OpenCommonPage_Req,GUIConsoleService_OpenCommonPage_Ans>(pTransactionContext));
- SpBuffer2Object(Buf, ctx->Req);
- pTransactionContext->GetLinkContext(ctx->link);
- EntityResource::setLink(ctx->link);
- Handle_OpenCommonPage(ctx);
- }
- break;
- case GUIConsoleService_Method_CloseCommonPage:
- {
- SpReqAnsContext<GUIConsoleService_CloseCommonPage_Req,GUIConsoleService_CloseCommonPage_Ans>::Pointer ctx;
- ctx.Attach(new SpReqAnsContext<GUIConsoleService_CloseCommonPage_Req,GUIConsoleService_CloseCommonPage_Ans>(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
|