diff options
author | Josh Haberman <haberman@google.com> | 2013-02-15 16:27:18 -0800 |
---|---|---|
committer | Josh Haberman <haberman@google.com> | 2013-02-15 16:27:18 -0800 |
commit | 7d3e2bd2c4cfd1296d1d6f996d7548de26540d41 (patch) | |
tree | b4b35967b3322c65cfb1a32220e8718de09d85fc /bindings/cpp/upb/handlers.cc | |
parent | ea198bdcf947ba4bd51474bdd4f7b82b5e4cf41d (diff) |
Sync with 8 months of Google-internal development.
Many things have changed and been simplified.
The memory-management story for upb_def and upb_handlers
is much more robust; upb_def and upb_handlers should be
fairly stable interfaces now. There is still much work
to do for the runtime component (upb_sink).
Diffstat (limited to 'bindings/cpp/upb/handlers.cc')
-rw-r--r-- | bindings/cpp/upb/handlers.cc | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/bindings/cpp/upb/handlers.cc b/bindings/cpp/upb/handlers.cc deleted file mode 100644 index c96a74e..0000000 --- a/bindings/cpp/upb/handlers.cc +++ /dev/null @@ -1,39 +0,0 @@ -// -// upb - a minimalist implementation of protocol buffers. -// -// Copyright (c) 2011 Google Inc. See LICENSE for details. -// Author: Josh Haberman <jhaberman@gmail.com> - -#include "handlers.hpp" - -#include "def.hpp" - -namespace upb { - -namespace { - -void MessageCallbackWrapper( - void* closure, upb_mhandlers* mh, const upb_msgdef* m) { - Handlers::MessageRegistrationVisitor* visitor = - static_cast<Handlers::MessageRegistrationVisitor*>(closure); - visitor->OnMessage(static_cast<MessageHandlers*>(mh), - static_cast<const MessageDef*>(m)); -} - -void FieldCallbackWrapper( - void* closure, upb_fhandlers* fh, const upb_fielddef* f) { - Handlers::MessageRegistrationVisitor* visitor = - static_cast<Handlers::MessageRegistrationVisitor*>(closure); - visitor->OnField(static_cast<FieldHandlers*>(fh), - static_cast<const FieldDef*>(f)); -} -} // namepace - -MessageHandlers* Handlers::RegisterMessageDef( - const MessageDef& m, Handlers::MessageRegistrationVisitor* visitor) { - upb_mhandlers* mh = upb_handlers_regmsgdef( - this, &m, &MessageCallbackWrapper, &FieldCallbackWrapper, &visitor); - return static_cast<MessageHandlers*>(mh); -} - -} // namespace upb |