// (C) Copyright Jonathan Turkanis 2004. // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) // Disclaimer: Not a Boost library. #ifndef BOOST_IDL_INTERFACE_ACCESS_HPP_INCLUDED #define BOOST_IDL_INTERFACE_ACCESS_HPP_INCLUDED #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif #include // BOOST_NO_MEMBER_TEMPLATE_FRIENDS. #include #include #include #include #ifndef BOOST_IDL_NO_ACCESS_CONTROL # if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) # define BOOST_IDL_NO_ACCESS_CONTROL # endif #endif #ifndef BOOST_IDL_NO_ACCESS_CONTROL # define BOOST_IDL_PRIVATE private #else # define BOOST_IDL_PRIVATE public #endif namespace boost { namespace interfaces { class access { #ifndef BOOST_IDL_NO_ACCESS_CONTROL template friend class subinterface; template friend class const_view; template friend class fixed_view; template friend class unique_ptr; template friend class shared_ptr; template friend class manual_ptr; template friend class unique_obj; template friend class shared_obj; template friend struct implements; template friend struct interface_base; template friend struct detail::null_invoker; template< typename Interface, typename AccessTag, typename Signature, typename Names, typename Advice, int Arity > friend struct detail::basic_invoker; template< typename Interface, typename AccessTag, typename Signature, typename Names, typename Advice, int Arity > friend struct detail::transforming_invoker; template friend struct detail::interface_table_impl; template friend class detail::unique_obj_impl; template friend class detail::shared_obj_impl; template friend void swap(Interface&, Interface&); template friend fixed_view* get_delegate(Delegator& d); template friend void set_delegate(Delegator& d, T* t); template friend X& extract(Interface& i); #else public: #endif template static const void* get_interface_pointer(const T& t) { return t.BOOST_IDL_MEMBER_PTR; } template static const detail::fn_ptr* get_interface_table(const T& t) { return t.BOOST_IDL_MEMBER_TABLE; } template static void set_interface_pointer(T& t, const void* pv) { const_cast(t.BOOST_IDL_MEMBER_PTR) = const_cast(pv); } template static void set_interface_table(T& t, const detail::fn_ptr* table) { const_cast(t.BOOST_IDL_MEMBER_TABLE) = const_cast(table); } template static fixed_view* get_delegate(Delegator& d) { return d.delegating::get(); } template static void set_delegate(Delegator& d, T* t) { d.delegating::set(t); } }; } } // End namespace detail, interfaces, boost. #endif // #ifndef BOOST_IDL_INTERFACE_ACCESS_HPP_INCLUDED