Resolve "server_id should not be optional in adhoc_storage"

This MR makes the server_id member in adhoc_storage explicit. The rationale is that constructors (for the C++ API) or .*_create() functions (for the C API) will most of the time be called from internal code, since client code will rely mostly on ADM_register_.*() to obtain handlers.

In this scenario, there's no possibility for the server_id "to not having been assigned yet", which is why it was optional in the first place.

Also, this MR renames the user_id to name, and the server_id to id.

Closes #74 (closed) #75 (closed)

Edited by Alberto Miranda

Merge request reports

Loading
+2 −2
Changes for examples/c/ADM_cancel_transfer.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -68,11 +68,11 @@ main(int argc, char* argv[]) {
            100, false);
    assert(ctx);

    const char* user_id = "adhoc_storage_42";
    const char* name = "adhoc_storage_42";

    ADM_storage_t adhoc_storage;
    ADM_return_t ret =
            ADM_register_adhoc_storage(server, user_id, ctx, &adhoc_storage);
            ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage);

    if(ret != ADM_SUCCESS) {
        fprintf(stdout, "ADM_register_adhoc_storage() remote procedure not "
+2 −2
Changes for examples/c/ADM_connect_data_operation.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -64,11 +64,11 @@ main(int argc, char* argv[]) {
            100, false);
    assert(ctx);

    const char* user_id = "adhoc_storage_42";
    const char* name = "adhoc_storage_42";

    ADM_storage_t adhoc_storage;
    ADM_return_t ret =
            ADM_register_adhoc_storage(server, user_id, ctx, &adhoc_storage);
            ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage);

    if(ret != ADM_SUCCESS) {
        fprintf(stdout,
+2 −2
Changes for examples/c/ADM_define_data_operation.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -69,11 +69,11 @@ main(int argc, char* argv[]) {
            100, false);
    assert(ctx);

    const char* user_id = "adhoc_storage_42";
    const char* name = "adhoc_storage_42";

    ADM_storage_t adhoc_storage;
    ADM_return_t ret =
            ADM_register_adhoc_storage(server, user_id, ctx, &adhoc_storage);
            ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage);

    if(ret != ADM_SUCCESS) {
        fprintf(stdout,
+2 −2
Changes for examples/c/ADM_deploy_adhoc_storage.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -60,11 +60,11 @@ main(int argc, char* argv[]) {
            100, false);
    assert(ctx);

    const char* user_id = "adhoc_storage_42";
    const char* name = "adhoc_storage_42";

    ADM_storage_t adhoc_storage;
    ADM_return_t ret =
            ADM_register_adhoc_storage(server, user_id, ctx, &adhoc_storage);
            ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage);

    if(ret != ADM_SUCCESS) {
        fprintf(stdout,
+2 −2
Changes for examples/c/ADM_finalize_data_operation.c: 2 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -65,11 +65,11 @@ main(int argc, char* argv[]) {
            100, false);
    assert(ctx);

    const char* user_id = "adhoc_storage_42";
    const char* name = "adhoc_storage_42";

    ADM_storage_t adhoc_storage;
    ADM_return_t ret =
            ADM_register_adhoc_storage(server, user_id, ctx, &adhoc_storage);
            ADM_register_adhoc_storage(server, name, ctx, &adhoc_storage);

    if(ret != ADM_SUCCESS) {
        fprintf(stdout,
Loading
Loading