Skip to content

Commit

Permalink
runtime: controlport: Modernize and use override, rec'd by clang-tidy
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Volz <ryan.volz@gmail.com>
  • Loading branch information
ryanvolz committed Sep 19, 2023
1 parent e1bf731 commit f490e1a
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 36 deletions.
30 changes: 15 additions & 15 deletions gnuradio-runtime/include/gnuradio/rpcpmtconverters_thrift.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,49 +25,49 @@ struct to_pmt_f {
};

struct to_pmt_byte_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_short_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_int_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_long_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_double_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_string_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_bool_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_complex_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_f32vect_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_f64vect_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_s64vect_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_s32vect_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_s16vect_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_s8vect_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};
struct to_pmt_c32vect_f : public to_pmt_f {
pmt::pmt_t operator()(const GNURadio::Knob& knob);
pmt::pmt_t operator()(const GNURadio::Knob& knob) override;
};

class To_PMT
Expand Down
8 changes: 4 additions & 4 deletions gnuradio-runtime/include/gnuradio/rpcserver_booter_thrift.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class rpcserver_booter_thrift
{
public:
rpcserver_booter_thrift();
~rpcserver_booter_thrift();
~rpcserver_booter_thrift() override;

rpcserver_base* i();
const std::string& type() { return d_type; }
const std::vector<std::string> endpoints();
rpcserver_base* i() override;
const std::string& type() override { return d_type; }
const std::vector<std::string> endpoints() override;

private:
std::string d_type;
Expand Down
28 changes: 15 additions & 13 deletions gnuradio-runtime/include/gnuradio/rpcserver_thrift.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,24 @@ class rpcserver_thrift : public virtual rpcserver_base, public GNURadio::Control
{
public:
rpcserver_thrift();
virtual ~rpcserver_thrift();
~rpcserver_thrift() override;

void registerConfigureCallback(const std::string& id,
const configureCallback_t callback);
void unregisterConfigureCallback(const std::string& id);
const configureCallback_t callback) override;
void unregisterConfigureCallback(const std::string& id) override;

void registerQueryCallback(const std::string& id, const queryCallback_t callback);
void unregisterQueryCallback(const std::string& id);
void registerQueryCallback(const std::string& id,
const queryCallback_t callback) override;
void unregisterQueryCallback(const std::string& id) override;

void registerHandlerCallback(const std::string& id, const handlerCallback_t callback);
void unregisterHandlerCallback(const std::string& id);
void registerHandlerCallback(const std::string& id,
const handlerCallback_t callback) override;
void unregisterHandlerCallback(const std::string& id) override;

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 setKnobs(const GNURadio::KnobMap&) override;
void getKnobs(GNURadio::KnobMap&, const GNURadio::KnobIDList&) override;
void getRe(GNURadio::KnobMap&, const GNURadio::KnobIDList&) override;
void properties(GNURadio::KnobPropMap&, const GNURadio::KnobIDList& knobs) override;

/*!
* \brief Call this to post a message to the \p port for the block
Expand Down Expand Up @@ -72,9 +74,9 @@ class rpcserver_thrift : public virtual rpcserver_base, public GNURadio::Control
*/
void postMessage(const std::string& alias,
const std::string& port,
const std::string& msg);
const std::string& msg) override;

virtual void shutdown();
void shutdown() override;

private:
static gr::logger_ptr d_logger;
Expand Down
8 changes: 4 additions & 4 deletions gnuradio-runtime/include/gnuradio/thrift_server_template.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class thrift_server_template : public thrift_application_base<TserverBase, TImpl
~thrift_server_template();

protected:
TserverBase* i_impl();
TserverBase* i_impl() override;
friend class thrift_application_base<TserverBase, TImplClass>;

private:
Expand All @@ -62,10 +62,10 @@ class thrift_server_template : public thrift_application_base<TserverBase, TImpl
;
}

virtual ~TBufferedTransportFactory() {}
~TBufferedTransportFactory() override {}

virtual std::shared_ptr<thrift::transport::TTransport>
getTransport(std::shared_ptr<thrift::transport::TTransport> trans)
std::shared_ptr<thrift::transport::TTransport>
getTransport(std::shared_ptr<thrift::transport::TTransport> trans) override
{
return std::shared_ptr<thrift::transport::TTransport>(
new thrift::transport::TBufferedTransport(trans, bufferSize));
Expand Down

0 comments on commit f490e1a

Please sign in to comment.