diff options
author | Sara Golemon <sara.golemon@mongodb.com> | 2021-04-28 15:09:09 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-04-29 20:34:57 +0000 |
commit | ea6fb92054f2fc1153f4c39bc4634d34bb3f9997 (patch) | |
tree | f8b96d20b517d02eaf8e26995dd8b8d5d8f23e67 /buildscripts/idl | |
parent | 979f4ee6a9b8128140e9b08bdb9b177b7c55b3f0 (diff) | |
download | mongo-ea6fb92054f2fc1153f4c39bc4634d34bb3f9997.tar.gz |
SERVER-56455 Expose reply_type on generated Command class
Diffstat (limited to 'buildscripts/idl')
-rw-r--r-- | buildscripts/idl/idl/generator.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/buildscripts/idl/idl/generator.py b/buildscripts/idl/idl/generator.py index 3dc643b5075..042ced2cd59 100644 --- a/buildscripts/idl/idl/generator.py +++ b/buildscripts/idl/idl/generator.py @@ -1140,6 +1140,14 @@ class _CppHeaderFileWriter(_CppFileWriterBase): with self.gen_class_declaration_block(struct.cpp_name): self.write_unindented_line('public:') + if isinstance(struct, ast.Command): + if struct.reply_type: + # Alias the reply type as a named type for commands + self.gen_type_alias_declaration("Reply", + struct.reply_type.type.cpp_type) + else: + self._writer.write_line('using Reply = void;') + # Generate a sorted list of string constants self.gen_string_constants_declarations(struct) self.write_empty_line() |