Frame() : transfer_priority_(TransferPriority(NumTransferPriorities)) // Invalid value , transfer_type_(TransferType(NumTransferTypes)) // Invalid value , payload_len_(0) , frame_index_(0) , transfer_id_(0) , last_frame_(false) { }
static TransferPriority fromPercent() { StaticAssert<(Percent <= 100)>::check(); enum { Result = ((100U - Percent) * NumericallyMax) / 100U }; StaticAssert<(Result <= NumericallyMax)>::check(); StaticAssert<(Result >= NumericallyMin)>::check(); return TransferPriority(Result); }