Azure IoT / serializer

Dependents:   sht15_remote_monitoring f767zi_mqtt remote_monitoring simplesample_amqp ... more

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers multitree.h Source File

multitree.h

00001 // Copyright (c) Microsoft. All rights reserved.
00002 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
00003 
00004 #ifndef MULTITREE_H
00005 #define MULTITREE_H
00006 
00007 #include "azure_c_shared_utility/strings.h"
00008 #include "azure_c_shared_utility/macro_utils.h"
00009 
00010 #ifdef __cplusplus
00011 #include <cstddef>
00012 extern "C"
00013 {
00014 #else
00015 #include <stddef.h>
00016 #include <stdbool.h>
00017 #endif
00018 
00019 typedef struct MULTITREE_HANDLE_DATA_TAG* MULTITREE_HANDLE;
00020 
00021 #define MULTITREE_RESULT_VALUES           \
00022     MULTITREE_OK,                         \
00023     MULTITREE_INVALID_ARG,                \
00024     MULTITREE_ALREADY_HAS_A_VALUE,        \
00025     MULTITREE_EMPTY_CHILD_NAME,           \
00026     MULTITREE_EMPTY_VALUE,                \
00027     MULTITREE_OUT_OF_RANGE_INDEX,         \
00028     MULTITREE_ERROR,                      \
00029     MULTITREE_CHILD_NOT_FOUND             \
00030 
00031 DEFINE_ENUM(MULTITREE_RESULT, MULTITREE_RESULT_VALUES);
00032 
00033 typedef void (*MULTITREE_FREE_FUNCTION)(void* value);
00034 typedef int (*MULTITREE_CLONE_FUNCTION)(void** destination, const void* source);
00035 
00036 #include "azure_c_shared_utility/umock_c_prod.h"
00037 MOCKABLE_FUNCTION(, MULTITREE_HANDLE, MultiTree_Create, MULTITREE_CLONE_FUNCTION, cloneFunction, MULTITREE_FREE_FUNCTION, freeFunction);
00038 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_AddLeaf, MULTITREE_HANDLE, treeHandle, const char*, destinationPath, const void*, value);
00039 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_AddChild, MULTITREE_HANDLE, treeHandle, const char*, childName, MULTITREE_HANDLE*, childHandle);
00040 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_GetChildCount, MULTITREE_HANDLE, treeHandle, size_t*, count);
00041 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_GetChild, MULTITREE_HANDLE, treeHandle, size_t, index, MULTITREE_HANDLE*, childHandle);
00042 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_GetChildByName, MULTITREE_HANDLE, treeHandle, const char*, childName, MULTITREE_HANDLE*, childHandle);
00043 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_GetName, MULTITREE_HANDLE, treeHandle, STRING_HANDLE, destination);
00044 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_GetValue, MULTITREE_HANDLE, treeHandle, const void**, destination);
00045 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_GetLeafValue, MULTITREE_HANDLE, treeHandle, const char*, leafPath, const void**, destination);
00046 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_SetValue, MULTITREE_HANDLE, treeHandle, void*, value);
00047 MOCKABLE_FUNCTION(, void, MultiTree_Destroy, MULTITREE_HANDLE, treeHandle);
00048 MOCKABLE_FUNCTION(, MULTITREE_RESULT, MultiTree_DeleteChild, MULTITREE_HANDLE, treeHandle, const char*, childName);
00049 
00050 #ifdef __cplusplus
00051 }
00052 #endif
00053 
00054 #endif