Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static API changes #124

Merged

Conversation

DavidAntliff
Copy link
Collaborator

These changes are intended to improve consistency with the Gateway API, and separate the concerns of Object/Resource definition from how the entity is managed or stored. This results in the deprecation of some existing API functions. These deprecated functions will be removed after 0.1.8 has been released.

Also includes a minor documentation update by reserving a section for "Best Practices".

David Antliff added 2 commits May 2, 2016 12:27
…n Object Operation handler.

Add AwaStaticClient_SetObjectOperationHandler().
Deprecate AwaStaticClient_DefineObjectWithHandler().

Signed-off-by: David Antliff <[email protected]>
… a Resource Operation handler, or storage pointer.

    Add AwaStaticClient_DefineResource().
    Add AwaStaticClient_SetResourceOperationHandler().
    Add AwaStaticClient_SetResourceStorageWithPointer().
    Add AwaStaticClient_SetResourceStorageWithPointerArray().
    Deprecate AwaStaticClient_DefineResourceWithHandler().
    Deprecate AwaStaticClient_DefineResourceWithPointer().
    Deprecate AwaStaticClient_DefineResourceWithPointerArray().

Signed-off-by: David Antliff <[email protected]>
ASSERT_EQ(AwaError_Success, AwaStaticClient_DefineResource(client_, 7997, 1, "TestResource", AwaResourceType_Opaque, 1, 1, AwaResourceOperations_ReadWrite));
EXPECT_EQ(AwaError_StaticClientInvalid, AwaStaticClient_SetResourceStorageWithPointer(NULL, 7996, 1, &o, sizeof(o), 0));
EXPECT_EQ(AwaError_DefinitionInvalid, AwaStaticClient_SetResourceStorageWithPointer(client_, 7997, 1, &o, 0, 0));
EXPECT_EQ(AwaError_DefinitionInvalid, AwaStaticClient_SetResourceStorageWithPointer(client_, 7997, 1, NULL, 0, 0));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to test AwaStaticClient_SetResourceStorageWithPointer on a resource that hasn't been defined using AwaStaticClient_DefineResource:

ASSERT_EQ(AwaError_DefinitionInvalid, AwaStaticClient_SetResourceStorageWithPointer(client_,  7996,  1, &o, sizeof(o), 0));

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@seank-img
Copy link
Contributor

seank-img commented May 2, 2016

+1 when comments addressed

…jects and resources in the Static API. This is now consistent with the Gateway API, where Name follows the IDs.

Add CMakeLists.txt for examples/tutorials, to ensure they are built alongside the API.

Signed-off-by: David Antliff <[email protected]>
@DavidAntliff DavidAntliff force-pushed the static-api-changes branch from 40b5d4c to 1a446eb Compare May 2, 2016 21:56
Signed-off-by: David Antliff <[email protected]>
@DavidAntliff DavidAntliff force-pushed the static-api-changes branch from 63b6da7 to 8fdaae8 Compare May 2, 2016 22:35
@seank-img seank-img merged commit 4117875 into ConnectivityFoundry:master May 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants