text: 
  // AUTO GENERATED by vnxcppcodegen
  
  #include <mmx/operations/package.hxx>
  #include <mmx/operations/Mint.hxx>
  #include <mmx/Operation.hxx>
  #include <mmx/hash_t.hpp>
  
  #include <vnx/vnx.h>
  
  
  namespace mmx {
  namespace operations {
  
  
  const vnx::Hash64 Mint::VNX_TYPE_HASH(0x183e1690ca150e94ull);
  const vnx::Hash64 Mint::VNX_CODE_HASH(0xd73c8d95debabc61ull);
  
  vnx::Hash64 Mint::get_type_hash() const {
  	return VNX_TYPE_HASH;
  }
  
  std::string Mint::get_type_name() const {
  	return "mmx.operations.Mint";
  }
  
  const vnx::TypeCode* Mint::get_type_code() const {
  	return mmx::operations::vnx_native_type_code_Mint;
  }
  
  std::shared_ptr<Mint> Mint::create() {
  	return std::make_shared<Mint>();
  }
  
  std::shared_ptr<vnx::Value> Mint::clone() const {
  	return std::make_shared<Mint>(*this);
  }
  
  void Mint::read(vnx::TypeInput& _in, const vnx::TypeCode* _type_code, const uint16_t* _code) {
  	vnx::read(_in, *this, _type_code, _code);
  }
  
  void Mint::write(vnx::TypeOutput& _out, const vnx::TypeCode* _type_code, const uint16_t* _code) const {
  	vnx::write(_out, *this, _type_code, _code);
  }
  
  void Mint::accept(vnx::Visitor& _visitor) const {
  	const vnx::TypeCode* _type_code = mmx::operations::vnx_native_type_code_Mint;
  	_visitor.type_begin(*_type_code);
  	_visitor.type_field(_type_code->fields[0], 0); vnx::accept(_visitor, version);
  	_visitor.type_field(_type_code->fields[1], 1); vnx::accept(_visitor, address);
  	_visitor.type_field(_type_code->fields[2], 2); vnx::accept(_visitor, solution);
  	_visitor.type_field(_type_code->fields[3], 3); vnx::accept(_visitor, amount);
  	_visitor.type_end(*_type_code);
  }
  
  void Mint::write(std::ostream& _out) const {
  	_out << "{\"__type\": \"mmx.operations.Mint\"";
  	_out << ", \"version\": "; vnx::write(_out, version);
  	_out << ", \"address\": "; vnx::write(_out, address);
  	_out << ", \"solution\": "; vnx::write(_out, solution);
  	_out << ", \"amount\": "; vnx::write(_out, amount);
  	_out << "}";
  }
  
  void Mint::read(std::istream& _in) {
  	if(auto _json = vnx::read_json(_in)) {
  		from_object(_json->to_object());
  	}
  }
  
  vnx::Object Mint::to_object() const {
  	vnx::Object _object;
  	_object["__type"] = "mmx.operations.Mint";
  	_object["version"] = version;
  	_object["address"] = address;
  	_object["solution"] = solution;
  	_object["amount"] = amount;
  	return _object;
  }
  
  void Mint::from_object(const vnx::Object& _object) {
  	for(const auto& _entry : _object.field) {
  		if(_entry.first == "address") {
  			_entry.second.to(address);
  		} else if(_entry.first == "amount") {
  			_entry.second.to(amount);
  		} else if(_entry.first == "solution") {
  			_entry.second.to(solution);
  		} else if(_entry.first == "version") {
  			_entry.second.to(version);
  		}
  	}
  }
  
  vnx::Variant Mint::get_field(const std::string& _name) const {
  	if(_name == "version") {
  		return vnx::Variant(version);
  	}
  	if(_name == "address") {
  		return vnx::Variant(address);
  	}
  	if(_name == "solution") {
  		return vnx::Variant(solution);
  	}
  	if(_name == "amount") {
  		return vnx::Variant(amount);
  	}
  	return vnx::Variant();
  }
  
  void Mint::set_field(const std::string& _name, const vnx::Variant& _value) {
  	if(_name == "version") {
  		_value.to(version);
  	} else if(_name == "address") {
  		_value.to(address);
  	} else if(_name == "solution") {
  		_value.to(solution);
  	} else if(_name == "amount") {
  		_value.to(amount);
  	} else {
  		throw std::logic_error("no such field: '" + _name + "'");
  	}
  }
  
  /// \private
  std::ostream& operator<<(std::ostream& _out, const Mint& _value) {
  	_value.write(_out);
  	return _out;
  }
  
  /// \private
  std::istream& operator>>(std::istream& _in, Mint& _value) {
  	_value.read(_in);
  	return _in;
  }
  
  const vnx::TypeCode* Mint::static_get_type_code() {
  	const vnx::TypeCode* type_code = vnx::get_type_code(VNX_TYPE_HASH);
  	if(!type_code) {
  		type_code = vnx::register_type_code(static_create_type_code());
  	}
  	return type_code;
  }
  
  std::shared_ptr<vnx::TypeCode> Mint::static_create_type_code() {
  	auto type_code = std::make_shared<vnx::TypeCode>();
  	type_code->name = "mmx.operations.Mint";
  	type_code->type_hash = vnx::Hash64(0x183e1690ca150e94ull);
  	type_code->code_hash = vnx::Hash64(0xd73c8d95debabc61ull);
  	type_code->is_native = true;
  	type_code->is_class = true;
  	type_code->native_size = sizeof(::mmx::operations::Mint);
  	type_code->parents.resize(1);
  	type_code->parents[0] = ::mmx::Operation::static_get_type_code();
  	type_code->create_value = []() -> std::shared_ptr<vnx::Value> { return std::make_shared<Mint>(); };
  	type_code->fields.resize(4);
  	{
  		auto& field = type_code->fields[0];
  		field.data_size = 4;
  		field.name = "version";
  		field.code = {7};
  	}
  	{
  		auto& field = type_code->fields[1];
  		field.is_extended = true;
  		field.name = "address";
  		field.code = {11, 32, 1};
  	}
  	{
  		auto& field = type_code->fields[2];
  		field.is_extended = true;
  		field.name = "solution";
  		field.code = {16};
  	}
  	{
  		auto& field = type_code->fields[3];
  		field.data_size = 8;
  		field.name = "amount";
  		field.code = {4};
  	}
  	type_code->build();
  	return type_code;
  }
  
  
  } // namespace mmx
  } // namespace operations
  
  
  namespace vnx {
  
  void read(TypeInput& in, ::mmx::operations::Mint& value, const TypeCode* type_code, const uint16_t* code) {
  	if(code) {
  		switch(code[0]) {
  			case CODE_OBJECT:
  			case CODE_ALT_OBJECT: {
  				Object tmp;
  				vnx::read(in, tmp, type_code, code);
  				value.from_object(tmp);
  				return;
  			}
  			case CODE_DYNAMIC:
  			case CODE_ALT_DYNAMIC:
  				vnx::read_dynamic(in, value);
  				return;
  		}
  	}
  	if(!type_code) {
  		vnx::skip(in, type_code, code);
  		return;
  	}
  	if(code) {
  		switch(code[0]) {
  			case CODE_STRUCT: type_code = type_code->depends[code[1]]; break;
  			case CODE_ALT_STRUCT: type_code = type_code->depends[vnx::flip_bytes(code[1])]; break;
  			default: {
  				vnx::skip(in, type_code, code);
  				return;
  			}
  		}
  	}
  	const char* const _buf = in.read(type_code->total_field_size);
  	if(type_code->is_matched) {
  		if(const auto* const _field = type_code->field_map[0]) {
  			vnx::read_value(_buf + _field->offset, value.version, _field->code.data());
  		}
  		if(const auto* const _field = type_code->field_map[3]) {
  			vnx::read_value(_buf + _field->offset, value.amount, _field->code.data());
  		}
  	}
  	for(const auto* _field : type_code->ext_fields) {
  		switch(_field->native_index) {
  			case 1: vnx::read(in, value.address, type_code, _field->code.data()); break;
  			case 2: vnx::read(in, value.solution, type_code, _field->code.data()); break;
  			default: vnx::skip(in, type_code, _field->code.data());
  		}
  	}
  }
  
  void write(TypeOutput& out, const ::mmx::operations::Mint& value, const TypeCode* type_code, const uint16_t* code) {
  	if(code && code[0] == CODE_OBJECT) {
  		vnx::write(out, value.to_object(), nullptr, code);
  		return;
  	}
  	if(!type_code || (code && code[0] == CODE_ANY)) {
  		type_code = mmx::operations::vnx_native_type_code_Mint;
  		out.write_type_code(type_code);
  		vnx::write_class_header<::mmx::operations::Mint>(out);
  	}
  	else if(code && code[0] == CODE_STRUCT) {
  		type_code = type_code->depends[code[1]];
  	}
  	char* const _buf = out.write(12);
  	vnx::write_value(_buf + 0, value.version);
  	vnx::write_value(_buf + 4, value.amount);
  	vnx::write(out, value.address, type_code, type_code->fields[1].code.data());
  	vnx::write(out, value.solution, type_code, type_code->fields[2].code.data());
  }
  
  void read(std::istream& in, ::mmx::operations::Mint& value) {
  	value.read(in);
  }
  
  void write(std::ostream& out, const ::mmx::operations::Mint& value) {
  	value.write(out);
  }
  
  void accept(Visitor& visitor, const ::mmx::operations::Mint& value) {
  	value.accept(visitor);
  }
  
  } // vnx
  