/// Function call operator overload.
    void operator() (reactor_factory_type factory)
    {
        bool const suspension_test[] =
        {
            true,  // Run suspension test.
            false  // Run removal test.
        };

        bool const * const begin = suspension_test;
        bool const * const end =
            suspension_test
            + sizeof (suspension_test) / sizeof (suspension_test[0]);

        for (bool const * i = begin; i != end; ++i)
        {
            bool const suspension_test = *i;

            if (suspension_test)
            {
                ACE_DEBUG ((LM_INFO,
                            ACE_TEXT ("** Running suspension test **\n")));
            }
            else
            {
                ACE_DEBUG ((LM_INFO,
                            ACE_TEXT ("** Running removal test **\n")));
            }

            auto_ptr<ACE_Reactor_Impl> the_factory (factory ());
            ACE_Reactor reactor (the_factory.get ());

            // In this test, it's only okay to close the Bogus_Handler
            // when the reactor is destroyed.
            bool okay_to_close = false;

            ACE_Pipe the_pipe;
            if (the_pipe.open () != 0
                    || register_handler (&reactor,
                                         the_pipe.read_handle (),
                                         okay_to_close,
                                         suspension_test) != 0
                    || send_data (the_pipe.write_handle ()) != 0
                    || handle_events (reactor, okay_to_close) != 0)
            {
                overall_result = -1;
            }

            okay_to_close = true;

            ACE_DEBUG ((LM_INFO, ACE_TEXT ("\n"))); // For log aesthetics.
        }
    }
 static ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XModuleController > create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController) {
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory > the_factory(the_context->getServiceManager());
     if (!the_factory.is()) {
         throw com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service manager")), the_context);
     }
     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(1);
     the_arguments[0] <<= xController;
     ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XModuleController > the_instance;
     try {
         the_instance = ::com::sun::star::uno::Reference< ::com::sun::star::drawing::framework::XModuleController >(the_factory->createInstanceWithArgumentsAndContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.drawing.framework.ModuleController")), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
     } catch (::com::sun::star::uno::RuntimeException &) {
         throw;
     } catch (::com::sun::star::uno::Exception & the_exception) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.drawing.framework.ModuleController of type com.sun.star.drawing.framework.XModuleController: ")) + the_exception.Message, the_context);
     }
     if (!the_instance.is()) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.drawing.framework.ModuleController of type com.sun.star.drawing.framework.XModuleController")), the_context);
     }
     return the_instance;
 }
