1 krisbash 1.1 /*
2 **==============================================================================
3 **
4 ** Open Management Infrastructure (OMI)
5 **
6 ** Copyright (c) Microsoft Corporation
7 **
8 ** Licensed under the Apache License, Version 2.0 (the "License"); you may not
9 ** use this file except in compliance with the License. You may obtain a copy
10 ** of the License at
11 **
12 ** http://www.apache.org/licenses/LICENSE-2.0
13 **
14 ** THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 ** KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
16 ** WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
17 ** MERCHANTABLITY OR NON-INFRINGEMENT.
18 **
19 ** See the Apache 2 License for the specific language governing permissions
20 ** and limitations under the License.
21 **
22 krisbash 1.1 **==============================================================================
23 */
24
25 #ifndef _lifecyclecontext_h
26 #define _lifecyclecontext_h
27
28 #include "context.h"
29 #include "provmgr.h"
30 #include <common.h>
31 #include <indication/common/indicommon.h>
32
33 BEGIN_EXTERNC
34
35 /* Defines internal lifecycle indication context type */
36 struct _LifecycleContext
37 {
38 MI_LifecycleIndicationContext base;
39 MI_Uint32 magic;
40
41 /* Reference to Provider */
42 Provider* provider;
43 krisbash 1.1
44 /* Holds provider's callback data */
45 MI_LifecycleIndicationCallback lifecycleCallback;
46 void* callbackData;
47
48 MI_Uint32 supportedTypesAggr;
49 MI_Uint32 supportedTypesFromProv;
50 };
51 typedef struct _LifecycleContext LifecycleContext;
52
53 /*
54 * Converts internal enum to MI indication type
55 */
56 MI_Uint32 LifeContext_ConvertSupportedType(
57 _In_ SubscriptionTargetType type );
58
59 /*
60 * Aggregates the supportedTypes from all current subscriptions and notifies
61 * the provider of a supportedTypes change.
62 */
63 void LifeContext_UpdateSupportedTypes(
64 krisbash 1.1 _In_ LifecycleContext* context );
65
66 /*
67 * Compares the specified type with that advertised by the provider to
68 * confirm if they are compatible.
69 */
70 MI_Boolean LifeContext_IsTypeSupported(
71 _In_ LifecycleContext* context,
72 _In_ MI_Uint32 supportedTypeToCheck );
73
74 /*
75 * Allocates a new structure in the heap.
76 */
77 LifecycleContext* LifeContext_New();
78
79 /*
80 * De-allocates memory used by the context pointer.
81 */
82 void LifeContext_Delete(
83 _Pre_valid_ _Post_ptr_invalid_ LifecycleContext* context );
84
85 krisbash 1.1 void LifeContext_Init(
86 _In_ LifecycleContext* context,
87 _In_ Provider* provider );
88
89 END_EXTERNC
90
91 #endif /* _lifecyclecontext_h */
92
|