]> sigrok.org Git - pulseview.git/blobdiff - pv/devices/hardwaredevice.cpp
Remove unused "using" declarations.
[pulseview.git] / pv / devices / hardwaredevice.cpp
index d1161aa26669a614bc36fc52e4871bdc1fb68496..ff52f817327d6d0d5790c91675e764d1d6091212 100644 (file)
@@ -14,8 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
 #include <boost/algorithm/string/join.hpp>
@@ -28,7 +27,6 @@
 
 #include "hardwaredevice.hpp"
 
-using std::dynamic_pointer_cast;
 using std::shared_ptr;
 using std::static_pointer_cast;
 using std::string;
@@ -41,18 +39,21 @@ using sigrok::HardwareDevice;
 namespace pv {
 namespace devices {
 
-HardwareDevice::HardwareDevice(const std::shared_ptr<sigrok::Context> &context,
-       std::shared_ptr<sigrok::HardwareDevice> device) :
+HardwareDevice::HardwareDevice(const shared_ptr<sigrok::Context> &context,
+       shared_ptr<sigrok::HardwareDevice> device) :
        context_(context),
-       device_open_(false) {
+       device_open_(false)
+{
        device_ = device;
 }
 
-HardwareDevice::~HardwareDevice() {
+HardwareDevice::~HardwareDevice()
+{
        close();
 }
 
-string HardwareDevice::full_name() const {
+string HardwareDevice::full_name() const
+{
        vector<string> parts = {device_->vendor(), device_->model(),
                device_->version(), device_->serial_number()};
        if (device_->connection_id().length() > 0)
@@ -60,12 +61,14 @@ string HardwareDevice::full_name() const {
        return join(parts, " ");
 }
 
-shared_ptr<sigrok::HardwareDevice> HardwareDevice::hardware_device() const {
+shared_ptr<sigrok::HardwareDevice> HardwareDevice::hardware_device() const
+{
        return static_pointer_cast<sigrok::HardwareDevice>(device_);
 }
 
 string HardwareDevice::display_name(
-       const DeviceManager &device_manager) const {
+       const DeviceManager &device_manager) const
+{
        const auto hw_dev = hardware_device();
 
        // If we can find another device with the same model/vendor then
@@ -95,13 +98,14 @@ string HardwareDevice::display_name(
        return join(parts, " ");
 }
 
-void HardwareDevice::open() {
+void HardwareDevice::open()
+{
        if (device_open_)
                close();
 
        try {
                device_->open();
-       } catch(const sigrok::Error &e) {
+       } catch (const sigrok::Error &e) {
                throw QString(e.what());
        }
 
@@ -112,7 +116,8 @@ void HardwareDevice::open() {
        session_->add_device(device_);
 }
 
-void HardwareDevice::close() {
+void HardwareDevice::close()
+{
        if (device_open_)
                device_->close();