@@ -31,6 +31,16 @@ class DeclContext;
31
31
class FuncDecl ;
32
32
class NominalTypeDecl ;
33
33
34
+ Type getAssociatedTypeOfDistributedSystemOfActor (DeclContext *actorOrExtension,
35
+ Identifier member);
36
+
37
+ // / Find the concrete invocation decoder associated with the given actor.
38
+ NominalTypeDecl *getDistributedActorInvocationDecoder (NominalTypeDecl *);
39
+
40
+ // / Find `decodeNextArgument<T>(type: T.Type) -> T` method associated with
41
+ // / invocation decoder of the given distributed actor.
42
+ FuncDecl *getDistributedActorArgumentDecodingMethod (NominalTypeDecl *);
43
+
34
44
// / Determine the concrete type of 'ActorSystem' as seen from the member.
35
45
// / E.g. when in a protocol, and trying to determine what the actor system was
36
46
// / constrained to.
@@ -47,12 +57,6 @@ Type getDistributedActorSystemType(NominalTypeDecl *actor);
47
57
// / Determine the `ID` type for the given actor.
48
58
Type getDistributedActorIDType (NominalTypeDecl *actor);
49
59
50
- // / Similar to `getDistributedSerializationRequirementType`, however, from the
51
- // / perspective of a concrete function. This way we're able to get the
52
- // / serialization requirement for specific members, also in protocols.
53
- Type getSerializationRequirementTypesForMember (
54
- ValueDecl *member, llvm::SmallPtrSet<ProtocolDecl *, 2 > &serializationRequirements);
55
-
56
60
// / Get specific 'SerializationRequirement' as defined in 'nominal'
57
61
// / type, which must conform to the passed 'protocol' which is expected
58
62
// / to require the 'SerializationRequirement'.
@@ -66,6 +70,12 @@ AbstractFunctionDecl *
66
70
getAssociatedDistributedInvocationDecoderDecodeNextArgumentFunction (
67
71
ValueDecl *thunk);
68
72
73
+ Type getDistributedActorSerializationType (DeclContext *actorOrExtension);
74
+
75
+ // / Get the specific 'SerializationRequirement' type of a specific distributed
76
+ // / actor system.
77
+ Type getDistributedActorSystemSerializationType (NominalTypeDecl *system);
78
+
69
79
// / Get the specific 'InvocationEncoder' type of a specific distributed actor
70
80
// / system.
71
81
Type getDistributedActorSystemInvocationEncoderType (NominalTypeDecl *system);
@@ -81,17 +91,6 @@ Type getDistributedActorSystemResultHandlerType(NominalTypeDecl *system);
81
91
// / Get the 'ActorID' type of a specific distributed actor system.
82
92
Type getDistributedActorSystemActorIDType (NominalTypeDecl *system);
83
93
84
- // / Get the specific protocols that the `SerializationRequirement` specifies,
85
- // / and all parameters / return types of distributed targets must conform to.
86
- // /
87
- // / E.g. if a system declares `typealias SerializationRequirement = Codable`
88
- // / then this will return `{encodableProtocol, decodableProtocol}`.
89
- // /
90
- // / Returns an empty set if the requirement was `Any`.
91
- llvm::SmallPtrSet<ProtocolDecl *, 2 >
92
- getDistributedSerializationRequirementProtocols (
93
- NominalTypeDecl *decl, ProtocolDecl* protocol);
94
-
95
94
// / Check if the `allRequirements` represent *exactly* the
96
95
// / `Encodable & Decodable` (also known as `Codable`) requirement.
97
96
// /
@@ -115,6 +114,70 @@ getDistributedSerializationRequirements(
115
114
ProtocolDecl *protocol,
116
115
llvm::SmallPtrSetImpl<ProtocolDecl *> &requirementProtos);
117
116
117
+ // / Retrieve the declaration of DistributedActorSystem.remoteCall(Void)(...).
118
+ // /
119
+ // / \param actorOrSystem distributed actor or actor system to get the
120
+ // / remoteCall function for. Since the method we're looking for is an ad-hoc
121
+ // / requirement, a specific type MUST be passed here as it is not possible
122
+ // / to obtain the decl from just the `DistributedActorSystem` protocol type.
123
+ // / \param isVoidReturn true if the call will be returning `Void`.
124
+ AbstractFunctionDecl *
125
+ getRemoteCallOnDistributedActorSystem (NominalTypeDecl *actorOrSystem,
126
+ bool isVoidReturn);
127
+
128
+ // / Retrieve the declaration of DistributedActorSystem.make().
129
+ // /
130
+ // / \param thunk the function from which we'll be invoking things on the
131
+ // / obtained actor system; This way we'll always get the right type, taking care
132
+ // / of any where clauses etc.
133
+ FuncDecl *
134
+ getMakeInvocationEncoderOnDistributedActorSystem (AbstractFunctionDecl *thunk);
135
+
136
+ // Retrieve the declaration of
137
+ // DistributedInvocationEncoder.recordGenericSubstitution(_:).
138
+ //
139
+ // \param nominal optionally provide a 'NominalTypeDecl' from which the
140
+ // function decl shall be extracted. This is useful to avoid witness calls
141
+ // through the protocol which is looked up when nominal is null.
142
+ FuncDecl *getRecordGenericSubstitutionOnDistributedInvocationEncoder (
143
+ NominalTypeDecl *nominal);
144
+
145
+ // Retrieve the declaration of
146
+ // DistributedTargetInvocationEncoder.recordArgument(_:).
147
+ //
148
+ // \param nominal optionally provide a 'NominalTypeDecl' from which the
149
+ // function decl shall be extracted. This is useful to avoid witness calls
150
+ // through the protocol which is looked up when nominal is null.
151
+ AbstractFunctionDecl *
152
+ getRecordArgumentOnDistributedInvocationEncoder (NominalTypeDecl *nominal);
153
+
154
+ // Retrieve the declaration of
155
+ // DistributedTargetInvocationEncoder.recordReturnType(_:).
156
+ AbstractFunctionDecl *
157
+ getRecordReturnTypeOnDistributedInvocationEncoder (NominalTypeDecl *nominal);
158
+
159
+ // Retrieve the declaration of
160
+ // DistributedTargetInvocationEncoder.recordErrorType(_:).
161
+ AbstractFunctionDecl *
162
+ getRecordErrorTypeOnDistributedInvocationEncoder (NominalTypeDecl *nominal);
163
+
164
+ // Retrieve the declaration of
165
+ // DistributedTargetInvocationDecoder.getDecodeNextArgumentOnDistributedInvocationDecoder(_:).
166
+ AbstractFunctionDecl *
167
+ getDecodeNextArgumentOnDistributedInvocationDecoder (NominalTypeDecl *nominal);
168
+
169
+ // Retrieve the declaration of
170
+ // getOnReturnOnDistributedTargetInvocationResultHandler.onReturn(_:).
171
+ AbstractFunctionDecl *
172
+ getOnReturnOnDistributedTargetInvocationResultHandler (NominalTypeDecl *nominal);
173
+
174
+ // Retrieve the declaration of DistributedInvocationEncoder.doneRecording().
175
+ //
176
+ // \param nominal optionally provide a 'NominalTypeDecl' from which the
177
+ // function decl shall be extracted. This is useful to avoid witness calls
178
+ // through the protocol which is looked up when nominal is null.
179
+ FuncDecl *
180
+ getDoneRecordingOnDistributedInvocationEncoder (NominalTypeDecl *nominal);
118
181
}
119
182
120
183
#endif /* SWIFT_DECL_DISTRIBUTEDDECL_H */
0 commit comments