def visitAttribute(self, node): typename = simplecxx.typeToSimpleCXX(node.attrType(), is_ret=1) typenameC = simplecxx.typeToSimpleCXX(node.attrType(), is_const=1) possibleWarnUnused = simplecxx.shouldWarnIfUnused(node.attrType()) for n in node.declarators(): self.cxxheader.out('virtual ' + typename + ' ' + n.simplename + '(' + ') throw(std::exception&) ' + possibleWarnUnused + ' = 0;') if not node.readonly(): self.cxxheader.out('virtual void ' + n.simplename + '(' + typenameC + ' attr' + ') throw(std::exception&) = 0;')
def visitAttribute(self, node): typename = simplecxx.typeToSimpleCXX(node.attrType(), is_ret=1) typenameC = simplecxx.typeToSimpleCXX(node.attrType(), is_const=1) possibleWarnUnused = simplecxx.shouldWarnIfUnused(node.attrType()); for n in node.declarators(): self.cxxheader.out('virtual ' + typename + ' ' + n.simplename + '(' + ') throw(std::exception&) ' + possibleWarnUnused + ' = 0;') if not node.readonly(): self.cxxheader.out('virtual void ' + n.simplename + '(' + typenameC + ' attr' + ') throw(std::exception&) = 0;')
def visitOperation(self, node): rtype = simplecxx.typeToSimpleCXX(node.returnType(), is_ret=1) if node.simplename == 'query_interface': rtype = 'void*' call = 'virtual ' + rtype call = call + ' ' + node.simplename + '(' needcomma = 0 for n in node.parameters(): if needcomma: call = call + ', ' needcomma = 1 if n.is_out(): numpoint = 1 else: numpoint = 0 call = call + simplecxx.typeToSimpleCXX(n.paramType(), numpoint, not n.is_out()) +\ ' ' + n.simplename # Every operation can throw, e.g. in an I/O error, not just those that # list exceptions with raises. call = call + ') throw(std::exception&)' +\ simplecxx.shouldWarnIfUnused(node.returnType()) + ' = 0;' self.cxxheader.out(call)