CreditReturnEvent constructor
Creates a counted credit-return payload.
Implementation
CreditReturnEvent(
{required this.countWidth,
this.poolCount = 1,
String name = 'credit_return_event'})
: super([
Logic(name: 'count', width: countWidth),
Logic(
name: 'pool',
width: (poolCount - 1).bitLength < 1
? 1
: (poolCount - 1).bitLength),
], name: name) {
if (countWidth < 1) {
throw ArgumentError.value(
countWidth, 'countWidth', 'Must be at least one.');
}
if (poolCount < 1) {
throw ArgumentError.value(poolCount, 'poolCount', 'Must be positive.');
}
}