1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 /////////////////////////////////////////////////////////////////
18 // WARNING : this is a generated file, don't change it !
19 /////////////////////////////////////////////////////////////////
22 #include "admin_modules_itf.h"
27 /////////////////////////////////////////////////////////////////
28 // WARNING : this is a generated file, don't change it !
29 /////////////////////////////////////////////////////////////////
32 const CAdminServiceSkel::TMessageHandlerMap
&CAdminServiceSkel::getMessageHandlers() const
34 static TMessageHandlerMap handlers
;
35 static bool init
= false;
39 std::pair
< TMessageHandlerMap::iterator
, bool > res
;
41 res
= handlers
.insert(std::make_pair(std::string("USU"), &CAdminServiceSkel::upServiceUpdate_skel
));
42 // if this assert, you have a doubly message name in your interface definition !
45 res
= handlers
.insert(std::make_pair(std::string("GU"), &CAdminServiceSkel::graphUpdate_skel
));
46 // if this assert, you have a doubly message name in your interface definition !
49 res
= handlers
.insert(std::make_pair(std::string("HRGU"), &CAdminServiceSkel::highRezGraphUpdate_skel
));
50 // if this assert, you have a doubly message name in your interface definition !
53 res
= handlers
.insert(std::make_pair(std::string("CR"), &CAdminServiceSkel::commandResult_skel
));
54 // if this assert, you have a doubly message name in your interface definition !
62 bool CAdminServiceSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
)
64 const TMessageHandlerMap
&mh
= getMessageHandlers();
66 TMessageHandlerMap::const_iterator
it(mh
.find(message
.getName()));
73 TMessageHandler cmd
= it
->second
;
74 (this->*cmd
)(sender
, message
);
80 void CAdminServiceSkel::upServiceUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
82 H_AUTO(CAdminServiceSkel_upServiceUpdate_USU
);
83 std::vector
< TServiceStatus
> serviceStatus
;
84 nlRead(__message
, serialCont
, serviceStatus
);
85 upServiceUpdate(sender
, serviceStatus
);
88 void CAdminServiceSkel::graphUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
90 H_AUTO(CAdminServiceSkel_graphUpdate_GU
);
91 TGraphDatas graphDatas
;
92 nlRead(__message
, serial
, graphDatas
);
93 graphUpdate(sender
, graphDatas
);
96 void CAdminServiceSkel::highRezGraphUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
98 H_AUTO(CAdminServiceSkel_highRezGraphUpdate_HRGU
);
99 THighRezDatas graphDatas
;
100 nlRead(__message
, serial
, graphDatas
);
101 highRezGraphUpdate(sender
, graphDatas
);
104 void CAdminServiceSkel::commandResult_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
106 H_AUTO(CAdminServiceSkel_commandResult_CR
);
108 nlRead(__message
, serial
, commandId
);
109 std::string serviceAlias
;
110 nlRead(__message
, serial
, serviceAlias
);
112 nlRead(__message
, serial
, result
);
113 commandResult(sender
, commandId
, serviceAlias
, result
);
115 // An AES send an update of the list of service up
116 void CAdminServiceProxy::upServiceUpdate(NLNET::IModule
*sender
, const std::vector
< TServiceStatus
> &serviceStatus
)
118 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
120 // immediate local synchronous dispatching
121 _LocalModuleSkel
->upServiceUpdate(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), serviceStatus
);
125 // send the message for remote dispatching and execution or local queing
126 NLNET::CMessage __message
;
128 buildMessageFor_upServiceUpdate(__message
, serviceStatus
);
130 _ModuleProxy
->sendModuleMessage(sender
, __message
);
133 // An AES send graph data update
134 void CAdminServiceProxy::graphUpdate(NLNET::IModule
*sender
, const TGraphDatas
&graphDatas
)
136 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
138 // immediate local synchronous dispatching
139 _LocalModuleSkel
->graphUpdate(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), graphDatas
);
143 // send the message for remote dispatching and execution or local queing
144 NLNET::CMessage __message
;
146 buildMessageFor_graphUpdate(__message
, graphDatas
);
148 _ModuleProxy
->sendModuleMessage(sender
, __message
);
151 // An AES send high rez graph data update
152 void CAdminServiceProxy::highRezGraphUpdate(NLNET::IModule
*sender
, const THighRezDatas
&graphDatas
)
154 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
156 // immediate local synchronous dispatching
157 _LocalModuleSkel
->highRezGraphUpdate(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), graphDatas
);
161 // send the message for remote dispatching and execution or local queing
162 NLNET::CMessage __message
;
164 buildMessageFor_highRezGraphUpdate(__message
, graphDatas
);
166 _ModuleProxy
->sendModuleMessage(sender
, __message
);
169 // AES send back the result of execution of a command
170 void CAdminServiceProxy::commandResult(NLNET::IModule
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&result
)
172 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
174 // immediate local synchronous dispatching
175 _LocalModuleSkel
->commandResult(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), commandId
, serviceAlias
, result
);
179 // send the message for remote dispatching and execution or local queing
180 NLNET::CMessage __message
;
182 buildMessageFor_commandResult(__message
, commandId
, serviceAlias
, result
);
184 _ModuleProxy
->sendModuleMessage(sender
, __message
);
188 // Message serializer. Return the message received in reference for easier integration
189 const NLNET::CMessage
&CAdminServiceProxy::buildMessageFor_upServiceUpdate(NLNET::CMessage
&__message
, const std::vector
< TServiceStatus
> &serviceStatus
)
191 __message
.setType("USU");
192 nlWrite(__message
, serialCont
, const_cast < std::vector
< TServiceStatus
>& > (serviceStatus
));
198 // Message serializer. Return the message received in reference for easier integration
199 const NLNET::CMessage
&CAdminServiceProxy::buildMessageFor_graphUpdate(NLNET::CMessage
&__message
, const TGraphDatas
&graphDatas
)
201 __message
.setType("GU");
202 nlWrite(__message
, serial
, const_cast < TGraphDatas
& > (graphDatas
));
208 // Message serializer. Return the message received in reference for easier integration
209 const NLNET::CMessage
&CAdminServiceProxy::buildMessageFor_highRezGraphUpdate(NLNET::CMessage
&__message
, const THighRezDatas
&graphDatas
)
211 __message
.setType("HRGU");
212 nlWrite(__message
, serial
, const_cast < THighRezDatas
& > (graphDatas
));
218 // Message serializer. Return the message received in reference for easier integration
219 const NLNET::CMessage
&CAdminServiceProxy::buildMessageFor_commandResult(NLNET::CMessage
&__message
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&result
)
221 __message
.setType("CR");
222 nlWrite(__message
, serial
, commandId
);
223 nlWrite(__message
, serial
, const_cast < std::string
& > (serviceAlias
));
224 nlWrite(__message
, serial
, const_cast < std::string
& > (result
));
230 /////////////////////////////////////////////////////////////////
231 // WARNING : this is a generated file, don't change it !
232 /////////////////////////////////////////////////////////////////
235 const CAdminExecutorServiceSkel::TMessageHandlerMap
&CAdminExecutorServiceSkel::getMessageHandlers() const
237 static TMessageHandlerMap handlers
;
238 static bool init
= false;
242 std::pair
< TMessageHandlerMap::iterator
, bool > res
;
244 res
= handlers
.insert(std::make_pair(std::string("SCO"), &CAdminExecutorServiceSkel::setShardOrders_skel
));
245 // if this assert, you have a doubly message name in your interface definition !
246 nlassert(res
.second
);
248 res
= handlers
.insert(std::make_pair(std::string("SDS"), &CAdminExecutorServiceSkel::shutdownShard_skel
));
249 // if this assert, you have a doubly message name in your interface definition !
250 nlassert(res
.second
);
252 res
= handlers
.insert(std::make_pair(std::string("CC"), &CAdminExecutorServiceSkel::controlCmd_skel
));
253 // if this assert, you have a doubly message name in your interface definition !
254 nlassert(res
.second
);
256 res
= handlers
.insert(std::make_pair(std::string("SCMD"), &CAdminExecutorServiceSkel::serviceCmd_skel
));
257 // if this assert, you have a doubly message name in your interface definition !
258 nlassert(res
.second
);
260 res
= handlers
.insert(std::make_pair(std::string("CR"), &CAdminExecutorServiceSkel::commandResult_skel
));
261 // if this assert, you have a doubly message name in your interface definition !
262 nlassert(res
.second
);
264 res
= handlers
.insert(std::make_pair(std::string("GU"), &CAdminExecutorServiceSkel::graphUpdate_skel
));
265 // if this assert, you have a doubly message name in your interface definition !
266 nlassert(res
.second
);
268 res
= handlers
.insert(std::make_pair(std::string("HRGU"), &CAdminExecutorServiceSkel::highRezGraphUpdate_skel
));
269 // if this assert, you have a doubly message name in your interface definition !
270 nlassert(res
.second
);
272 res
= handlers
.insert(std::make_pair(std::string("SSU"), &CAdminExecutorServiceSkel::serviceStatusUpdate_skel
));
273 // if this assert, you have a doubly message name in your interface definition !
274 nlassert(res
.second
);
281 bool CAdminExecutorServiceSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
)
283 const TMessageHandlerMap
&mh
= getMessageHandlers();
285 TMessageHandlerMap::const_iterator
it(mh
.find(message
.getName()));
292 TMessageHandler cmd
= it
->second
;
293 (this->*cmd
)(sender
, message
);
299 void CAdminExecutorServiceSkel::setShardOrders_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
301 H_AUTO(CAdminExecutorServiceSkel_setShardOrders_SCO
);
302 std::string shardName
;
303 nlRead(__message
, serial
, shardName
);
304 TShardOrders shardOrders
;
305 nlRead(__message
, serial
, shardOrders
);
306 setShardOrders(sender
, shardName
, shardOrders
);
309 void CAdminExecutorServiceSkel::shutdownShard_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
311 H_AUTO(CAdminExecutorServiceSkel_shutdownShard_SDS
);
312 std::string shardName
;
313 nlRead(__message
, serial
, shardName
);
315 nlRead(__message
, serial
, delay
);
316 shutdownShard(sender
, shardName
, delay
);
319 void CAdminExecutorServiceSkel::controlCmd_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
321 H_AUTO(CAdminExecutorServiceSkel_controlCmd_CC
);
323 nlRead(__message
, serial
, commandId
);
324 std::string serviceAlias
;
325 nlRead(__message
, serial
, serviceAlias
);
327 nlRead(__message
, serial
, command
);
328 controlCmd(sender
, commandId
, serviceAlias
, command
);
331 void CAdminExecutorServiceSkel::serviceCmd_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
333 H_AUTO(CAdminExecutorServiceSkel_serviceCmd_SCMD
);
335 nlRead(__message
, serial
, commandId
);
336 std::string serviceAlias
;
337 nlRead(__message
, serial
, serviceAlias
);
339 nlRead(__message
, serial
, command
);
340 serviceCmd(sender
, commandId
, serviceAlias
, command
);
343 void CAdminExecutorServiceSkel::commandResult_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
345 H_AUTO(CAdminExecutorServiceSkel_commandResult_CR
);
347 nlRead(__message
, serial
, commandId
);
348 std::string serviceAlias
;
349 nlRead(__message
, serial
, serviceAlias
);
351 nlRead(__message
, serial
, result
);
352 commandResult(sender
, commandId
, serviceAlias
, result
);
355 void CAdminExecutorServiceSkel::graphUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
357 H_AUTO(CAdminExecutorServiceSkel_graphUpdate_GU
);
358 TGraphDatas graphDatas
;
359 nlRead(__message
, serial
, graphDatas
);
360 graphUpdate(sender
, graphDatas
);
363 void CAdminExecutorServiceSkel::highRezGraphUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
365 H_AUTO(CAdminExecutorServiceSkel_highRezGraphUpdate_HRGU
);
366 THighRezDatas graphDatas
;
367 nlRead(__message
, serial
, graphDatas
);
368 highRezGraphUpdate(sender
, graphDatas
);
371 void CAdminExecutorServiceSkel::serviceStatusUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
373 H_AUTO(CAdminExecutorServiceSkel_serviceStatusUpdate_SSU
);
375 nlRead(__message
, serial
, status
);
376 serviceStatusUpdate(sender
, status
);
378 // AS send orders for a shard
379 void CAdminExecutorServiceProxy::setShardOrders(NLNET::IModule
*sender
, const std::string
&shardName
, const TShardOrders
&shardOrders
)
381 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
383 // immediate local synchronous dispatching
384 _LocalModuleSkel
->setShardOrders(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), shardName
, shardOrders
);
388 // send the message for remote dispatching and execution or local queing
389 NLNET::CMessage __message
;
391 buildMessageFor_setShardOrders(__message
, shardName
, shardOrders
);
393 _ModuleProxy
->sendModuleMessage(sender
, __message
);
396 // AS send a command to shutdown a shard with a delay
397 void CAdminExecutorServiceProxy::shutdownShard(NLNET::IModule
*sender
, const std::string
&shardName
, uint32 delay
)
399 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
401 // immediate local synchronous dispatching
402 _LocalModuleSkel
->shutdownShard(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), shardName
, delay
);
406 // send the message for remote dispatching and execution or local queing
407 NLNET::CMessage __message
;
409 buildMessageFor_shutdownShard(__message
, shardName
, delay
);
411 _ModuleProxy
->sendModuleMessage(sender
, __message
);
414 // AS send a control command to this AES
415 void CAdminExecutorServiceProxy::controlCmd(NLNET::IModule
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&command
)
417 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
419 // immediate local synchronous dispatching
420 _LocalModuleSkel
->controlCmd(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), commandId
, serviceAlias
, command
);
424 // send the message for remote dispatching and execution or local queing
425 NLNET::CMessage __message
;
427 buildMessageFor_controlCmd(__message
, commandId
, serviceAlias
, command
);
429 _ModuleProxy
->sendModuleMessage(sender
, __message
);
432 // Send a command to a service.
433 void CAdminExecutorServiceProxy::serviceCmd(NLNET::IModule
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&command
)
435 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
437 // immediate local synchronous dispatching
438 _LocalModuleSkel
->serviceCmd(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), commandId
, serviceAlias
, command
);
442 // send the message for remote dispatching and execution or local queing
443 NLNET::CMessage __message
;
445 buildMessageFor_serviceCmd(__message
, commandId
, serviceAlias
, command
);
447 _ModuleProxy
->sendModuleMessage(sender
, __message
);
450 // AES client send back the result of execution of a command
451 void CAdminExecutorServiceProxy::commandResult(NLNET::IModule
*sender
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&result
)
453 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
455 // immediate local synchronous dispatching
456 _LocalModuleSkel
->commandResult(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), commandId
, serviceAlias
, result
);
460 // send the message for remote dispatching and execution or local queing
461 NLNET::CMessage __message
;
463 buildMessageFor_commandResult(__message
, commandId
, serviceAlias
, result
);
465 _ModuleProxy
->sendModuleMessage(sender
, __message
);
468 // A service send graph data update
469 void CAdminExecutorServiceProxy::graphUpdate(NLNET::IModule
*sender
, const TGraphDatas
&graphDatas
)
471 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
473 // immediate local synchronous dispatching
474 _LocalModuleSkel
->graphUpdate(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), graphDatas
);
478 // send the message for remote dispatching and execution or local queing
479 NLNET::CMessage __message
;
481 buildMessageFor_graphUpdate(__message
, graphDatas
);
483 _ModuleProxy
->sendModuleMessage(sender
, __message
);
486 // A service high rez graph data update
487 void CAdminExecutorServiceProxy::highRezGraphUpdate(NLNET::IModule
*sender
, const THighRezDatas
&graphDatas
)
489 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
491 // immediate local synchronous dispatching
492 _LocalModuleSkel
->highRezGraphUpdate(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), graphDatas
);
496 // send the message for remote dispatching and execution or local queing
497 NLNET::CMessage __message
;
499 buildMessageFor_highRezGraphUpdate(__message
, graphDatas
);
501 _ModuleProxy
->sendModuleMessage(sender
, __message
);
504 // A service send an update of of it's status string
505 void CAdminExecutorServiceProxy::serviceStatusUpdate(NLNET::IModule
*sender
, const std::string
&status
)
507 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
509 // immediate local synchronous dispatching
510 _LocalModuleSkel
->serviceStatusUpdate(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), status
);
514 // send the message for remote dispatching and execution or local queing
515 NLNET::CMessage __message
;
517 buildMessageFor_serviceStatusUpdate(__message
, status
);
519 _ModuleProxy
->sendModuleMessage(sender
, __message
);
523 // Message serializer. Return the message received in reference for easier integration
524 const NLNET::CMessage
&CAdminExecutorServiceProxy::buildMessageFor_setShardOrders(NLNET::CMessage
&__message
, const std::string
&shardName
, const TShardOrders
&shardOrders
)
526 __message
.setType("SCO");
527 nlWrite(__message
, serial
, const_cast < std::string
& > (shardName
));
528 nlWrite(__message
, serial
, shardOrders
);
534 // Message serializer. Return the message received in reference for easier integration
535 const NLNET::CMessage
&CAdminExecutorServiceProxy::buildMessageFor_shutdownShard(NLNET::CMessage
&__message
, const std::string
&shardName
, uint32 delay
)
537 __message
.setType("SDS");
538 nlWrite(__message
, serial
, const_cast < std::string
& > (shardName
));
539 nlWrite(__message
, serial
, delay
);
545 // Message serializer. Return the message received in reference for easier integration
546 const NLNET::CMessage
&CAdminExecutorServiceProxy::buildMessageFor_controlCmd(NLNET::CMessage
&__message
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&command
)
548 __message
.setType("CC");
549 nlWrite(__message
, serial
, commandId
);
550 nlWrite(__message
, serial
, const_cast < std::string
& > (serviceAlias
));
551 nlWrite(__message
, serial
, const_cast < std::string
& > (command
));
557 // Message serializer. Return the message received in reference for easier integration
558 const NLNET::CMessage
&CAdminExecutorServiceProxy::buildMessageFor_serviceCmd(NLNET::CMessage
&__message
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&command
)
560 __message
.setType("SCMD");
561 nlWrite(__message
, serial
, commandId
);
562 nlWrite(__message
, serial
, const_cast < std::string
& > (serviceAlias
));
563 nlWrite(__message
, serial
, const_cast < std::string
& > (command
));
569 // Message serializer. Return the message received in reference for easier integration
570 const NLNET::CMessage
&CAdminExecutorServiceProxy::buildMessageFor_commandResult(NLNET::CMessage
&__message
, uint32 commandId
, const std::string
&serviceAlias
, const std::string
&result
)
572 __message
.setType("CR");
573 nlWrite(__message
, serial
, commandId
);
574 nlWrite(__message
, serial
, const_cast < std::string
& > (serviceAlias
));
575 nlWrite(__message
, serial
, const_cast < std::string
& > (result
));
581 // Message serializer. Return the message received in reference for easier integration
582 const NLNET::CMessage
&CAdminExecutorServiceProxy::buildMessageFor_graphUpdate(NLNET::CMessage
&__message
, const TGraphDatas
&graphDatas
)
584 __message
.setType("GU");
585 nlWrite(__message
, serial
, const_cast < TGraphDatas
& > (graphDatas
));
591 // Message serializer. Return the message received in reference for easier integration
592 const NLNET::CMessage
&CAdminExecutorServiceProxy::buildMessageFor_highRezGraphUpdate(NLNET::CMessage
&__message
, const THighRezDatas
&graphDatas
)
594 __message
.setType("HRGU");
595 nlWrite(__message
, serial
, const_cast < THighRezDatas
& > (graphDatas
));
601 // Message serializer. Return the message received in reference for easier integration
602 const NLNET::CMessage
&CAdminExecutorServiceProxy::buildMessageFor_serviceStatusUpdate(NLNET::CMessage
&__message
, const std::string
&status
)
604 __message
.setType("SSU");
605 nlWrite(__message
, serial
, const_cast < std::string
& > (status
));
611 /////////////////////////////////////////////////////////////////
612 // WARNING : this is a generated file, don't change it !
613 /////////////////////////////////////////////////////////////////
616 const CAdminExecutorServiceClientSkel::TMessageHandlerMap
&CAdminExecutorServiceClientSkel::getMessageHandlers() const
618 static TMessageHandlerMap handlers
;
619 static bool init
= false;
623 std::pair
< TMessageHandlerMap::iterator
, bool > res
;
625 res
= handlers
.insert(std::make_pair(std::string("SCMD"), &CAdminExecutorServiceClientSkel::serviceCmd_skel
));
626 // if this assert, you have a doubly message name in your interface definition !
627 nlassert(res
.second
);
629 res
= handlers
.insert(std::make_pair(std::string("SCMDNR"), &CAdminExecutorServiceClientSkel::serviceCmdNoReturn_skel
));
630 // if this assert, you have a doubly message name in your interface definition !
631 nlassert(res
.second
);
638 bool CAdminExecutorServiceClientSkel::fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
)
640 const TMessageHandlerMap
&mh
= getMessageHandlers();
642 TMessageHandlerMap::const_iterator
it(mh
.find(message
.getName()));
649 TMessageHandler cmd
= it
->second
;
650 (this->*cmd
)(sender
, message
);
656 void CAdminExecutorServiceClientSkel::serviceCmd_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
658 H_AUTO(CAdminExecutorServiceClientSkel_serviceCmd_SCMD
);
660 nlRead(__message
, serial
, commandId
);
662 nlRead(__message
, serial
, command
);
663 serviceCmd(sender
, commandId
, command
);
666 void CAdminExecutorServiceClientSkel::serviceCmdNoReturn_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
)
668 H_AUTO(CAdminExecutorServiceClientSkel_serviceCmdNoReturn_SCMDNR
);
670 nlRead(__message
, serial
, command
);
671 serviceCmdNoReturn(sender
, command
);
673 // execute a command and return the result.
674 void CAdminExecutorServiceClientProxy::serviceCmd(NLNET::IModule
*sender
, uint32 commandId
, const std::string
&command
)
676 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
678 // immediate local synchronous dispatching
679 _LocalModuleSkel
->serviceCmd(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), commandId
, command
);
683 // send the message for remote dispatching and execution or local queing
684 NLNET::CMessage __message
;
686 buildMessageFor_serviceCmd(__message
, commandId
, command
);
688 _ModuleProxy
->sendModuleMessage(sender
, __message
);
691 // Send a command to a service without waiting for the return value.
692 void CAdminExecutorServiceClientProxy::serviceCmdNoReturn(NLNET::IModule
*sender
, const std::string
&command
)
694 if (_LocalModuleSkel
&& _LocalModule
->isImmediateDispatchingSupported())
696 // immediate local synchronous dispatching
697 _LocalModuleSkel
->serviceCmdNoReturn(_ModuleProxy
->getModuleGateway()->getPluggedModuleProxy(sender
), command
);
701 // send the message for remote dispatching and execution or local queing
702 NLNET::CMessage __message
;
704 buildMessageFor_serviceCmdNoReturn(__message
, command
);
706 _ModuleProxy
->sendModuleMessage(sender
, __message
);
710 // Message serializer. Return the message received in reference for easier integration
711 const NLNET::CMessage
&CAdminExecutorServiceClientProxy::buildMessageFor_serviceCmd(NLNET::CMessage
&__message
, uint32 commandId
, const std::string
&command
)
713 __message
.setType("SCMD");
714 nlWrite(__message
, serial
, commandId
);
715 nlWrite(__message
, serial
, const_cast < std::string
& > (command
));
721 // Message serializer. Return the message received in reference for easier integration
722 const NLNET::CMessage
&CAdminExecutorServiceClientProxy::buildMessageFor_serviceCmdNoReturn(NLNET::CMessage
&__message
, const std::string
&command
)
724 __message
.setType("SCMDNR");
725 nlWrite(__message
, serial
, const_cast < std::string
& > (command
));