projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Provide notifiers for when signal data changes
[pulseview.git]
/
pv
/
data
/
analog.cpp
diff --git
a/pv/data/analog.cpp
b/pv/data/analog.cpp
index dd4097a8d2a7cea131e7d3eea6912a4caead690e..1a2449891d9d8b86922c6b6efb6350d8b14db70d 100644
(file)
--- a/
pv/data/analog.cpp
+++ b/
pv/data/analog.cpp
@@
-14,17
+14,18
@@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* 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/foreach.hpp
>
+#include <
cassert
>
-#include "analog.h"
-#include "analogs
napshot.h
"
+#include "analog.h
pp
"
+#include "analogs
egment.hpp
"
-using namespace boost;
-using namespace std;
+using std::deque;
+using std::max;
+using std::shared_ptr;
+using std::vector;
namespace pv {
namespace data {
namespace pv {
namespace data {
@@
-34,30
+35,44
@@
Analog::Analog() :
{
}
{
}
-void Analog::push_s
napshot(shared_ptr<AnalogSnapshot> &snapsho
t)
+void Analog::push_s
egment(shared_ptr<AnalogSegment> &segmen
t)
{
{
-
_snapshots.push_front(snapsho
t);
+
segments_.push_front(segmen
t);
}
}
-deque< shared_ptr<AnalogSnapshot> >& Analog::get_snapshots()
+const deque< shared_ptr<AnalogSegment> >& Analog::analog_segments() const
{
{
- return _snapshots;
+ return segments_;
+}
+
+vector< shared_ptr<Segment> > Analog::segments() const
+{
+ return vector< shared_ptr<Segment> >(
+ segments_.begin(), segments_.end());
}
void Analog::clear()
{
}
void Analog::clear()
{
- _snapshots.clear();
+ segments_.clear();
+
+ samples_cleared();
}
}
-uint64_t Analog::
get_
max_sample_count() const
+uint64_t Analog::max_sample_count() const
{
uint64_t l = 0;
{
uint64_t l = 0;
-
BOOST_FOREACH(const boost::shared_ptr<AnalogSnapshot> s, _snapshots
) {
+
for (const std::shared_ptr<AnalogSegment> s : segments_
) {
assert(s);
l = max(l, s->get_sample_count());
}
return l;
}
assert(s);
l = max(l, s->get_sample_count());
}
return l;
}
+void Analog::notify_samples_added(QObject* segment, uint64_t start_sample,
+ uint64_t end_sample)
+{
+ samples_added(segment, start_sample, end_sample);
+}
+
} // namespace data
} // namespace pv
} // namespace data
} // namespace pv