48 #ifndef _MIRA_TESTS_ONESLOTREADWRITETEST_H_ 49 #define _MIRA_TESTS_ONESLOTREADWRITETEST_H_ 64 template <
typename ChannelType>
67 auto tname = typeName<ChannelType>();
68 Authority authority(
"/"+tname,
"Authority");
70 auto channel = authority.publishAndSubscribe<ChannelType>(
"Channel");
73 MIRA_FW.getChannelManager().setMaxSlots(
"/"+tname+
"/Channel", 1);
76 channel.post(ChannelType{});
83 boost::thread writeThread(boost::bind(&writeChannel<ChannelType>, channel));
90 if (writeThread.joinable()) {
96 auto channelv = authority.subscribe<
void>(
"Channel");
99 boost::thread writeThread(boost::bind(&writeChannel<ChannelType>, channel));
void finish()
Releases the lock explicitly.
Definition: ChannelReadWrite.h:601
std::size_t getMaxSlots() const
Returns the upper limit of slots that are allowed for this channel.
Definition: Channel.h:556
An exception that occurs whenever a channel has no data.
Definition: Channel.h:88
specialize cv::DataType for our ImgPixel and inherit from cv::DataType<Vec>
Definition: IOService.h:67
An object that allows exclusive write access to data of a channel.
Definition: ChannelReadWrite.h:652
#define MIRA_FW
Macro for accessing the framework instance.
Definition: Framework.h:74
void writeChannel(Channel< T > &channel)
Definition: OneSlotReadWriteTest.h:56
An object that allows read access to data of a channel.
Definition: ChannelReadWrite.h:494
sec_type seconds() const
Returns normalized number of seconds (0..59)
Definition: Time.h:280
Authorities act as a facade to the framework.
Definition: Authority.h:94
void testReadWriteLocking(bool expect=true)
Definition: OneSlotReadWriteTest.h:65
ChannelWrite< T > write()
Obtains exclusive write access to the next free data slot of this channel.
Definition: Channel.h:823
The framework that holds all manager classes and provides startup and shutdown of all framework relat...