comparison OrthancServer/Plugins/Engine/OrthancPluginDatabaseV4.cpp @ 5213:055428d92772 db-protobuf

clarifying types of since/limit in IDatabaseWrapper
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 03 Apr 2023 11:18:55 +0200
parents 27e6ec2811e3
children a9d00b17a48e
comparison
equal deleted inserted replaced
5212:19e916dfc767 5213:055428d92772
384 } 384 }
385 385
386 386
387 virtual void GetAllPublicIds(std::list<std::string>& target, 387 virtual void GetAllPublicIds(std::list<std::string>& target,
388 ResourceType resourceType, 388 ResourceType resourceType,
389 size_t since, 389 int64_t since,
390 size_t limit) ORTHANC_OVERRIDE 390 uint32_t limit) ORTHANC_OVERRIDE
391 { 391 {
392 DatabasePluginMessages::TransactionRequest request; 392 DatabasePluginMessages::TransactionRequest request;
393 request.mutable_get_all_public_ids_with_limits()->set_resource_type(Convert(resourceType)); 393 request.mutable_get_all_public_ids_with_limits()->set_resource_type(Convert(resourceType));
394 request.mutable_get_all_public_ids_with_limits()->set_since(since); 394 request.mutable_get_all_public_ids_with_limits()->set_since(since);
395 request.mutable_get_all_public_ids_with_limits()->set_limit(limit); 395 request.mutable_get_all_public_ids_with_limits()->set_limit(limit);
406 406
407 407
408 virtual void GetChanges(std::list<ServerIndexChange>& target /*out*/, 408 virtual void GetChanges(std::list<ServerIndexChange>& target /*out*/,
409 bool& done /*out*/, 409 bool& done /*out*/,
410 int64_t since, 410 int64_t since,
411 uint32_t maxResults) ORTHANC_OVERRIDE 411 uint32_t limit) ORTHANC_OVERRIDE
412 { 412 {
413 DatabasePluginMessages::TransactionRequest request; 413 DatabasePluginMessages::TransactionRequest request;
414 request.mutable_get_changes()->set_since(since); 414 request.mutable_get_changes()->set_since(since);
415 request.mutable_get_changes()->set_limit(maxResults); 415 request.mutable_get_changes()->set_limit(limit);
416 416
417 DatabasePluginMessages::TransactionResponse response; 417 DatabasePluginMessages::TransactionResponse response;
418 ExecuteTransaction(response, DatabasePluginMessages::OPERATION_GET_CHANGES, request); 418 ExecuteTransaction(response, DatabasePluginMessages::OPERATION_GET_CHANGES, request);
419 419
420 done = response.get_changes().done(); 420 done = response.get_changes().done();
462 462
463 463
464 virtual void GetExportedResources(std::list<ExportedResource>& target /*out*/, 464 virtual void GetExportedResources(std::list<ExportedResource>& target /*out*/,
465 bool& done /*out*/, 465 bool& done /*out*/,
466 int64_t since, 466 int64_t since,
467 uint32_t maxResults) ORTHANC_OVERRIDE 467 uint32_t limit) ORTHANC_OVERRIDE
468 { 468 {
469 DatabasePluginMessages::TransactionRequest request; 469 DatabasePluginMessages::TransactionRequest request;
470 request.mutable_get_exported_resources()->set_since(since); 470 request.mutable_get_exported_resources()->set_since(since);
471 request.mutable_get_exported_resources()->set_limit(maxResults); 471 request.mutable_get_exported_resources()->set_limit(limit);
472 472
473 DatabasePluginMessages::TransactionResponse response; 473 DatabasePluginMessages::TransactionResponse response;
474 ExecuteTransaction(response, DatabasePluginMessages::OPERATION_GET_EXPORTED_RESOURCES, request); 474 ExecuteTransaction(response, DatabasePluginMessages::OPERATION_GET_EXPORTED_RESOURCES, request);
475 475
476 done = response.get_exported_resources().done(); 476 done = response.get_exported_resources().done();
872 872
873 virtual void ApplyLookupResources(std::list<std::string>& resourcesId, 873 virtual void ApplyLookupResources(std::list<std::string>& resourcesId,
874 std::list<std::string>* instancesId, // Can be NULL if not needed 874 std::list<std::string>* instancesId, // Can be NULL if not needed
875 const std::vector<DatabaseConstraint>& lookup, 875 const std::vector<DatabaseConstraint>& lookup,
876 ResourceType queryLevel, 876 ResourceType queryLevel,
877 size_t limit) ORTHANC_OVERRIDE 877 uint32_t limit) ORTHANC_OVERRIDE
878 { 878 {
879 // TODO => "size_t limit" : uint32_t
880
881 DatabasePluginMessages::TransactionRequest request; 879 DatabasePluginMessages::TransactionRequest request;
882 request.mutable_lookup_resources()->set_query_level(Convert(queryLevel)); 880 request.mutable_lookup_resources()->set_query_level(Convert(queryLevel));
883 request.mutable_lookup_resources()->set_limit(limit); 881 request.mutable_lookup_resources()->set_limit(limit);
884 request.mutable_lookup_resources()->set_retrieve_instances_ids(instancesId != NULL); 882 request.mutable_lookup_resources()->set_retrieve_instances_ids(instancesId != NULL);
885 883