FingerPrint_client_g.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. #ifndef __FINGERPRINT_CLIENT_G_H
  2. #define __FINGERPRINT_CLIENT_G_H
  3. #pragma once
  4. // This code is generated by spgen tool!
  5. #include "FingerPrint_def_g.h"
  6. namespace FingerPrint {
  7. class FingerPrintService_ClientBase : public CClientSessionBase {
  8. public:
  9. explicit FingerPrintService_ClientBase(CEntityBase *pEntity) : m_pEntityBase(pEntity), m_bSysManaged(false) {}
  10. FingerPrintService_ClientBase* operator () (const linkContext &curLink)
  11. {
  12. m_context = curLink;
  13. return this;
  14. }
  15. protected:
  16. virtual ~FingerPrintService_ClientBase()
  17. {
  18. /// override by user
  19. }
  20. public:
  21. void OnConnectSucceed()
  22. {
  23. bSessionClosed = false;
  24. }
  25. void OnClose(ErrorCodeEnum)
  26. {
  27. bSessionClosed = true;
  28. }
  29. bool QuerySessionClosed()
  30. {
  31. return bSessionClosed;
  32. }
  33. ErrorCodeEnum Connect(CSmartPointer<IAsynWaitSp> &spAsyncWait)
  34. {
  35. CSmartPointer<IEntityFunction> pFunc = m_pEntityBase->GetFunction();
  36. ErrorCodeEnum Error = pFunc->ConnectRemoteEntity(this, "FingerPrint", "FingerPrintService", spAsyncWait);
  37. if (Error == Error_Succeed) {
  38. m_bSysManaged = true;
  39. bSessionClosed = false;
  40. }
  41. return Error;
  42. }
  43. ErrorCodeEnum Connect()
  44. {
  45. CSmartPointer<IAsynWaitSp> spAsyncWait;
  46. ErrorCodeEnum Error = Connect(spAsyncWait);
  47. if (Error == Error_Succeed) {
  48. Error = spAsyncWait->WaitAnswer();
  49. }
  50. return Error;
  51. }
  52. ErrorCodeEnum GetImageAndFeature(FingerPrintService_GetImageAndFeature_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
  53. {
  54. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  55. CAutoBuffer Buf = SpObject2Buffer(Req);
  56. if (m_context.checkEmpty())
  57. {
  58. m_context.AutoGenerate();
  59. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  60. m_context = m_context.upgradeLink();
  61. }
  62. auto ret = pFunc->AsyncRequest(FingerPrintService_Method_GetImageAndFeature, FingerPrintService_MethodSignature_GetImageAndFeature, Buf, spAsyncWait, m_context, dwTimeout);
  63. m_context.clear();
  64. return ret;
  65. }
  66. ErrorCodeEnum GetImageAndFeature(FingerPrintService_GetImageAndFeature_Req &Req, FingerPrintService_GetImageAndFeature_Ans &Ans, DWORD dwTimeout)
  67. {
  68. CSmartPointer<IAsynWaitSp> spAsyncWait;
  69. ErrorCodeEnum Error = GetImageAndFeature(Req, spAsyncWait, dwTimeout);
  70. if (Error == Error_Succeed) {
  71. bool bEnd = false;
  72. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
  73. LOG_ASSERT(Error || bEnd);
  74. }
  75. return Error;
  76. }
  77. ErrorCodeEnum GetImageAndFeature(FingerPrintService_GetImageAndFeature_Req &Req, FingerPrintService_GetImageAndFeature_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
  78. {
  79. CSmartPointer<IAsynWaitSp> spAsyncWait;
  80. ErrorCodeEnum Error = GetImageAndFeature(Req, spAsyncWait, dwTimeout);
  81. if (Error == Error_Succeed) {
  82. bool bEnd = false;
  83. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  84. LOG_ASSERT(Error || bEnd);
  85. }
  86. return Error;
  87. }
  88. ErrorCodeEnum GetImageAndFeature(FingerPrintService_GetImageAndFeature_Req &Req, FingerPrintService_GetImageAndFeature_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
  89. {
  90. CSmartPointer<IAsynWaitSp> spAsyncWait;
  91. ErrorCodeEnum Error = GetImageAndFeature(Req, spAsyncWait, dwTimeout);
  92. if (Error == Error_Succeed) {
  93. bool bEnd = false;
  94. CSimpleString str;
  95. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  96. LOG_ASSERT(Error || bEnd);
  97. }
  98. return Error;
  99. }
  100. ErrorCodeEnum CancelRegister()
  101. {
  102. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  103. if (m_context.checkEmpty())
  104. {
  105. m_context.AutoGenerate();
  106. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  107. m_context = m_context.upgradeLink();
  108. }
  109. auto ret = pFunc->OnewayCall(FingerPrintService_Method_CancelRegister, FingerPrintService_MethodSignature_CancelRegister, m_context);
  110. m_context.clear();
  111. return ret;
  112. }
  113. ErrorCodeEnum CancelMatch()
  114. {
  115. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  116. if (m_context.checkEmpty())
  117. {
  118. m_context.AutoGenerate();
  119. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  120. m_context = m_context.upgradeLink();
  121. }
  122. auto ret = pFunc->OnewayCall(FingerPrintService_Method_CancelMatch, FingerPrintService_MethodSignature_CancelMatch, m_context);
  123. m_context.clear();
  124. return ret;
  125. }
  126. ErrorCodeEnum Exit()
  127. {
  128. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  129. if (m_context.checkEmpty())
  130. {
  131. m_context.AutoGenerate();
  132. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  133. m_context = m_context.upgradeLink();
  134. }
  135. auto ret = pFunc->OnewayCall(FingerPrintService_Method_Exit, FingerPrintService_MethodSignature_Exit, m_context);
  136. m_context.clear();
  137. return ret;
  138. }
  139. ErrorCodeEnum Match(FingerPrintService_Match_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
  140. {
  141. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  142. CAutoBuffer Buf = SpObject2Buffer(Req);
  143. if (m_context.checkEmpty())
  144. {
  145. m_context.AutoGenerate();
  146. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  147. m_context = m_context.upgradeLink();
  148. }
  149. auto ret = pFunc->AsyncRequest(FingerPrintService_Method_Match, FingerPrintService_MethodSignature_Match, Buf, spAsyncWait, m_context, dwTimeout);
  150. m_context.clear();
  151. return ret;
  152. }
  153. ErrorCodeEnum Match(FingerPrintService_Match_Req &Req, FingerPrintService_Match_Ans &Ans, DWORD dwTimeout)
  154. {
  155. CSmartPointer<IAsynWaitSp> spAsyncWait;
  156. ErrorCodeEnum Error = Match(Req, spAsyncWait, dwTimeout);
  157. if (Error == Error_Succeed) {
  158. bool bEnd = false;
  159. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
  160. LOG_ASSERT(Error || bEnd);
  161. }
  162. return Error;
  163. }
  164. ErrorCodeEnum Match(FingerPrintService_Match_Req &Req, FingerPrintService_Match_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
  165. {
  166. CSmartPointer<IAsynWaitSp> spAsyncWait;
  167. ErrorCodeEnum Error = Match(Req, spAsyncWait, dwTimeout);
  168. if (Error == Error_Succeed) {
  169. bool bEnd = false;
  170. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  171. LOG_ASSERT(Error || bEnd);
  172. }
  173. return Error;
  174. }
  175. ErrorCodeEnum Match(FingerPrintService_Match_Req &Req, FingerPrintService_Match_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
  176. {
  177. CSmartPointer<IAsynWaitSp> spAsyncWait;
  178. ErrorCodeEnum Error = Match(Req, spAsyncWait, dwTimeout);
  179. if (Error == Error_Succeed) {
  180. bool bEnd = false;
  181. CSimpleString str;
  182. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  183. LOG_ASSERT(Error || bEnd);
  184. }
  185. return Error;
  186. }
  187. ErrorCodeEnum GetDevStatus(FingerPrintService_GetDevStatus_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
  188. {
  189. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  190. CAutoBuffer Buf = SpObject2Buffer(Req);
  191. if (m_context.checkEmpty())
  192. {
  193. m_context.AutoGenerate();
  194. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  195. m_context = m_context.upgradeLink();
  196. }
  197. auto ret = pFunc->AsyncRequest(FingerPrintService_Method_GetDevStatus, FingerPrintService_MethodSignature_GetDevStatus, Buf, spAsyncWait, m_context, dwTimeout);
  198. m_context.clear();
  199. return ret;
  200. }
  201. ErrorCodeEnum GetDevStatus(FingerPrintService_GetDevStatus_Req &Req, FingerPrintService_GetDevStatus_Ans &Ans, DWORD dwTimeout)
  202. {
  203. CSmartPointer<IAsynWaitSp> spAsyncWait;
  204. ErrorCodeEnum Error = GetDevStatus(Req, spAsyncWait, dwTimeout);
  205. if (Error == Error_Succeed) {
  206. bool bEnd = false;
  207. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
  208. LOG_ASSERT(Error || bEnd);
  209. }
  210. return Error;
  211. }
  212. ErrorCodeEnum GetDevStatus(FingerPrintService_GetDevStatus_Req &Req, FingerPrintService_GetDevStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
  213. {
  214. CSmartPointer<IAsynWaitSp> spAsyncWait;
  215. ErrorCodeEnum Error = GetDevStatus(Req, spAsyncWait, dwTimeout);
  216. if (Error == Error_Succeed) {
  217. bool bEnd = false;
  218. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  219. LOG_ASSERT(Error || bEnd);
  220. }
  221. return Error;
  222. }
  223. ErrorCodeEnum GetDevStatus(FingerPrintService_GetDevStatus_Req &Req, FingerPrintService_GetDevStatus_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
  224. {
  225. CSmartPointer<IAsynWaitSp> spAsyncWait;
  226. ErrorCodeEnum Error = GetDevStatus(Req, spAsyncWait, dwTimeout);
  227. if (Error == Error_Succeed) {
  228. bool bEnd = false;
  229. CSimpleString str;
  230. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  231. LOG_ASSERT(Error || bEnd);
  232. }
  233. return Error;
  234. }
  235. ErrorCodeEnum GetDevInfo(FingerPrintService_GetDevInfo_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
  236. {
  237. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  238. CAutoBuffer Buf = SpObject2Buffer(Req);
  239. if (m_context.checkEmpty())
  240. {
  241. m_context.AutoGenerate();
  242. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  243. m_context = m_context.upgradeLink();
  244. }
  245. auto ret = pFunc->AsyncRequest(FingerPrintService_Method_GetDevInfo, FingerPrintService_MethodSignature_GetDevInfo, Buf, spAsyncWait, m_context, dwTimeout);
  246. m_context.clear();
  247. return ret;
  248. }
  249. ErrorCodeEnum GetDevInfo(FingerPrintService_GetDevInfo_Req &Req, FingerPrintService_GetDevInfo_Ans &Ans, DWORD dwTimeout)
  250. {
  251. CSmartPointer<IAsynWaitSp> spAsyncWait;
  252. ErrorCodeEnum Error = GetDevInfo(Req, spAsyncWait, dwTimeout);
  253. if (Error == Error_Succeed) {
  254. bool bEnd = false;
  255. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
  256. LOG_ASSERT(Error || bEnd);
  257. }
  258. return Error;
  259. }
  260. ErrorCodeEnum GetDevInfo(FingerPrintService_GetDevInfo_Req &Req, FingerPrintService_GetDevInfo_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
  261. {
  262. CSmartPointer<IAsynWaitSp> spAsyncWait;
  263. ErrorCodeEnum Error = GetDevInfo(Req, spAsyncWait, dwTimeout);
  264. if (Error == Error_Succeed) {
  265. bool bEnd = false;
  266. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  267. LOG_ASSERT(Error || bEnd);
  268. }
  269. return Error;
  270. }
  271. ErrorCodeEnum GetDevInfo(FingerPrintService_GetDevInfo_Req &Req, FingerPrintService_GetDevInfo_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
  272. {
  273. CSmartPointer<IAsynWaitSp> spAsyncWait;
  274. ErrorCodeEnum Error = GetDevInfo(Req, spAsyncWait, dwTimeout);
  275. if (Error == Error_Succeed) {
  276. bool bEnd = false;
  277. CSimpleString str;
  278. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  279. LOG_ASSERT(Error || bEnd);
  280. }
  281. return Error;
  282. }
  283. ErrorCodeEnum GetImageAndFeatureEx(FingerPrintService_GetImageAndFeatureEx_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
  284. {
  285. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  286. CAutoBuffer Buf = SpObject2Buffer(Req);
  287. if (m_context.checkEmpty())
  288. {
  289. m_context.AutoGenerate();
  290. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  291. m_context = m_context.upgradeLink();
  292. }
  293. auto ret = pFunc->AsyncRequest(FingerPrintService_Method_GetImageAndFeatureEx, FingerPrintService_MethodSignature_GetImageAndFeatureEx, Buf, spAsyncWait, m_context, dwTimeout);
  294. m_context.clear();
  295. return ret;
  296. }
  297. ErrorCodeEnum GetImageAndFeatureEx(FingerPrintService_GetImageAndFeatureEx_Req &Req, FingerPrintService_GetImageAndFeatureEx_Ans &Ans, DWORD dwTimeout)
  298. {
  299. CSmartPointer<IAsynWaitSp> spAsyncWait;
  300. ErrorCodeEnum Error = GetImageAndFeatureEx(Req, spAsyncWait, dwTimeout);
  301. if (Error == Error_Succeed) {
  302. bool bEnd = false;
  303. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
  304. LOG_ASSERT(Error || bEnd);
  305. }
  306. return Error;
  307. }
  308. ErrorCodeEnum GetImageAndFeatureEx(FingerPrintService_GetImageAndFeatureEx_Req &Req, FingerPrintService_GetImageAndFeatureEx_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
  309. {
  310. CSmartPointer<IAsynWaitSp> spAsyncWait;
  311. ErrorCodeEnum Error = GetImageAndFeatureEx(Req, spAsyncWait, dwTimeout);
  312. if (Error == Error_Succeed) {
  313. bool bEnd = false;
  314. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  315. LOG_ASSERT(Error || bEnd);
  316. }
  317. return Error;
  318. }
  319. ErrorCodeEnum GetImageAndFeatureEx(FingerPrintService_GetImageAndFeatureEx_Req &Req, FingerPrintService_GetImageAndFeatureEx_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
  320. {
  321. CSmartPointer<IAsynWaitSp> spAsyncWait;
  322. ErrorCodeEnum Error = GetImageAndFeatureEx(Req, spAsyncWait, dwTimeout);
  323. if (Error == Error_Succeed) {
  324. bool bEnd = false;
  325. CSimpleString str;
  326. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  327. LOG_ASSERT(Error || bEnd);
  328. }
  329. return Error;
  330. }
  331. ErrorCodeEnum GetFingerPrint(FingerPrintService_GetFingerPrint_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
  332. {
  333. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  334. CAutoBuffer Buf = SpObject2Buffer(Req);
  335. if (m_context.checkEmpty())
  336. {
  337. m_context.AutoGenerate();
  338. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  339. m_context = m_context.upgradeLink();
  340. }
  341. auto ret = pFunc->AsyncRequest(FingerPrintService_Method_GetFingerPrint, FingerPrintService_MethodSignature_GetFingerPrint, Buf, spAsyncWait, m_context, dwTimeout);
  342. m_context.clear();
  343. return ret;
  344. }
  345. ErrorCodeEnum GetFingerPrint(FingerPrintService_GetFingerPrint_Req &Req, FingerPrintService_GetFingerPrint_Ans &Ans, DWORD dwTimeout)
  346. {
  347. CSmartPointer<IAsynWaitSp> spAsyncWait;
  348. ErrorCodeEnum Error = GetFingerPrint(Req, spAsyncWait, dwTimeout);
  349. if (Error == Error_Succeed) {
  350. bool bEnd = false;
  351. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
  352. LOG_ASSERT(Error || bEnd);
  353. }
  354. return Error;
  355. }
  356. ErrorCodeEnum GetFingerPrint(FingerPrintService_GetFingerPrint_Req &Req, FingerPrintService_GetFingerPrint_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
  357. {
  358. CSmartPointer<IAsynWaitSp> spAsyncWait;
  359. ErrorCodeEnum Error = GetFingerPrint(Req, spAsyncWait, dwTimeout);
  360. if (Error == Error_Succeed) {
  361. bool bEnd = false;
  362. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  363. LOG_ASSERT(Error || bEnd);
  364. }
  365. return Error;
  366. }
  367. ErrorCodeEnum GetFingerPrint(FingerPrintService_GetFingerPrint_Req &Req, FingerPrintService_GetFingerPrint_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
  368. {
  369. CSmartPointer<IAsynWaitSp> spAsyncWait;
  370. ErrorCodeEnum Error = GetFingerPrint(Req, spAsyncWait, dwTimeout);
  371. if (Error == Error_Succeed) {
  372. bool bEnd = false;
  373. CSimpleString str;
  374. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  375. LOG_ASSERT(Error || bEnd);
  376. }
  377. return Error;
  378. }
  379. ErrorCodeEnum GenerateTemplate(FingerPrintService_GenerateTemplate_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
  380. {
  381. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  382. CAutoBuffer Buf = SpObject2Buffer(Req);
  383. if (m_context.checkEmpty())
  384. {
  385. m_context.AutoGenerate();
  386. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  387. m_context = m_context.upgradeLink();
  388. }
  389. auto ret = pFunc->AsyncRequest(FingerPrintService_Method_GenerateTemplate, FingerPrintService_MethodSignature_GenerateTemplate, Buf, spAsyncWait, m_context, dwTimeout);
  390. m_context.clear();
  391. return ret;
  392. }
  393. ErrorCodeEnum GenerateTemplate(FingerPrintService_GenerateTemplate_Req &Req, FingerPrintService_GenerateTemplate_Ans &Ans, DWORD dwTimeout)
  394. {
  395. CSmartPointer<IAsynWaitSp> spAsyncWait;
  396. ErrorCodeEnum Error = GenerateTemplate(Req, spAsyncWait, dwTimeout);
  397. if (Error == Error_Succeed) {
  398. bool bEnd = false;
  399. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
  400. LOG_ASSERT(Error || bEnd);
  401. }
  402. return Error;
  403. }
  404. ErrorCodeEnum GenerateTemplate(FingerPrintService_GenerateTemplate_Req &Req, FingerPrintService_GenerateTemplate_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
  405. {
  406. CSmartPointer<IAsynWaitSp> spAsyncWait;
  407. ErrorCodeEnum Error = GenerateTemplate(Req, spAsyncWait, dwTimeout);
  408. if (Error == Error_Succeed) {
  409. bool bEnd = false;
  410. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  411. LOG_ASSERT(Error || bEnd);
  412. }
  413. return Error;
  414. }
  415. ErrorCodeEnum GenerateTemplate(FingerPrintService_GenerateTemplate_Req &Req, FingerPrintService_GenerateTemplate_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
  416. {
  417. CSmartPointer<IAsynWaitSp> spAsyncWait;
  418. ErrorCodeEnum Error = GenerateTemplate(Req, spAsyncWait, dwTimeout);
  419. if (Error == Error_Succeed) {
  420. bool bEnd = false;
  421. CSimpleString str;
  422. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  423. LOG_ASSERT(Error || bEnd);
  424. }
  425. return Error;
  426. }
  427. ErrorCodeEnum GetFingerPrintJS(FingerPrintService_GetFingerPrintJS_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
  428. {
  429. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  430. CAutoBuffer Buf = SpObject2Buffer(Req);
  431. if (m_context.checkEmpty())
  432. {
  433. m_context.AutoGenerate();
  434. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  435. m_context = m_context.upgradeLink();
  436. }
  437. auto ret = pFunc->AsyncRequest(FingerPrintService_Method_GetFingerPrintJS, FingerPrintService_MethodSignature_GetFingerPrintJS, Buf, spAsyncWait, m_context, dwTimeout);
  438. m_context.clear();
  439. return ret;
  440. }
  441. ErrorCodeEnum GetFingerPrintJS(FingerPrintService_GetFingerPrintJS_Req &Req, FingerPrintService_GetFingerPrintJS_Ans &Ans, DWORD dwTimeout)
  442. {
  443. CSmartPointer<IAsynWaitSp> spAsyncWait;
  444. ErrorCodeEnum Error = GetFingerPrintJS(Req, spAsyncWait, dwTimeout);
  445. if (Error == Error_Succeed) {
  446. bool bEnd = false;
  447. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
  448. LOG_ASSERT(Error || bEnd);
  449. }
  450. return Error;
  451. }
  452. ErrorCodeEnum GetFingerPrintJS(FingerPrintService_GetFingerPrintJS_Req &Req, FingerPrintService_GetFingerPrintJS_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
  453. {
  454. CSmartPointer<IAsynWaitSp> spAsyncWait;
  455. ErrorCodeEnum Error = GetFingerPrintJS(Req, spAsyncWait, dwTimeout);
  456. if (Error == Error_Succeed) {
  457. bool bEnd = false;
  458. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  459. LOG_ASSERT(Error || bEnd);
  460. }
  461. return Error;
  462. }
  463. ErrorCodeEnum GetFingerPrintJS(FingerPrintService_GetFingerPrintJS_Req &Req, FingerPrintService_GetFingerPrintJS_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
  464. {
  465. CSmartPointer<IAsynWaitSp> spAsyncWait;
  466. ErrorCodeEnum Error = GetFingerPrintJS(Req, spAsyncWait, dwTimeout);
  467. if (Error == Error_Succeed) {
  468. bool bEnd = false;
  469. CSimpleString str;
  470. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  471. LOG_ASSERT(Error || bEnd);
  472. }
  473. return Error;
  474. }
  475. ErrorCodeEnum GenerateTemplateJS(FingerPrintService_GenerateTemplateJS_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
  476. {
  477. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  478. CAutoBuffer Buf = SpObject2Buffer(Req);
  479. if (m_context.checkEmpty())
  480. {
  481. m_context.AutoGenerate();
  482. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  483. m_context = m_context.upgradeLink();
  484. }
  485. auto ret = pFunc->AsyncRequest(FingerPrintService_Method_GenerateTemplateJS, FingerPrintService_MethodSignature_GenerateTemplateJS, Buf, spAsyncWait, m_context, dwTimeout);
  486. m_context.clear();
  487. return ret;
  488. }
  489. ErrorCodeEnum GenerateTemplateJS(FingerPrintService_GenerateTemplateJS_Req &Req, FingerPrintService_GenerateTemplateJS_Ans &Ans, DWORD dwTimeout)
  490. {
  491. CSmartPointer<IAsynWaitSp> spAsyncWait;
  492. ErrorCodeEnum Error = GenerateTemplateJS(Req, spAsyncWait, dwTimeout);
  493. if (Error == Error_Succeed) {
  494. bool bEnd = false;
  495. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
  496. LOG_ASSERT(Error || bEnd);
  497. }
  498. return Error;
  499. }
  500. ErrorCodeEnum GenerateTemplateJS(FingerPrintService_GenerateTemplateJS_Req &Req, FingerPrintService_GenerateTemplateJS_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
  501. {
  502. CSmartPointer<IAsynWaitSp> spAsyncWait;
  503. ErrorCodeEnum Error = GenerateTemplateJS(Req, spAsyncWait, dwTimeout);
  504. if (Error == Error_Succeed) {
  505. bool bEnd = false;
  506. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  507. LOG_ASSERT(Error || bEnd);
  508. }
  509. return Error;
  510. }
  511. ErrorCodeEnum GenerateTemplateJS(FingerPrintService_GenerateTemplateJS_Req &Req, FingerPrintService_GenerateTemplateJS_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
  512. {
  513. CSmartPointer<IAsynWaitSp> spAsyncWait;
  514. ErrorCodeEnum Error = GenerateTemplateJS(Req, spAsyncWait, dwTimeout);
  515. if (Error == Error_Succeed) {
  516. bool bEnd = false;
  517. CSimpleString str;
  518. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  519. LOG_ASSERT(Error || bEnd);
  520. }
  521. return Error;
  522. }
  523. ErrorCodeEnum CancelScanJS(FingerPrintService_CancelScanJS_Req &Req, CSmartPointer<IAsynWaitSp> &spAsyncWait, DWORD dwTimeout)
  524. {
  525. CSmartPointer<IClientSessionFunction> pFunc = GetFunction();
  526. CAutoBuffer Buf = SpObject2Buffer(Req);
  527. if (m_context.checkEmpty())
  528. {
  529. m_context.AutoGenerate();
  530. DbgToBeidou(m_context, m_pEntityBase != NULL ? m_pEntityBase->GetEntityName() : "")();
  531. m_context = m_context.upgradeLink();
  532. }
  533. auto ret = pFunc->AsyncRequest(FingerPrintService_Method_CancelScanJS, FingerPrintService_MethodSignature_CancelScanJS, Buf, spAsyncWait, m_context, dwTimeout);
  534. m_context.clear();
  535. return ret;
  536. }
  537. ErrorCodeEnum CancelScanJS(FingerPrintService_CancelScanJS_Req &Req, FingerPrintService_CancelScanJS_Ans &Ans, DWORD dwTimeout)
  538. {
  539. CSmartPointer<IAsynWaitSp> spAsyncWait;
  540. ErrorCodeEnum Error = CancelScanJS(Req, spAsyncWait, dwTimeout);
  541. if (Error == Error_Succeed) {
  542. bool bEnd = false;
  543. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwTimeout);
  544. LOG_ASSERT(Error || bEnd);
  545. }
  546. return Error;
  547. }
  548. ErrorCodeEnum CancelScanJS(FingerPrintService_CancelScanJS_Req &Req, FingerPrintService_CancelScanJS_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError, CSimpleString &str)
  549. {
  550. CSmartPointer<IAsynWaitSp> spAsyncWait;
  551. ErrorCodeEnum Error = CancelScanJS(Req, spAsyncWait, dwTimeout);
  552. if (Error == Error_Succeed) {
  553. bool bEnd = false;
  554. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  555. LOG_ASSERT(Error || bEnd);
  556. }
  557. return Error;
  558. }
  559. ErrorCodeEnum CancelScanJS(FingerPrintService_CancelScanJS_Req &Req, FingerPrintService_CancelScanJS_Ans &Ans, DWORD dwTimeout, DWORD &dwUserError)
  560. {
  561. CSmartPointer<IAsynWaitSp> spAsyncWait;
  562. ErrorCodeEnum Error = CancelScanJS(Req, spAsyncWait, dwTimeout);
  563. if (Error == Error_Succeed) {
  564. bool bEnd = false;
  565. CSimpleString str;
  566. Error = SpWaitAnswerObject(spAsyncWait, Ans, bEnd, dwUserError, str, dwTimeout);
  567. LOG_ASSERT(Error || bEnd);
  568. }
  569. return Error;
  570. }
  571. bool SafeDelete()
  572. {
  573. if (!m_bSysManaged) {
  574. delete this;
  575. }
  576. return m_bSysManaged;
  577. }
  578. protected:
  579. bool m_bSysManaged;
  580. CEntityBase *m_pEntityBase;
  581. linkContext m_context;
  582. bool bSessionClosed;
  583. };
  584. ///////////////////////////
  585. } // namespace FingerPrint
  586. #endif // __FINGERPRINT_CLIENT_G_H