-
Notifications
You must be signed in to change notification settings - Fork 116
/
interaction.h
62 lines (48 loc) · 1.7 KB
/
interaction.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
**==============================================================================
**
** Copyright (c) Microsoft Corporation. All rights reserved. See file LICENSE
** for license information.
**
**==============================================================================
*/
#ifndef _Interaction_h
#define _Interaction_h
#include <base/messages.h>
BEGIN_EXTERNC
typedef struct _Interaction Interaction;
typedef struct _InteractionFT
{
void (*Post)( _In_ Interaction* self, _In_ Message* msg);
void (*PostControl)( _In_ Interaction* self, _In_ Message* msg);
void (*Ack)( _In_ Interaction* self);
void (*Cancel)( _In_ Interaction* self);
void (*Close)( _In_ Interaction* self);
}
InteractionFT;
struct _Interaction
{
InteractionFT * ft;
Interaction * other;
};
Interaction* Interaction_New(
_In_ Batch *batch,
_In_opt_ InteractionFT* ft,
size_t structSize );
typedef struct _Strand Strand;
typedef struct _InteractionOpenParams
{
Interaction* interaction;
void* callbackData; // Optional callbackData (usually the object being called back)
Message* msg; // Optional initial message, if not NULL receiver SHOULD Ack when is ready
Strand* origin; // Optional origin strand, used by strand to provide a Strand object that should be released (leave) once the interaction is open
} InteractionOpenParams;
MI_INLINE
void InteractionOpenParams_Init( _Out_ InteractionOpenParams* params )
{
memset( params, 0, sizeof(InteractionOpenParams) );
}
// It should always succeed, return any error thru the interaction
typedef void (*OpenCallback)( _Inout_ InteractionOpenParams* params );
END_EXTERNC
#endif /* _Interaction_h */