47 #ifndef _MIRA_CHANNELREADINTERVAL_H_ 48 #define _MIRA_CHANNELREADINTERVAL_H_ 51 #include <boost/shared_ptr.hpp> 77 typedef typename ChannelType::Buffer Buffer;
78 typedef typename ChannelType::ValueType ValueType;
79 typedef typename ChannelType::Slot Slot;
99 const_iterator(
const typename IntervalList::const_iterator& i) : mIterator(i) {}
110 #if (__cplusplus >= 200710) 111 explicit operator typename IntervalList::const_iterator()
const {
return mIterator; }
114 operator typename IntervalList::const_iterator()
const {
return mIterator; }
148 return mIterator==other.mIterator;
151 return mIterator!=other.mIterator;
156 typename IntervalList::const_iterator mIterator;
168 std::size_t
size()
const {
return mInterval.size(); }
169 bool empty()
const {
return mInterval.empty(); }
178 std::list<ChannelBufferBase::Slot*>& slotList) :
183 for(
auto it=slotList.begin(); it!=slotList.end(); ++it)
185 Slot* s = Buffer::castSlot(*it);
204 static std::string emptyString;
205 return mChannel!=NULL ? mChannel->getID() : emptyString;
209 return mChannel!=NULL ? mChannel->getTypename() :
"";
213 return mChannel!=NULL ? mChannel->getTypeMeta() :
TypeMetaPtr();
223 void checkValid()
const {
225 MIRA_THROW(XAccessViolation,
"Trying to access ChannelReadInterval" 226 " that was not assigned with valid data");
229 ChannelTypePtr mChannel;
An object that allows read access to a whole interval of channel data.
Definition: ChannelReadInterval.h:72
bool empty() const
Definition: ChannelReadInterval.h:169
Channel< T > getChannel()
Returns a read-only channel proxy object of the underlying channel.
const_iterator operator--(int)
Definition: ChannelReadInterval.h:139
ChannelReadInterval()
Constructs an empty interval.
Definition: ChannelReadInterval.h:174
An exception that occurs whenever a channel has no data.
Definition: Channel.h:88
reference operator*() const
Definition: ChannelReadInterval.h:120
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
std::list< ChannelRead< T > > IntervalList
Definition: ChannelReadInterval.h:82
const std::string & getChannelID()
Definition: ChannelReadInterval.h:203
const ValueType * pointer
Definition: ChannelReadInterval.h:93
pointer operator->() const
Definition: ChannelReadInterval.h:121
Definition: ChannelReadWrite.h:65
An object that allows read access to data of a channel.
Definition: ChannelReadWrite.h:440
const ValueType & reference
Definition: ChannelReadInterval.h:94
#define MIRA_THROW(ex, msg)
Macro for throwing an exception.
Definition: Exception.h:82
const_iterator end() const
Definition: ChannelReadInterval.h:164
const_iterator begin() const
Definition: ChannelReadInterval.h:163
Classes for automatic locking/unlocking when reading and writing to channels.
const_iterator & operator--()
Definition: ChannelReadInterval.h:134
const_iterator(const const_iterator &other)
Definition: ChannelReadInterval.h:103
void finish()
Definition: ChannelReadInterval.h:198
std::bidirectional_iterator_tag iterator_category
Definition: ChannelReadInterval.h:91
Const iterator for iterating over the interval.
Definition: ChannelReadInterval.h:85
bool operator==(const const_iterator &other) const
Definition: ChannelReadInterval.h:147
ValueType value_type
Definition: ChannelReadInterval.h:92
boost::shared_ptr< TypeMeta > TypeMetaPtr
Definition: MetaSerializer.h:309
const_iterator operator++(int)
Definition: ChannelReadInterval.h:128
const_iterator iterator
Definition: ChannelReadInterval.h:159
bool operator!=(const const_iterator &other) const
Definition: ChannelReadInterval.h:150
ptrdiff_t difference_type
Definition: ChannelReadInterval.h:90
TypeMetaPtr getTypeMeta() const
Definition: ChannelReadInterval.h:212
std::size_t size() const
Definition: ChannelReadInterval.h:168
const_iterator & operator++()
Definition: ChannelReadInterval.h:123
ChannelReadInterval(ChannelTypePtr channel, std::list< ChannelBufferBase::Slot *> &slotList)
Constructs an interval on channel with given range.
Definition: ChannelReadInterval.h:177
std::string getTypename() const
Definition: ChannelReadInterval.h:208