Home | History | Annotate | Download | only in bindings
      1 // Copyright 2017 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_SET_H_
      6 #define MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_SET_H_
      7 
      8 #include "mojo/public/cpp/bindings/binding_set.h"
      9 #include "mojo/public/cpp/bindings/unique_ptr_impl_ref_traits.h"
     10 
     11 namespace mojo {
     12 
     13 // This class manages a set of bindings. When the pipe a binding is bound to is
     14 // disconnected, the binding is automatically destroyed and removed from the
     15 // set, and the interface implementation is deleted. When the StrongBindingSet
     16 // is destructed, all outstanding bindings in the set are destroyed and all the
     17 // bound interface implementations are automatically deleted.
     18 template <typename Interface,
     19           typename ContextType = void,
     20           typename Deleter = std::default_delete<Interface>>
     21 using StrongBindingSet = BindingSetBase<
     22     Interface,
     23     Binding<Interface, UniquePtrImplRefTraits<Interface, Deleter>>,
     24     ContextType>;
     25 
     26 }  // namespace mojo
     27 
     28 #endif  // MOJO_PUBLIC_CPP_BINDINGS_STRONG_BINDING_SET_H_
     29