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 /////////////////////////////////////////////////////////////////
21 #ifndef BACKUP_SERVICE_ITF
22 #define BACKUP_SERVICE_ITF
23 #include "nel/misc/types_nl.h"
27 #include "nel/misc/hierarchical_timer.h"
28 #include "nel/misc/string_conversion.h"
29 #include "nel/net/message.h"
30 #include "nel/net/module.h"
31 #include "nel/net/module_builder_parts.h"
32 #include "nel/net/module_message.h"
33 #include "nel/net/module_gateway.h"
35 #include "nel/misc/entity_id.h"
41 /////////////////////////////////////////////////////////////////
42 // WARNING : this is a generated file, don't change it !
43 /////////////////////////////////////////////////////////////////
44 class CBackupServiceSkel
47 /// the interceptor type
48 typedef NLNET::CInterceptorForwarder
< CBackupServiceSkel
> TInterceptor
;
52 // do early run time check for message table
55 virtual ~CBackupServiceSkel()
59 void init(NLNET::IModule
*module
)
61 _Interceptor
.init(this, module
);
64 // unused interceptors
65 std::string
fwdBuildModuleManifest() const { return std::string(); }
66 void fwdOnModuleUp(NLNET::IModuleProxy
*moduleProxy
) {}
67 void fwdOnModuleDown(NLNET::IModuleProxy
*moduleProxy
) {}
68 void fwdOnModuleSecurityChange(NLNET::IModuleProxy
*moduleProxy
) {}
70 // process module message interceptor
71 bool fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
74 typedef void (CBackupServiceSkel::*TMessageHandler
)(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
75 typedef std::map
<std::string
, TMessageHandler
> TMessageHandlerMap
;
77 const TMessageHandlerMap
&getMessageHandlers() const;
80 void saveFile_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
82 void loadFile_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
84 // declare one interceptor member of the skeleton
85 TInterceptor _Interceptor
;
87 // declare the interceptor forwarder as friend of this class
88 friend class NLNET::CInterceptorForwarder
< CBackupServiceSkel
>;
90 /////////////////////////////////////////////////////////////////
91 // WARNING : this is a generated file, don't change it !
92 /////////////////////////////////////////////////////////////////
94 // A module ask to save a file in the backup repository
95 virtual void saveFile(NLNET::IModuleProxy
*sender
, const std::string
&fileName
, const NLNET::TBinBuffer
&data
) =0;
96 // A module ask to load a file
97 virtual void loadFile(NLNET::IModuleProxy
*sender
, const std::string
&fileName
, uint32 requestId
) =0;
102 /////////////////////////////////////////////////////////////////
103 // WARNING : this is a generated file, don't change it !
104 /////////////////////////////////////////////////////////////////
105 class CBackupServiceProxy
107 /// Smart pointer on the module proxy
108 NLNET::TModuleProxyPtr _ModuleProxy
;
110 // Pointer on the local module that implement the interface (if the proxy is for a local module)
111 NLNET::TModulePtr _LocalModule
;
112 // Direct pointer on the server implementation interface for collocated module
113 CBackupServiceSkel
*_LocalModuleSkel
;
117 CBackupServiceProxy(NLNET::IModuleProxy
*proxy
)
120 _ModuleProxy
= proxy
;
122 // initialize collocated servant interface
123 if (proxy
->getModuleDistance() == 0)
125 _LocalModule
= proxy
->getLocalModule();
126 nlassert(_LocalModule
!= NULL
);
127 CBackupServiceSkel::TInterceptor
*interceptor
= NULL
;
128 interceptor
= static_cast < NLNET::CModuleBase
* >(_LocalModule
.getPtr())->getInterceptor(interceptor
);
129 nlassert(interceptor
!= NULL
);
131 _LocalModuleSkel
= interceptor
->getParent();
132 nlassert(_LocalModuleSkel
!= NULL
);
135 _LocalModuleSkel
= 0;
138 virtual ~CBackupServiceProxy()
142 NLNET::IModuleProxy
*getModuleProxy()
147 // A module ask to save a file in the backup repository
148 void saveFile(NLNET::IModule
*sender
, const std::string
&fileName
, const NLNET::TBinBuffer
&data
);
149 // A module ask to load a file
150 void loadFile(NLNET::IModule
*sender
, const std::string
&fileName
, uint32 requestId
);
152 // Message serializer. Return the message received in reference for easier integration
153 static const NLNET::CMessage
&buildMessageFor_saveFile(NLNET::CMessage
&__message
, const std::string
&fileName
, const NLNET::TBinBuffer
&data
);
155 // Message serializer. Return the message received in reference for easier integration
156 static const NLNET::CMessage
&buildMessageFor_loadFile(NLNET::CMessage
&__message
, const std::string
&fileName
, uint32 requestId
);
163 /////////////////////////////////////////////////////////////////
164 // WARNING : this is a generated file, don't change it !
165 /////////////////////////////////////////////////////////////////
166 class CBackupServiceClientSkel
169 /// the interceptor type
170 typedef NLNET::CInterceptorForwarder
< CBackupServiceClientSkel
> TInterceptor
;
172 CBackupServiceClientSkel()
174 // do early run time check for message table
175 getMessageHandlers();
177 virtual ~CBackupServiceClientSkel()
181 void init(NLNET::IModule
*module
)
183 _Interceptor
.init(this, module
);
186 // unused interceptors
187 std::string
fwdBuildModuleManifest() const { return std::string(); }
188 void fwdOnModuleUp(NLNET::IModuleProxy
*moduleProxy
) {}
189 void fwdOnModuleDown(NLNET::IModuleProxy
*moduleProxy
) {}
190 void fwdOnModuleSecurityChange(NLNET::IModuleProxy
*moduleProxy
) {}
192 // process module message interceptor
193 bool fwdOnProcessModuleMessage(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
196 typedef void (CBackupServiceClientSkel::*TMessageHandler
)(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&message
);
197 typedef std::map
<std::string
, TMessageHandler
> TMessageHandlerMap
;
199 const TMessageHandlerMap
&getMessageHandlers() const;
202 void loadFileResult_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
204 void fileUpdate_skel(NLNET::IModuleProxy
*sender
, const NLNET::CMessage
&__message
);
206 // declare one interceptor member of the skeleton
207 TInterceptor _Interceptor
;
209 // declare the interceptor forwarder as friend of this class
210 friend class NLNET::CInterceptorForwarder
< CBackupServiceClientSkel
>;
212 /////////////////////////////////////////////////////////////////
213 // WARNING : this is a generated file, don't change it !
214 /////////////////////////////////////////////////////////////////
216 // The BS return for a load file request
217 virtual void loadFileResult(NLNET::IModuleProxy
*sender
, uint32 requestId
, const std::string
&fileName
, uint32 fileTimeStamp
, const NLNET::TBinBuffer
&data
) =0;
218 // A file listened by the client have been changed, BS resend the file content
219 virtual void fileUpdate(NLNET::IModuleProxy
*sender
, const std::string
&fileName
, const std::vector
< std::string
> &content
) =0;
224 /////////////////////////////////////////////////////////////////
225 // WARNING : this is a generated file, don't change it !
226 /////////////////////////////////////////////////////////////////
227 class CBackupServiceClientProxy
229 /// Smart pointer on the module proxy
230 NLNET::TModuleProxyPtr _ModuleProxy
;
232 // Pointer on the local module that implement the interface (if the proxy is for a local module)
233 NLNET::TModulePtr _LocalModule
;
234 // Direct pointer on the server implementation interface for collocated module
235 CBackupServiceClientSkel
*_LocalModuleSkel
;
239 CBackupServiceClientProxy(NLNET::IModuleProxy
*proxy
)
242 _ModuleProxy
= proxy
;
244 // initialize collocated servant interface
245 if (proxy
->getModuleDistance() == 0)
247 _LocalModule
= proxy
->getLocalModule();
248 nlassert(_LocalModule
!= NULL
);
249 CBackupServiceClientSkel::TInterceptor
*interceptor
= NULL
;
250 interceptor
= static_cast < NLNET::CModuleBase
* >(_LocalModule
.getPtr())->getInterceptor(interceptor
);
251 nlassert(interceptor
!= NULL
);
253 _LocalModuleSkel
= interceptor
->getParent();
254 nlassert(_LocalModuleSkel
!= NULL
);
257 _LocalModuleSkel
= 0;
260 virtual ~CBackupServiceClientProxy()
264 NLNET::IModuleProxy
*getModuleProxy()
269 // The BS return for a load file request
270 void loadFileResult(NLNET::IModule
*sender
, uint32 requestId
, const std::string
&fileName
, uint32 fileTimeStamp
, const NLNET::TBinBuffer
&data
);
271 // A file listened by the client have been changed, BS resend the file content
272 void fileUpdate(NLNET::IModule
*sender
, const std::string
&fileName
, const std::vector
< std::string
> &content
);
274 // Message serializer. Return the message received in reference for easier integration
275 static const NLNET::CMessage
&buildMessageFor_loadFileResult(NLNET::CMessage
&__message
, uint32 requestId
, const std::string
&fileName
, uint32 fileTimeStamp
, const NLNET::TBinBuffer
&data
);
277 // Message serializer. Return the message received in reference for easier integration
278 static const NLNET::CMessage
&buildMessageFor_fileUpdate(NLNET::CMessage
&__message
, const std::string
&fileName
, const std::vector
< std::string
> &content
);