X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdata%2Fanalog.cpp;h=217cdfd742b3e4c84557f87178aee195ba82d5f4;hp=eb25629fe68fa0f5f94d165ca6f5d7a0a66e222e;hb=efdec55aec1a137460fa362a381ed1904182bfed;hpb=8dbbc7f0b9ea59d0f0d62225772f8a56eee125f5 diff --git a/pv/data/analog.cpp b/pv/data/analog.cpp index eb25629f..217cdfd7 100644 --- a/pv/data/analog.cpp +++ b/pv/data/analog.cpp @@ -14,18 +14,18 @@ * 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 . */ #include -#include "analog.h" -#include "analogsnapshot.h" +#include "analog.hpp" +#include "analogsegment.hpp" using std::deque; using std::max; using std::shared_ptr; +using std::vector; namespace pv { namespace data { @@ -35,25 +35,31 @@ Analog::Analog() : { } -void Analog::push_snapshot(shared_ptr &snapshot) +void Analog::push_segment(shared_ptr &segment) { - snapshots_.push_front(snapshot); + segments_.push_front(segment); } -deque< shared_ptr >& Analog::get_snapshots() +const deque< shared_ptr >& Analog::analog_segments() const { - return snapshots_; + return segments_; +} + +vector< shared_ptr > Analog::segments() const +{ + return vector< shared_ptr >( + segments_.begin(), segments_.end()); } void Analog::clear() { - snapshots_.clear(); + segments_.clear(); } -uint64_t Analog::get_max_sample_count() const +uint64_t Analog::max_sample_count() const { uint64_t l = 0; - for (const std::shared_ptr s : snapshots_) { + for (const std::shared_ptr s : segments_) { assert(s); l = max(l, s->get_sample_count()); }