FunctionReference constructor

FunctionReference({
  1. required List<CandidType> in_types,
  2. required List<CandidType> out_types,
  3. bool isQuery = false,
  4. bool isOneWay = false,
  5. ServiceReference? service,
  6. Text? method_name,
  7. bool isTypeStance = false,
})

Implementation

FunctionReference({required this.in_types, required this.out_types, this.isQuery=false, this.isOneWay=false, this.service, this.method_name, this.isTypeStance=false}) {
    for (List<CandidType> types_list in [in_types, out_types]) {
        for (CandidType typestance in types_list) {
            if (typestance.isTypeStance==false) {
                throw Exception('CandidType: FunctionReference in_types & out_types lists needs each type-stance/finition with the isTypeStance=true, since these are the type-finitions for the function, not values.');
            }
        }
    }
    if ( (this.service != null && this.method_name == null) || (this.service == null && this.method_name != null)) {
        throw Exception('CandidType: FunctionReference service and method_name must be given both together or both null.');
    }
    if (this.isTypeStance==true && this.service != null) {
        throw Exception('CandidType: FunctionReference service & method_name must be null when isTypeStance==true');
    }
}