aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2014-04-16 21:07:10 +0200
committerMatthias P. Braendli <matthias.braendli@mpb.li>2014-04-16 21:07:10 +0200
commit307996c7ebfd03186a8044cc69b764b71c51e79e (patch)
treed5b2071124be1e59d14e351c4ba6e3834284e612 /src
parent28b152d40742481d8eae0108afd4e6bf7a17eb2a (diff)
downloaddabmod-307996c7ebfd03186a8044cc69b764b71c51e79e.tar.gz
dabmod-307996c7ebfd03186a8044cc69b764b71c51e79e.tar.bz2
dabmod-307996c7ebfd03186a8044cc69b764b71c51e79e.zip
remove using directives from .h files
Diffstat (limited to 'src')
-rw-r--r--src/DabMod.cpp2
-rw-r--r--src/FIRFilter.cpp1
-rw-r--r--src/FIRFilter.h7
-rw-r--r--src/OutputUHD.cpp3
-rw-r--r--src/OutputUHD.h12
-rw-r--r--src/RemoteControl.cpp1
-rw-r--r--src/RemoteControl.h58
7 files changed, 44 insertions, 40 deletions
diff --git a/src/DabMod.cpp b/src/DabMod.cpp
index 92da99a..76c2068 100644
--- a/src/DabMod.cpp
+++ b/src/DabMod.cpp
@@ -517,7 +517,7 @@ int main(int argc, char* argv[])
outputuhd_conf.pps_src = pt.get("uhdoutput.pps_source", "int");
outputuhd_conf.pps_polarity = pt.get("uhdoutput.pps_polarity", "pos");
- string behave = pt.get("uhdoutput.behaviour_refclk_lock_lost", "ignore");
+ std::string behave = pt.get("uhdoutput.behaviour_refclk_lock_lost", "ignore");
if (behave == "crash") {
outputuhd_conf.refclk_lock_loss_behaviour = CRASH;
diff --git a/src/FIRFilter.cpp b/src/FIRFilter.cpp
index f9ad31d..805c6d2 100644
--- a/src/FIRFilter.cpp
+++ b/src/FIRFilter.cpp
@@ -44,6 +44,7 @@
# endif
#endif
+using namespace std;
#include <sys/time.h>
diff --git a/src/FIRFilter.h b/src/FIRFilter.h
index 59e954d..0ecae3e 100644
--- a/src/FIRFilter.h
+++ b/src/FIRFilter.h
@@ -108,8 +108,11 @@ public:
const char* name() { return "FIRFilter"; }
/******* REMOTE CONTROL ********/
- virtual void set_parameter(const string& parameter, const string& value);
- virtual const string get_parameter(const string& parameter) const;
+ virtual void set_parameter(const std::string& parameter,
+ const std::string& value);
+
+ virtual const std::string get_parameter(
+ const std::string& parameter) const;
protected:
diff --git a/src/OutputUHD.cpp b/src/OutputUHD.cpp
index 62708f1..b0600cd 100644
--- a/src/OutputUHD.cpp
+++ b/src/OutputUHD.cpp
@@ -38,6 +38,9 @@
#include <errno.h>
#include <unistd.h>
+using namespace boost;
+using namespace std;
+
typedef std::complex<float> complexf;
OutputUHD::OutputUHD(
diff --git a/src/OutputUHD.h b/src/OutputUHD.h
index 530a30a..990822e 100644
--- a/src/OutputUHD.h
+++ b/src/OutputUHD.h
@@ -71,8 +71,6 @@ DESCRIPTION:
typedef std::complex<float> complexf;
-using namespace boost;
-
struct UHDWorkerFrameData {
// Buffer holding frame data
void* buf;
@@ -112,7 +110,7 @@ struct UHDWorkerData {
bool muting;
// A barrier to synchronise the two threads
- shared_ptr<barrier> sync_barrier;
+ boost::shared_ptr<boost::barrier> sync_barrier;
// What to do when the reference clock PLL loses lock
refclk_lock_loss_behaviour_t refclk_lock_loss_behaviour;
@@ -197,10 +195,12 @@ class OutputUHD: public ModOutput, public RemoteControllable {
*/
/* Base function to set parameters. */
- virtual void set_parameter(const string& parameter, const string& value);
+ virtual void set_parameter(const std::string& parameter,
+ const std::string& value);
/* Getting a parameter always returns a string. */
- virtual const string get_parameter(const string& parameter) const;
+ virtual const std::string get_parameter(
+ const std::string& parameter) const;
protected:
@@ -208,7 +208,7 @@ class OutputUHD: public ModOutput, public RemoteControllable {
EtiReader *myEtiReader;
OutputUHDConfig myConf;
uhd::usrp::multi_usrp::sptr myUsrp;
- shared_ptr<barrier> mySyncBarrier;
+ boost::shared_ptr<boost::barrier> mySyncBarrier;
UHDWorker worker;
bool first_run;
struct UHDWorkerData uwd;
diff --git a/src/RemoteControl.cpp b/src/RemoteControl.cpp
index 03cef2c..b3fdfec 100644
--- a/src/RemoteControl.cpp
+++ b/src/RemoteControl.cpp
@@ -32,6 +32,7 @@
#include "RemoteControl.h"
using boost::asio::ip::tcp;
+using namespace std;
void RemoteControllerTelnet::restart()
diff --git a/src/RemoteControl.h b/src/RemoteControl.h
index dd31fc2..ede727b 100644
--- a/src/RemoteControl.h
+++ b/src/RemoteControl.h
@@ -32,7 +32,6 @@
#include <map>
#include <string>
#include <iostream>
-#include <string>
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
@@ -44,25 +43,22 @@
#define RC_ADD_PARAMETER(p, desc) { \
- vector<string> p; \
+ std::vector<std::string> p; \
p.push_back(#p); \
p.push_back(desc); \
m_parameters.push_back(p); \
}
-using namespace std;
-using boost::asio::ip::tcp;
-
class ParameterError : public std::exception
{
public:
- ParameterError(string message) : m_message(message) {}
+ ParameterError(std::string message) : m_message(message) {}
~ParameterError() throw() {};
const char* what() const throw() { return m_message.c_str(); }
private:
- string m_message;
+ std::string m_message;
};
class RemoteControllable;
@@ -90,7 +86,7 @@ class BaseRemoteController {
class RemoteControllable {
public:
- RemoteControllable(string name) : m_name(name) {}
+ RemoteControllable(std::string name) : m_name(name) {}
/* return a short name used to identify the controllable.
* It might be used in the commands the user has to type, so keep
@@ -104,9 +100,9 @@ class RemoteControllable {
}
/* Return a list of possible parameters that can be set */
- virtual list<string> get_supported_parameters() const {
- list<string> parameterlist;
- for (list< vector<string> >::const_iterator it = m_parameters.begin();
+ virtual std::list<std::string> get_supported_parameters() const {
+ std::list<std::string> parameterlist;
+ for (std::list< std::vector<std::string> >::const_iterator it = m_parameters.begin();
it != m_parameters.end(); ++it) {
parameterlist.push_back((*it)[0]);
}
@@ -120,11 +116,11 @@ class RemoteControllable {
}
/* Base function to set parameters. */
- virtual void set_parameter(const string& parameter,
- const string& value) = 0;
+ virtual void set_parameter(const std::string& parameter,
+ const std::string& value) = 0;
/* Getting a parameter always returns a string. */
- virtual const string get_parameter(const string& parameter) const = 0;
+ virtual const std::string get_parameter(const std::string& parameter) const = 0;
protected:
std::string m_name;
@@ -168,26 +164,26 @@ class RemoteControllerTelnet : public BaseRemoteController {
void process(long);
- void dispatch_command(tcp::socket& socket, string command);
+ void dispatch_command(boost::asio::ip::tcp::socket& socket, std::string command);
- void reply(tcp::socket& socket, string message);
+ void reply(boost::asio::ip::tcp::socket& socket, std::string message);
RemoteControllerTelnet& operator=(const RemoteControllerTelnet& other);
RemoteControllerTelnet(const RemoteControllerTelnet& other);
- vector<string> tokenise_(string message) {
- vector<string> all_tokens;
+ std::vector<std::string> tokenise_(std::string message) {
+ std::vector<std::string> all_tokens;
boost::char_separator<char> sep(" ");
boost::tokenizer< boost::char_separator<char> > tokens(message, sep);
- BOOST_FOREACH (const string& t, tokens) {
+ BOOST_FOREACH (const std::string& t, tokens) {
all_tokens.push_back(t);
}
return all_tokens;
}
- RemoteControllable* get_controllable_(string name) {
- for (list<RemoteControllable*>::iterator it = m_cohort.begin();
+ RemoteControllable* get_controllable_(std::string name) {
+ for (std::list<RemoteControllable*>::iterator it = m_cohort.begin();
it != m_cohort.end(); ++it) {
if ((*it)->get_rc_name() == name)
{
@@ -197,24 +193,24 @@ class RemoteControllerTelnet : public BaseRemoteController {
throw ParameterError("Module name unknown");
}
- list< vector<string> > get_parameter_descriptions_(string name) {
+ std::list< std::vector<std::string> > get_parameter_descriptions_(std::string name) {
RemoteControllable* controllable = get_controllable_(name);
return controllable->get_parameter_descriptions();
}
- list<string> get_param_list_(string name) {
+ std::list<std::string> get_param_list_(std::string name) {
RemoteControllable* controllable = get_controllable_(name);
return controllable->get_supported_parameters();
}
- list< vector<string> > get_param_list_values_(string name) {
+ std::list< std::vector<std::string> > get_param_list_values_(std::string name) {
RemoteControllable* controllable = get_controllable_(name);
- list< vector<string> > allparams;
- list<string> params = controllable->get_supported_parameters();
- for (list<string>::iterator it = params.begin();
+ std::list< std::vector<std::string> > allparams;
+ std::list<std::string> params = controllable->get_supported_parameters();
+ for (std::list<std::string>::iterator it = params.begin();
it != params.end(); ++it) {
- vector<string> item;
+ std::vector<std::string> item;
item.push_back(*it);
item.push_back(controllable->get_parameter(*it));
@@ -223,12 +219,12 @@ class RemoteControllerTelnet : public BaseRemoteController {
return allparams;
}
- string get_param_(string name, string param) {
+ std::string get_param_(std::string name, std::string param) {
RemoteControllable* controllable = get_controllable_(name);
return controllable->get_parameter(param);
}
- void set_param_(string name, string param, string value) {
+ void set_param_(std::string name, std::string param, std::string value) {
RemoteControllable* controllable = get_controllable_(name);
return controllable->set_parameter(param, value);
}
@@ -242,7 +238,7 @@ class RemoteControllerTelnet : public BaseRemoteController {
boost::thread m_child_thread;
/* This controller commands the controllables in the cohort */
- list<RemoteControllable*> m_cohort;
+ std::list<RemoteControllable*> m_cohort;
std::string m_welcome;
std::string m_prompt;