From 7d3e2bd2c4cfd1296d1d6f996d7548de26540d41 Mon Sep 17 00:00:00 2001 From: Josh Haberman Date: Fri, 15 Feb 2013 16:27:18 -0800 Subject: 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). --- bindings/cpp/upb/handlers.cc | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 bindings/cpp/upb/handlers.cc (limited to 'bindings/cpp/upb/handlers.cc') 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 - -#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(closure); - visitor->OnMessage(static_cast(mh), - static_cast(m)); -} - -void FieldCallbackWrapper( - void* closure, upb_fhandlers* fh, const upb_fielddef* f) { - Handlers::MessageRegistrationVisitor* visitor = - static_cast(closure); - visitor->OnField(static_cast(fh), - static_cast(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(mh); -} - -} // namespace upb -- cgit v1.2.3