예제 #3
0
 static ::com::sun::star::uno::Reference< ::com::sun::star::logging::XLogHandler > createWithSettings(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::NamedValue >& Settings) {
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory > the_factory(the_context->getServiceManager());
     if (!the_factory.is()) {
         throw com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service manager")), the_context);
     }
     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(1);
     the_arguments[0] <<= Settings;
     ::com::sun::star::uno::Reference< ::com::sun::star::logging::XLogHandler > the_instance;
     try {
         the_instance = ::com::sun::star::uno::Reference< ::com::sun::star::logging::XLogHandler >(the_factory->createInstanceWithArgumentsAndContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.logging.FileHandler")), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
     } catch (::com::sun::star::uno::RuntimeException &) {
         throw;
     } catch (::com::sun::star::lang::IllegalArgumentException &) {
         throw;
     } catch (::com::sun::star::uno::Exception & the_exception) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.logging.FileHandler of type com.sun.star.logging.XLogHandler: ")) + the_exception.Message, the_context);
     }
     if (!the_instance.is()) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.logging.FileHandler of type com.sun.star.logging.XLogHandler")), the_context);
     }
     return the_instance;
 }
 static ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerableMap > createImmutable(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, const ::com::sun::star::uno::Type& KeyType, const ::com::sun::star::uno::Type& ValueType, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Pair< ::com::sun::star::uno::Any, ::com::sun::star::uno::Any > >& Values) {
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory > the_factory(the_context->getServiceManager());
     if (!the_factory.is()) {
         throw com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service manager")), the_context);
     }
     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(3);
     the_arguments[0] <<= KeyType;
     the_arguments[1] <<= ValueType;
     the_arguments[2] <<= Values;
     ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerableMap > the_instance;
     try {
         the_instance = ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerableMap >(the_factory->createInstanceWithArgumentsAndContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.container.EnumerableMap")), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
     } catch (::com::sun::star::uno::RuntimeException &) {
         throw;
     } catch (::com::sun::star::beans::IllegalTypeException &) {
         throw;
     } catch (::com::sun::star::lang::IllegalArgumentException &) {
         throw;
     } catch (::com::sun::star::uno::Exception & the_exception) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.container.EnumerableMap of type com.sun.star.container.XEnumerableMap: ")) + the_exception.Message, the_context);
     }
     if (!the_instance.is()) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.container.EnumerableMap of type com.sun.star.container.XEnumerableMap")), the_context);
     }
     return the_instance;
 }
 static ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlModel > create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context) {
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory > the_factory(the_context->getServiceManager());
     if (!the_factory.is()) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service manager")), the_context);
     }
     ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlModel > the_instance;
     try {
         the_instance = ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportControlModel >(the_factory->createInstanceWithContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.report.ReportControlModel")), the_context), ::com::sun::star::uno::UNO_QUERY);
     } catch (::com::sun::star::uno::RuntimeException &) {
         throw;
     } catch (::com::sun::star::uno::Exception & the_exception) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.report.ReportControlModel of type com.sun.star.report.XReportControlModel: ")) + the_exception.Message, the_context);
     }
     if (!the_instance.is()) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.report.ReportControlModel of type com.sun.star.report.XReportControlModel")), the_context);
     }
     return the_instance;
 }
 static ::com::sun::star::uno::Reference< ::com::sun::star::logging::XLogFormatter > create(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context) {
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory > the_factory(the_context->getServiceManager());
     if (!the_factory.is()) {
         throw com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service manager")), the_context);
     }
     ::com::sun::star::uno::Reference< ::com::sun::star::logging::XLogFormatter > the_instance;
     try {
         the_instance = ::com::sun::star::uno::Reference< ::com::sun::star::logging::XLogFormatter >(the_factory->createInstanceWithArgumentsAndContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.logging.PlainTextFormatter")), ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >(), the_context), ::com::sun::star::uno::UNO_QUERY);
     } catch (::com::sun::star::uno::RuntimeException &) {
         throw;
     } catch (::com::sun::star::uno::Exception & the_exception) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.logging.PlainTextFormatter of type com.sun.star.logging.XLogFormatter: ")) + the_exception.Message, the_context);
     }
     if (!the_instance.is()) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.logging.PlainTextFormatter of type com.sun.star.logging.XLogFormatter")), the_context);
     }
     return the_instance;
 }
 static ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel > createWithHelpSection(::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > const & the_context, ::sal_Int32 minHelpTextLines, ::sal_Int32 maxHelpTextLines) {
     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiComponentFactory > the_factory(the_context->getServiceManager());
     if (!the_factory.is()) {
         throw com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service manager")), the_context);
     }
     ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > the_arguments(2);
     the_arguments[0] <<= minHelpTextLines;
     the_arguments[1] <<= maxHelpTextLines;
     ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel > the_instance;
     try {
         the_instance = ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorModel >(the_factory->createInstanceWithArgumentsAndContext(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.inspection.DefaultFormComponentInspectorModel")), the_arguments, the_context), ::com::sun::star::uno::UNO_QUERY);
     } catch (::com::sun::star::uno::RuntimeException &) {
         throw;
     } catch (::com::sun::star::lang::IllegalArgumentException &) {
         throw;
     } catch (::com::sun::star::uno::Exception & the_exception) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.form.inspection.DefaultFormComponentInspectorModel of type com.sun.star.inspection.XObjectInspectorModel: ")) + the_exception.Message, the_context);
     }
     if (!the_instance.is()) {
         throw ::com::sun::star::uno::DeploymentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("component context fails to supply service com.sun.star.form.inspection.DefaultFormComponentInspectorModel of type com.sun.star.inspection.XObjectInspectorModel")), the_context);
     }
     return the_instance;
 }