def mapStructValue(self, structdef, value): newval = {} for field in structdef['fields']: identifier = field['identifier'] if identifier in value: if type(value[identifier]) == list: newval[identifier] = [] for val in value[identifier]: newval[identifier].append(cpp.literal(val, field['type'])) else: newval[identifier] = cpp.literal(value[identifier], field['type']) return newval
def mapStructValue(self, structdef, value): newval = {} for field in structdef['fields']: identifier = field['identifier'] if identifier in value: if type(value[identifier]) == list: newval[identifier] = [] for val in value[identifier]: newval[identifier].append(cpp.literal(val, field['type'], field['iscomplex'])) else: newval[identifier] = cpp.literal(value[identifier], field['type'], field['iscomplex']) return newval
def mapStructValue(self, structdef, value): newval = {} for field in structdef['fields']: identifier = field['identifier'] if identifier in value: newval[identifier] = cpp.literal(value[identifier], field['type']) return newval
def mapSimpleSequenceProperty(self, prop): cppprop = self.mapProperty(prop) cppprop['cpptype'] = cpp.sequenceType(prop.type(), prop.isComplex()) if prop.hasValue(): cppprop['cppvalues'] = [cpp.literal(v, prop.type(), prop.isComplex()) for v in prop.value()] return cppprop
def mapSimpleProperty(self, prop): cppprop = self.mapProperty(prop) cppprop['iscomplex'] = prop.isComplex() cppprop['cpptype'] = cpp.cppType(prop.type(), prop.isComplex()) if prop.hasValue(): cppprop['cppvalue'] = cpp.literal(prop.value(), prop.type(), prop.isComplex()) return cppprop
def mapSimpleProperty(self, prop): cppprop = self.mapProperty(prop) cppprop['iscomplex'] = prop.isComplex() cppprop['isOptional'] = prop.isOptional() cppprop['cpptype'] = cpp.cppType(prop.type(), prop.isComplex()) if prop.hasValue(): cppprop['cppvalue'] = cpp.literal(prop.value(), prop.type(), prop.isComplex()) return cppprop
def mapSimpleSequenceProperty(self, prop): cppprop = self.mapProperty(prop) cppprop['cpptype'] = cpp.sequenceType(prop.type(), prop.isComplex()) cppprop['isOptional'] = prop.isOptional() if prop.hasValue(): cppprop['cppvalues'] = [ cpp.literal(v, prop.type(), prop.isComplex()) for v in prop.value() ] return cppprop
def mapSimpleProperty(self, prop): cppprop = self.mapProperty(prop) cppprop['iscomplex'] = prop.isComplex() cppprop['isOptional'] = prop.isOptional() cppprop['cpptype'] = cpp.cppType(prop.type(), prop.isComplex()) if prop.hasValue(): _prepend = '' _append = '' if prop.type() == 'utctime': _prepend = '"' _append = '"' cppprop['cppvalue'] = _prepend+cpp.literal(prop.value(), prop.type(), prop.isComplex())+_append cppprop['format'] = self._getSimpleFormat(prop, False) return cppprop
def mapSimpleSequenceProperty(self, prop): cppprop = self.mapProperty(prop) cppprop['cpptype'] = cpp.sequenceType(prop.type(), prop.isComplex()) cppprop['iscomplex'] = prop.isComplex() cppprop['isOptional'] = prop.isOptional() if prop.hasValue(): _prepend = '' _append = '' if prop.type() == 'utctime': _prepend = 'redhawk::time::utils::convert("' _append = '")' cppprop['cppvalues'] = [_prepend+cpp.literal(v, prop.type(), prop.isComplex())+_append for v in prop.value()] cppprop['format'] = self._getSimpleFormat(prop, True) return cppprop
def mapEnumeration(self, prop, label, value): cppenum = {} cppenum['cpplabel'] = cpp.identifier(label) cppenum['cppvalue'] = cpp.literal(value, prop.type(), prop.isComplex()) return cppenum