24 , mNChannels{ group.NChannels() }
38 for (
size_t ii = 0, nn = group.NChannels(); ii < nn; ++ii)
39 if (group.GetChannel(ii).get() ==
this) {
56 for (
size_t ii = 0, nn = group.NChannels(); ii < nn; ++ii)
57 if (group.GetChannel(ii).get() ==
this) {
93 std::make_unique<ChannelGroupData>(*orig.
mpGroupData) :
nullptr;
103 return move(mpGroupData);
115 mpGroupData = std::make_unique<ChannelGroupData>();
129 return std::accumulate(range.first, range.second,
130 std::numeric_limits<double>::max(),
131 [](
double acc,
const auto &pInterval){
132 return std::min(acc, pInterval->Start()); });
140 return std::accumulate(range.first, range.second,
141 std::numeric_limits<double>::lowest(),
142 [](
double acc,
const auto &pInterval){
143 return std::max(acc, pInterval->End()); });
Abstract class ChannelGroup with two discrete iterable dimensions, channels and intervals; subclasses...
double GetEndTime() const
Get the maximum of End() values of intervals, or 0 when none.
double GetStartTime() const
Get the minimum of Start() values of intervals, or 0 when none.
virtual bool IsLeader() const =0
void AssignGroupData(std::unique_ptr< ChannelGroupData > pGroupData)
Replace any previous attachments.
IteratorRange< IntervalIterator< IntervalType > > Intervals()
Get range of intervals with mutative access.
std::unique_ptr< ChannelGroupData > mpGroupData
ChannelGroupData & GetGroupData()
Make attachment site on demand as needed.
std::unique_ptr< ChannelGroupData > DetachGroupData()
Move attachments out.
void Init(const ChannelGroup &other)
Copy, including cloning of attached objects.
void DestroyGroupData()
Leave all attachments null.
A start and an end time, and whatever else subclasses associate with them.
virtual ~ChannelGroupInterval()
int FindChannelIndex() const
virtual ChannelGroup & ReallyDoGetChannelGroup() const
This is temporary! It defaults to call the above.
ChannelGroup & GetChannelGroup()
Channel object's lifetime is assumed to be nested in its Track's.
virtual ChannelGroup & DoGetChannelGroup() const =0
Subclass must override.
size_t GetChannelIndex() const
size_t ReallyGetChannelIndex() const
virtual ~ChannelInterval()
~WideChannelGroupInterval() override
WideChannelGroupInterval(const ChannelGroup &group, double start, double end)
auto end(const Ptr< Type, BaseDeleter > &p)
Enables range-for.