summaryrefslogtreecommitdiff
path: root/gnuradio-runtime
diff options
context:
space:
mode:
authorTom Rondeau <tom@trondeau.com>2015-03-02 09:57:42 -0500
committerTom Rondeau <tom@trondeau.com>2015-04-02 15:38:57 -0700
commitc67d0a417f43c644a0ccabe46b38a1e48c3bd15d (patch)
tree2854441370cb1f9e158a61e250719039785b6b01 /gnuradio-runtime
parent7a8989d21de2f9a121eafe56ce0b557572a498d4 (diff)
controlport: simple style editing.
Diffstat (limited to 'gnuradio-runtime')
-rw-r--r--gnuradio-runtime/include/gnuradio/rpcpmtconverters_thrift.h2
-rw-r--r--gnuradio-runtime/include/gnuradio/rpcserver_thrift.h40
-rw-r--r--gnuradio-runtime/include/gnuradio/thrift_server_template.h64
-rw-r--r--gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift2
-rw-r--r--gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc114
-rw-r--r--gnuradio-runtime/lib/controlport/thrift/rpcserver_thrift.cc41
6 files changed, 165 insertions, 98 deletions
diff --git a/gnuradio-runtime/include/gnuradio/rpcpmtconverters_thrift.h b/gnuradio-runtime/include/gnuradio/rpcpmtconverters_thrift.h
index 4c074f0d58..eeb5b35c4e 100644
--- a/gnuradio-runtime/include/gnuradio/rpcpmtconverters_thrift.h
+++ b/gnuradio-runtime/include/gnuradio/rpcpmtconverters_thrift.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 Free Software Foundation, Inc.
+ * Copyright 2014,2015 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
diff --git a/gnuradio-runtime/include/gnuradio/rpcserver_thrift.h b/gnuradio-runtime/include/gnuradio/rpcserver_thrift.h
index 9f6faf1710..c09b0a1f80 100644
--- a/gnuradio-runtime/include/gnuradio/rpcserver_thrift.h
+++ b/gnuradio-runtime/include/gnuradio/rpcserver_thrift.h
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2014 Free Software Foundation, Inc.
+ * Copyright 2014,2015 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -43,16 +43,21 @@ public:
rpcserver_thrift();
virtual ~rpcserver_thrift();
- void registerConfigureCallback(const std::string &id, const configureCallback_t callback);
+ void registerConfigureCallback(const std::string &id,
+ const configureCallback_t callback);
void unregisterConfigureCallback(const std::string &id);
- void registerQueryCallback(const std::string &id, const queryCallback_t callback);
+ void registerQueryCallback(const std::string &id,
+ const queryCallback_t callback);
void unregisterQueryCallback(const std::string &id);
void setKnobs(const GNURadio::KnobMap&);
- void getKnobs(GNURadio::KnobMap&, const GNURadio::KnobIDList&);
- void getRe(GNURadio::KnobMap&, const GNURadio::KnobIDList&);
- void properties(GNURadio::KnobPropMap&, const GNURadio::KnobIDList& knobs);
+ void getKnobs(GNURadio::KnobMap&,
+ const GNURadio::KnobIDList&);
+ void getRe(GNURadio::KnobMap&,
+ const GNURadio::KnobIDList&);
+ void properties(GNURadio::KnobPropMap&,
+ const GNURadio::KnobIDList& knobs);
virtual void shutdown();
private:
@@ -94,7 +99,7 @@ public:
};
template<typename T, typename TMap>
- struct get_f : public std::unary_function<T,void>
+ struct get_f : public std::unary_function<T,void>
{
get_f(TMap &_getcallbackmap, const priv_lvl_t &_cur_priv, GNURadio::KnobMap &_outknobs) :
d_getcallbackmap(_getcallbackmap), cur_priv(_cur_priv), outknobs(_outknobs)
@@ -127,10 +132,10 @@ public:
};
template<typename T, typename TMap, typename TKnobMap>
- struct get_all_f : public std::unary_function<T,void>
+ struct get_all_f : public std::unary_function<T,void>
{
- get_all_f(TMap &_getcallbackmap, const priv_lvl_t &_cur_priv, TKnobMap &_outknobs) :
- d_getcallbackmap(_getcallbackmap), cur_priv(_cur_priv), outknobs(_outknobs)
+ get_all_f(TMap &_getcallbackmap, const priv_lvl_t &_cur_priv, TKnobMap &_outknobs) :
+ d_getcallbackmap(_getcallbackmap), cur_priv(_cur_priv), outknobs(_outknobs)
{;}
void operator()(const T& p)
@@ -151,11 +156,14 @@ public:
};
template<typename T, typename TMap, typename TKnobMap>
- struct properties_all_f : public std::unary_function<T,void>
+ struct properties_all_f : public std::unary_function<T,void>
{
- properties_all_f(QueryCallbackMap_t &_getcallbackmap, const priv_lvl_t &_cur_priv, GNURadio::KnobPropMap &_outknobs)
- :
- d_getcallbackmap(_getcallbackmap), cur_priv(_cur_priv), outknobs(_outknobs)
+ properties_all_f(QueryCallbackMap_t &_getcallbackmap,
+ const priv_lvl_t &_cur_priv,
+ GNURadio::KnobPropMap &_outknobs)
+ : d_getcallbackmap(_getcallbackmap),
+ cur_priv(_cur_priv),
+ outknobs(_outknobs)
{;}
void operator()(const T& p)
@@ -185,8 +193,8 @@ public:
template<class T, typename TMap, typename TKnobMap>
struct properties_f : public std::unary_function<T,void>
{
- properties_f(TMap &_getcallbackmap, const priv_lvl_t &_cur_priv, TKnobMap &_outknobs) :
- d_getcallbackmap(_getcallbackmap), cur_priv(_cur_priv), outknobs(_outknobs)
+ properties_f(TMap &_getcallbackmap, const priv_lvl_t &_cur_priv, TKnobMap &_outknobs) :
+ d_getcallbackmap(_getcallbackmap), cur_priv(_cur_priv), outknobs(_outknobs)
{;}
void operator()(const T& p)
diff --git a/gnuradio-runtime/include/gnuradio/thrift_server_template.h b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
index 5de0112c78..31c1316c63 100644
--- a/gnuradio-runtime/include/gnuradio/thrift_server_template.h
+++ b/gnuradio-runtime/include/gnuradio/thrift_server_template.h
@@ -69,20 +69,22 @@ private:
* of 512 bytes.
*
*/
- class TBufferedTransportFactory : public thrift::transport::TTransportFactory {
- public:
- TBufferedTransportFactory() : bufferSize(ALRIGHT_DEFAULT_BUFFER_SIZE) {;}
- TBufferedTransportFactory(const unsigned int _bufferSize) : bufferSize(_bufferSize) {;}
-
- virtual ~TBufferedTransportFactory() {}
-
- virtual boost::shared_ptr<thrift::transport::TTransport> getTransport(
- boost::shared_ptr<thrift::transport::TTransport> trans) {
- return boost::shared_ptr<thrift::transport::TTransport>(
- new thrift::transport::TBufferedTransport(trans, bufferSize));
- }
- private:
- unsigned int bufferSize;
+ class TBufferedTransportFactory : public thrift::transport::TTransportFactory
+ {
+ public:
+ TBufferedTransportFactory() : bufferSize(ALRIGHT_DEFAULT_BUFFER_SIZE) {;}
+ TBufferedTransportFactory(const unsigned int _bufferSize) : bufferSize(_bufferSize) {;}
+
+ virtual ~TBufferedTransportFactory() {}
+
+ virtual boost::shared_ptr<thrift::transport::TTransport> getTransport(
+ boost::shared_ptr<thrift::transport::TTransport> trans)
+ {
+ return boost::shared_ptr<thrift::transport::TTransport>
+ (new thrift::transport::TBufferedTransport(trans, bufferSize));
+ }
+ private:
+ unsigned int bufferSize;
};
};
@@ -109,24 +111,30 @@ thrift_server_template<TserverBase, TserverClass, TImplClass, TThriftClass>::thr
boost::shared_ptr<thrift::protocol::TProtocolFactory>
protocolFactory(new thrift::protocol::TBinaryProtocolFactory());
- if(thrift_application_base<TserverBase, TImplClass>::d_default_num_thrift_threads <= 1)
- { // "Thrift: Single-threaded server"
- thrift_application_base<TserverBase, TImplClass>::d_thriftserver =
- new thrift::server::TSimpleServer(processor, serverTransport, transportFactory, protocolFactory);
- } else { // std::cout << "Thrift Multi-threaded server : " << d_default_num_thrift_threads << std::endl;
- boost::shared_ptr<thrift::concurrency::ThreadManager> threadManager(
- thrift::concurrency::ThreadManager::newSimpleThreadManager(
- thrift_application_base<TserverBase, TImplClass>::d_default_num_thrift_threads));
+ if(thrift_application_base<TserverBase, TImplClass>::d_default_num_thrift_threads <= 1) {
+ // "Thrift: Single-threaded server"
+ thrift_application_base<TserverBase, TImplClass>::d_thriftserver =
+ new thrift::server::TSimpleServer(processor, serverTransport,
+ transportFactory, protocolFactory);
+ }
+ else {
+ // std::cout << "Thrift Multi-threaded server : " << d_default_num_thrift_threads << std::endl;
+ boost::shared_ptr<thrift::concurrency::ThreadManager> threadManager
+ (thrift::concurrency::ThreadManager::newSimpleThreadManager
+ (thrift_application_base<TserverBase, TImplClass>::d_default_num_thrift_threads));
- boost::shared_ptr<thrift::concurrency::PlatformThreadFactory> threadFactory(
- boost::shared_ptr<thrift::concurrency::PlatformThreadFactory>(new thrift::concurrency::PlatformThreadFactory()));
+ boost::shared_ptr<thrift::concurrency::PlatformThreadFactory> threadFactory
+ (boost::shared_ptr<thrift::concurrency::PlatformThreadFactory>
+ (new thrift::concurrency::PlatformThreadFactory()));
- threadManager->threadFactory(threadFactory);
+ threadManager->threadFactory(threadFactory);
- threadManager->start();
+ threadManager->start();
- thrift_application_base<TserverBase, TImplClass>::d_thriftserver =
- new thrift::server::TThreadPoolServer(processor, serverTransport, transportFactory, protocolFactory, threadManager);
+ thrift_application_base<TserverBase, TImplClass>::d_thriftserver =
+ new thrift::server::TThreadPoolServer(processor, serverTransport,
+ transportFactory, protocolFactory,
+ threadManager);
}
d_server = handler.get();
diff --git a/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift b/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift
index 66fbd639e3..ae7f839a2f 100644
--- a/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift
+++ b/gnuradio-runtime/lib/controlport/thrift/gnuradio.thrift
@@ -1,5 +1,5 @@
/*
- * Copyright 2014 Free Software Foundation, Inc.
+ * Copyright 2014,2015 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
diff --git a/gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc b/gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc
index d79b488b58..79620322a5 100644
--- a/gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc
+++ b/gnuradio-runtime/lib/controlport/thrift/rpcpmtconverters_thrift.cc
@@ -141,74 +141,104 @@ rpcpmtconverter::from_pmt(const pmt::pmt_t& knob)
return GNURadio::Knob();
}
-pmt::pmt_t rpcpmtconverter::to_pmt_byte_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_byte_f::operator()(const GNURadio::Knob& knob)
+{
return pmt::mp(knob.value.a_byte);
}
-pmt::pmt_t rpcpmtconverter::to_pmt_short_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_short_f::operator()(const GNURadio::Knob& knob)
+{
return pmt::mp(knob.value.a_short);
}
-pmt::pmt_t rpcpmtconverter::to_pmt_int_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_int_f::operator()(const GNURadio::Knob& knob)
+{
return pmt::mp(knob.value.a_int);
}
-pmt::pmt_t rpcpmtconverter::to_pmt_long_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_long_f::operator()(const GNURadio::Knob& knob)
+{
return pmt::mp(knob.value.a_long);
}
-pmt::pmt_t rpcpmtconverter::to_pmt_double_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_double_f::operator()(const GNURadio::Knob& knob)
+{
return pmt::mp(knob.value.a_double);
}
-pmt::pmt_t rpcpmtconverter::to_pmt_string_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_string_f::operator()(const GNURadio::Knob& knob)
+{
return pmt::string_to_symbol(knob.value.a_string);
}
-pmt::pmt_t rpcpmtconverter::to_pmt_bool_f::operator()(const GNURadio::Knob& knob) {
- if (knob.value.a_bool)
+pmt::pmt_t
+rpcpmtconverter::to_pmt_bool_f::operator()(const GNURadio::Knob& knob)
+{
+ if(knob.value.a_bool)
return pmt::PMT_T;
else
return pmt::PMT_F;
}
-pmt::pmt_t rpcpmtconverter::to_pmt_complex_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_complex_f::operator()(const GNURadio::Knob& knob)
+{
gr_complexd cpx(knob.value.a_complex.re, knob.value.a_complex.im);
return pmt::from_complex(cpx);
}
-pmt::pmt_t rpcpmtconverter::to_pmt_f32vect_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_f32vect_f::operator()(const GNURadio::Knob& knob)
+{
std::vector<double> v_double = knob.value.a_f32vector;
std::vector<float> v(v_double.begin(), v_double.end());
return pmt::init_f32vector(v.size(), v);
}
-pmt::pmt_t rpcpmtconverter::to_pmt_f64vect_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_f64vect_f::operator()(const GNURadio::Knob& knob)
+{
std::vector<double> v = knob.value.a_f64vector;
return pmt::init_f64vector(v.size(), v);
}
-pmt::pmt_t rpcpmtconverter::to_pmt_s64vect_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_s64vect_f::operator()(const GNURadio::Knob& knob)
+{
std::vector<int64_t> v = knob.value.a_s64vector;
return pmt::init_s64vector(v.size(), v);
}
-pmt::pmt_t rpcpmtconverter::to_pmt_s32vect_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_s32vect_f::operator()(const GNURadio::Knob& knob)
+{
std::vector<int32_t> v = knob.value.a_s32vector;
return pmt::init_s32vector(v.size(), v);
}
-pmt::pmt_t rpcpmtconverter::to_pmt_s16vect_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_s16vect_f::operator()(const GNURadio::Knob& knob)
+{
std::vector<int16_t> v = knob.value.a_s16vector;
return pmt::init_s16vector(v.size(), v);
}
-pmt::pmt_t rpcpmtconverter::to_pmt_s8vect_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_s8vect_f::operator()(const GNURadio::Knob& knob)
+{
std::basic_string<char> v = knob.value.a_s8vector;
return pmt::init_s8vector(v.size(), reinterpret_cast<const int8_t*>(v.data()));
}
-pmt::pmt_t rpcpmtconverter::to_pmt_c32vect_f::operator()(const GNURadio::Knob& knob) {
+pmt::pmt_t
+rpcpmtconverter::to_pmt_c32vect_f::operator()(const GNURadio::Knob& knob)
+{
std::vector<GNURadio::complex> v0 = knob.value.a_c32vector;
std::vector<GNURadio::complex>::iterator vitr;
std::vector<gr_complex> v;
@@ -220,26 +250,42 @@ pmt::pmt_t rpcpmtconverter::to_pmt_c32vect_f::operator()(const GNURadio::Knob& k
rpcpmtconverter::To_PMT rpcpmtconverter::To_PMT::instance;
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_bool_f> reg_bool(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::BOOL);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_byte_f> reg_byte(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::BYTE);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_short_f> reg_short(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::SHORT);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_int_f> reg_int(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::INT);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_long_f> reg_long(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::LONG);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_double_f> reg_double(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::DOUBLE);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_string_f> reg_string(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::STRING);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_complex_f> reg_complex(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::COMPLEX);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_f32vect_f> reg_f32v(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::F32VECTOR);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_f64vect_f> reg_f64v(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::F64VECTOR);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_s64vect_f> reg_s64v(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::S64VECTOR);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_s32vect_f> reg_s32v(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::S32VECTOR);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_s16vect_f> reg_s16v(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::S16VECTOR);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_s8vect_f> reg_s8v(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::S8VECTOR);
-rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_c32vect_f> reg_c32v(rpcpmtconverter::To_PMT::instance, GNURadio::BaseTypes::C32VECTOR);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_bool_f> reg_bool(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::BOOL);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_byte_f> reg_byte(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::BYTE);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_short_f> reg_short(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::SHORT);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_int_f> reg_int(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::INT);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_long_f> reg_long(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::LONG);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_double_f> reg_double(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::DOUBLE);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_string_f> reg_string(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::STRING);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_complex_f> reg_complex(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::COMPLEX);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_f32vect_f> reg_f32v(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::F32VECTOR);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_f64vect_f> reg_f64v(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::F64VECTOR);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_s64vect_f> reg_s64v(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::S64VECTOR);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_s32vect_f> reg_s32v(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::S32VECTOR);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_s16vect_f> reg_s16v(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::S16VECTOR);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_s8vect_f> reg_s8v(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::S8VECTOR);
+rpcpmtconverter::to_pmt_reg<rpcpmtconverter::to_pmt_c32vect_f> reg_c32v(rpcpmtconverter::To_PMT::instance,
+ GNURadio::BaseTypes::C32VECTOR);
template<typename TO_PMT_F>
-rpcpmtconverter::to_pmt_reg<TO_PMT_F>::to_pmt_reg(To_PMT& instance, const GNURadio::BaseTypes::type type)
+rpcpmtconverter::to_pmt_reg<TO_PMT_F>::to_pmt_reg(To_PMT& instance,
+ const GNURadio::BaseTypes::type type)
{
- boost::assign::ptr_map_insert<TO_PMT_F>(instance.to_pmt_map)(type);
+ boost::assign::ptr_map_insert<TO_PMT_F>(instance.to_pmt_map)(type);
}
pmt::pmt_t
@@ -253,5 +299,5 @@ rpcpmtconverter::to_pmt_f::operator()(const GNURadio::Knob& knob)
pmt::pmt_t
rpcpmtconverter::To_PMT::operator()(const GNURadio::Knob& knob)
{
- return to_pmt_map[knob.type](knob);
+ return to_pmt_map[knob.type](knob);
}
diff --git a/gnuradio-runtime/lib/controlport/thrift/rpcserver_thrift.cc b/gnuradio-runtime/lib/controlport/thrift/rpcserver_thrift.cc
index 5dbfb8d088..bc878a8e1a 100644
--- a/gnuradio-runtime/lib/controlport/thrift/rpcserver_thrift.cc
+++ b/gnuradio-runtime/lib/controlport/thrift/rpcserver_thrift.cc
@@ -1,6 +1,6 @@
/* -*- c++ -*- */
/*
- * Copyright 2014 Free Software Foundation, Inc.
+ * Copyright 2014,2015 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
@@ -46,14 +46,15 @@ rpcserver_thrift::~rpcserver_thrift()
}
void
-rpcserver_thrift::registerConfigureCallback(const std::string &id, const configureCallback_t callback)
+rpcserver_thrift::registerConfigureCallback(const std::string &id,
+ const configureCallback_t callback)
{
{
ConfigureCallbackMap_t::const_iterator iter(d_setcallbackmap.find(id));
if(iter != d_setcallbackmap.end()) {
std::stringstream s;
s << "rpcserver_thrift:: rpcserver_thrift ERROR registering set, already registered: "
- << id << std::endl;
+ << id << std::endl;
throw std::runtime_error(s.str().c_str());
}
}
@@ -71,7 +72,7 @@ rpcserver_thrift::unregisterConfigureCallback(const std::string &id)
if(iter == d_setcallbackmap.end()) {
std::stringstream s;
s << "rpcserver_thrift:: rpcserver_thrift ERROR unregistering set, not registered: "
- << id << std::endl;
+ << id << std::endl;
throw std::runtime_error(s.str().c_str());
}
@@ -90,7 +91,7 @@ rpcserver_thrift::registerQueryCallback(const std::string &id,
if(iter != d_getcallbackmap.end()) {
std::stringstream s;
s << "rpcserver_thrift:: rpcserver_thrift ERROR registering get, already registered: "
- << id << std::endl;
+ << id << std::endl;
throw std::runtime_error(s.str().c_str());
}
}
@@ -108,7 +109,7 @@ rpcserver_thrift::unregisterQueryCallback(const std::string &id)
if(iter == d_getcallbackmap.end()) {
std::stringstream s;
s << "rpcserver_thrift:: rpcserver_thrift ERROR unregistering get, registered: "
- << id << std::endl;
+ << id << std::endl;
throw std::runtime_error(s.str().c_str());
}
@@ -129,19 +130,20 @@ rpcserver_thrift::setKnobs(const GNURadio::KnobMap& knobs)
void
-rpcserver_thrift::getKnobs(GNURadio::KnobMap& _return, const GNURadio::KnobIDList& knobs)
+rpcserver_thrift::getKnobs(GNURadio::KnobMap& _return,
+ const GNURadio::KnobIDList& knobs)
{
GNURadio::KnobMap outknobs;
if(knobs.size() == 0) {
std::for_each(d_getcallbackmap.begin(), d_getcallbackmap.end(),
- get_all_f<QueryCallbackMap_t::value_type, QueryCallbackMap_t, GNURadio::KnobMap>
- (d_getcallbackmap, cur_priv, outknobs));
+ get_all_f<QueryCallbackMap_t::value_type, QueryCallbackMap_t, GNURadio::KnobMap>
+ (d_getcallbackmap, cur_priv, outknobs));
}
else {
std::for_each(knobs.begin(), knobs.end(),
- get_f<GNURadio::KnobIDList::value_type, QueryCallbackMap_t>
- (d_getcallbackmap, cur_priv, outknobs));
+ get_f<GNURadio::KnobIDList::value_type, QueryCallbackMap_t>
+ (d_getcallbackmap, cur_priv, outknobs));
}
_return = outknobs;
}
@@ -159,9 +161,9 @@ rpcserver_thrift::getRe(GNURadio::KnobMap& _return, const GNURadio::KnobIDList&
else {
QueryCallbackMap_t::iterator it;
for(it = d_getcallbackmap.begin(); it != d_getcallbackmap.end(); it++){
- for(size_t j=0; j<knobs.size(); j++){
+ for(size_t j=0; j<knobs.size(); j++) {
const boost::xpressive::sregex re(boost::xpressive::sregex::compile(knobs[j]));
- if(boost::xpressive::regex_match(it->first, re)){
+ if(boost::xpressive::regex_match(it->first, re)) {
get_f<GNURadio::KnobIDList::value_type, QueryCallbackMap_t>
(d_getcallbackmap, cur_priv, outknobs)(it->first);
break;
@@ -173,19 +175,22 @@ rpcserver_thrift::getRe(GNURadio::KnobMap& _return, const GNURadio::KnobIDList&
}
void
-rpcserver_thrift::properties(GNURadio::KnobPropMap& _return, const GNURadio::KnobIDList& knobs)
+rpcserver_thrift::properties(GNURadio::KnobPropMap& _return,
+ const GNURadio::KnobIDList& knobs)
{
GNURadio::KnobPropMap outknobs;
if(knobs.size() == 0) {
std::for_each(d_getcallbackmap.begin(), d_getcallbackmap.end(),
- properties_all_f<QueryCallbackMap_t::value_type,
- QueryCallbackMap_t, GNURadio::KnobPropMap>(d_getcallbackmap, cur_priv, outknobs));
+ properties_all_f<QueryCallbackMap_t::value_type,
+ QueryCallbackMap_t, GNURadio::KnobPropMap>(d_getcallbackmap,
+ cur_priv, outknobs));
}
else {
std::for_each(knobs.begin(), knobs.end(),
- properties_f<GNURadio::KnobIDList::value_type,
- QueryCallbackMap_t, GNURadio::KnobPropMap>(d_getcallbackmap, cur_priv, outknobs));
+ properties_f<GNURadio::KnobIDList::value_type,
+ QueryCallbackMap_t, GNURadio::KnobPropMap>(d_getcallbackmap,
+ cur_priv, outknobs));
}
_return = outknobs;
}