SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 297 | Next

Jonathan Jacky, Margus Veanes, Colin Campbell, Wolfram Schulte

"Model-Based Software Testing and Analysis with C#"

6).
Notice that this feature has no state variables of its own. It is a dependent feature
of the credits feature model program. We could also have annotated the credits
feature model program in Figure 14.1 directly, but it is useful to keep the dependent
feature separate for readability and for later use in compositions. In some cases the
dependent feature is not needed and can be omitted.
Advanced Topics 231
namespace SP
{
[Feature]
class MessageParameters
{
[Action("ResSetup(m,c,_)")]
[Action("ResWork(m,c,_)")]
static void Res([Domain("M")]int m, [Domain("C")]int c){}
static Set M() { return Credits.requests.Keys; }
static Set C()
{
if (Credits.requests.Values.IsEmpty)
return Set.EmptySet;
else{
int maxCredits = Credits.requests.Values.Minimum();
Set res = Set.EmptySet;
for (int c = 0; c <= maxCredits; c++) res = res.Add(c);
return res;
}
}
[Action("ReqSetup(m,_)")]
[Action("ReqWork(m,_)")]
static void Req([Domain("ReqM")]int m){}
static Set ReqM() { return Credits.window; }
[Action]
static void Cancel([Domain("CancelM")]int m) { }
static Set CancelM() { return Credits.requests.Keys; }
}
}
Figure 14.6. Message parameters.
14.2.3 Cancellation feature
The cancellation feature of the protocol enables the client to cancel requests that
have been sent to the server. In order to cancel a previously sent request with message
ID k, the client sends a Cancel request to the server that identifies the request to be
cancelled by including the ID k in the message.


Pages:
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
hotel jelenia góra Russian bride Free English grammar and study guid powiekszenia wielkoformatowe counter strike 1.6