Replaced boost::shared_ptr with std::shared_ptr
[pulseview.git] / pv / prop / binding / decoderoptions.cpp
index d9904852ca645e21f6b4b4d447a200860e301d94..0e44386eafa546781244af06bdfe33d004b4e770 100644 (file)
 #include "decoderoptions.h"
 
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 #include <boost/none_t.hpp>
 
 #include <pv/data/decoderstack.h>
 #include <pv/data/decode/decoder.h>
+#include <pv/prop/double.h>
 #include <pv/prop/enum.h>
 #include <pv/prop/int.h>
 #include <pv/prop/string.h>
 
 using boost::bind;
 using boost::none;
-using boost::shared_ptr;
 using std::make_pair;
 using std::map;
 using std::pair;
+using std::shared_ptr;
 using std::string;
 using std::vector;
 
@@ -72,6 +72,9 @@ DecoderOptions::DecoderOptions(
 
                if (opt->values)
                        prop = bind_enum(name, opt, getter, setter);
+               else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("d")))
+                       prop = shared_ptr<Property>(new Double(name, 2, "",
+                               none, none, getter, setter));
                else if (g_variant_is_of_type(opt->def, G_VARIANT_TYPE("x")))
                        prop = shared_ptr<Property>(
                                new Int(name, "", none, getter, setter));
@@ -107,7 +110,7 @@ GVariant* DecoderOptions::getter(const char *id)
 
        // Get the value from the hash table if it is already present
        const map<string, GVariant*>& options = _decoder->options();
-       map<string, GVariant*>::const_iterator iter = options.find(id);
+       const auto iter = options.find(id);
 
        if (iter != options.end())
                val = (*iter).second;