diff options
author | Nate Goergen <nate.goergen.gitlab1@mile10.com> | 2015-03-07 15:53:16 -0600 |
---|---|---|
committer | Tom Rondeau <tom@trondeau.com> | 2015-04-02 15:38:57 -0700 |
commit | 6a5daf4f9942d0536a4507e2389e1a68f877465a (patch) | |
tree | 4930a5274b4ea7bbd61de076e4e066ec9f723ffd /gnuradio-runtime/lib/controlport | |
parent | 4122e96257fd70c8469d0825f3a913ab3af6d16d (diff) |
controlport: cleanup
Diffstat (limited to 'gnuradio-runtime/lib/controlport')
-rw-r--r-- | gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc | 53 | ||||
-rw-r--r-- | gnuradio-runtime/lib/controlport/thrift/thrift_application_base.cc | 21 |
2 files changed, 21 insertions, 53 deletions
diff --git a/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc b/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc index 874df5b202..f033b612a5 100644 --- a/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc +++ b/gnuradio-runtime/lib/controlport/thrift/rpcserver_booter_thrift.cc @@ -59,51 +59,40 @@ rpcserver_booter_thrift::endpoints() GNURadio::ControlPortIf>::endpoints(); } -template<typename TserverBase, typename TserverClass> -const unsigned int thrift_application_base<TserverBase, TserverClass>::d_default_thrift_port(0U); +<class rpcserver_base, class rpcserver_booter_thrift> +const unsigned int thrift_application_base<rpcserver_base, rpcserver_booter_thrift>::d_default_max_init_attempts(100U); -template<typename TserverBase, typename TserverClass> -const unsigned int thrift_application_base<TserverBase, TserverClass>::d_default_num_thrift_threads(10U); +template<class rpcserver_base, class rpcserver_booter_thrift> +const unsigned int thrift_application_base<rpcserver_base, rpcserver_booter_thrift>::d_default_thrift_port(0U); -template<typename TserverBase, typename TserverClass> -thrift_application_base<TserverBase, TserverClass>::~thrift_application_base() +template<class rpcserver_base, class rpcserver_booter_thrift> +const unsigned int thrift_application_base<rpcserver_base, rpcserver_booter_thrift>::d_default_num_thrift_threads(10U); + +template<class rpcserver_base, class rpcserver_booter_thrift> +thrift_application_base<rpcserver_base, rpcserver_booter_thrift>::~thrift_application_base() { GR_LOG_DEBUG(d_debug_logger, "thrift_application_base: shutdown"); - if(d_is_running) { + if(d_thirft_is_running) { d_thriftserver->stop(); - d_is_running = false; + d_thirft_is_running = false; } } -template<typename TserverBase, typename TserverClass> -void thrift_application_base<TserverBase, TserverClass>::start_thrift() +template<class rpcserver_base, class rpcserver_booter_thrift> +void thrift_application_base<rpcserver_base, rpcserver_booter_thrift>::start_thrift() { - //char* argv[2]; - //argv[0] = (char*)""; - // - //std::string conffile = gr::prefs::singleton()->get_string("ControlPort", "config", ""); - // - //if(conffile.size() > 0) { - // std::stringstream thriftconf; - // d_have_thrift_config = true; - // d_main_called = true; - // thriftconf << conffile; - // main(0, argv, thriftconf.str().c_str()); - //} - //else { - // d_have_thrift_config = false; - // d_main_called = true; - // main(0, argv); - //} - d_thriftserver->serve(); } +template<class rpcserver_base, class rpcserver_booter_thrift> +std::auto_ptr<thrift_application_base_impl<rpcserver_booter_thrift> > + thrift_application_base<rpcserver_base, rpcserver_booter_thrift>::p_impl( + new thrift_application_base_impl<rpcserver_booter_thrift>()); -template<typename TserverBase, typename TserverClass> -bool thrift_application_base<TserverBase, TserverClass>::application_started() +template<class rpcserver_base, typename rpcserver_booter_thrift> +bool thrift_application_base<rpcserver_base, rpcserver_booter_thrift>::application_started() { - if (d_is_running) return true; + if (d_thirft_is_running) return true; bool result(false); // Define the endpoint @@ -123,7 +112,7 @@ bool thrift_application_base<TserverBase, TserverClass>::application_started() set_endpoint(endpoint); GR_LOG_INFO(d_logger, "Apache Thrift: " + endpoint); - d_is_running = true; + d_thirft_is_running = true; result = true; } diff --git a/gnuradio-runtime/lib/controlport/thrift/thrift_application_base.cc b/gnuradio-runtime/lib/controlport/thrift/thrift_application_base.cc index 2f7ff3b44d..45d4b2018b 100644 --- a/gnuradio-runtime/lib/controlport/thrift/thrift_application_base.cc +++ b/gnuradio-runtime/lib/controlport/thrift/thrift_application_base.cc @@ -21,25 +21,4 @@ */ #include <gnuradio/thrift_application_base.h> -#include <thrift/server/TServer.h> -int thrift_application_common::d_reacquire_attributes(0); -bool thrift_application_common::d_main_called(false); -bool thrift_application_common::d_have_thrift_config(false); -boost::shared_ptr<boost::thread> thrift_application_common::d_thread; -std::string thrift_application_common::d_endpointStr(""); - -boost::shared_ptr<thrift_application_common> -thrift_application_common::Instance() -{ - static boost::shared_ptr<thrift_application_common> - instance(new thrift_application_common()); - return instance; -} - -int -thrift_application_common::run(int, char**) -{ - d_thriftserver->serve(); - return EXIT_SUCCESS; -} |