29 #include <boost/function_types/function_type.hpp> 32 #include <rtt-config.h> 75 signalled_port = port;
81 tc =
new TaskContext(
"root", TaskContext::Stopped );
92 SimulationThread::Instance()->
stop();
119 tc->ports()->addPort( wp1 );
120 tc->ports()->addPort( rp2 );
123 tc->ports()->addPort( wp1 );
127 tc->ports()->addPort( other_rp );
129 tc->ports()->removePort( other_rp.
getName() );
135 #if __cplusplus > 199711L 136 unique_ptr<TaskContext> tc1(
new TaskContext(
"tc", TaskContext::Stopped ));
137 unique_ptr<TaskContext> tc2(
new TaskContext(
"tc2", TaskContext::Stopped ));
139 auto_ptr<TaskContext> tc1(
new TaskContext(
"tc", TaskContext::Stopped ));
140 auto_ptr<TaskContext> tc2(
new TaskContext(
"tc2", TaskContext::Stopped ));
143 tc1->ports()->addPort( rp1 );
144 tc1->ports()->addPort( wp2 );
145 tc2->ports()->addPort( rp2 );
146 tc2->ports()->addPort( wp1 );
148 BOOST_CHECK( tc1->connectPorts(tc2.get()) );
153 BOOST_CHECK( rp1.
read(value) );
154 BOOST_CHECK_EQUAL(2, value);
160 BOOST_CHECK( rp2.
read(value) );
161 BOOST_CHECK_EQUAL(3, value);
172 tc->ports()->removePort( wp1.
getName() );
173 tc->ports()->removePort( rp2.
getName() );
185 BOOST_CHECK( !rp.
read(value) );
186 BOOST_CHECK_EQUAL( value, 0 );
189 BOOST_CHECK_EQUAL( -1, value );
192 BOOST_CHECK( rp.
read(value) );
193 BOOST_CHECK_EQUAL( 10, value );
201 BOOST_CHECK_EQUAL( 10, value );
206 BOOST_CHECK( rp.
read(value) );
207 BOOST_CHECK_EQUAL( 10, value );
220 BOOST_CHECK( !rp.
read(value) );
230 BOOST_CHECK( !rp.
read(value) );
232 BOOST_CHECK( rp.
read(value) );
233 BOOST_CHECK( 1 == value );
239 BOOST_CHECK( !rp.
read(value) );
241 BOOST_CHECK( rp.
read(value) );
242 BOOST_CHECK( 1 == value );
253 BOOST_CHECK( !rp.
read(value) );
259 BOOST_CHECK( !rp.
read(value) );
261 BOOST_CHECK( !rp.
read(value) );
267 BOOST_CHECK_EQUAL(0, value);
268 BOOST_CHECK( rp.
read(value) );
269 BOOST_CHECK_EQUAL(1, value);
270 BOOST_CHECK( rp.
read(value) );
271 BOOST_CHECK_EQUAL(2, value);
277 BOOST_CHECK( rp.
read(value) );
278 BOOST_CHECK_EQUAL(10, value);
279 BOOST_CHECK( rp.
read(value) );
280 BOOST_CHECK_EQUAL(20, value);
291 BOOST_CHECK( !rp.
read(value) );
335 BOOST_CHECK( rp1.
read(value));
336 BOOST_CHECK_EQUAL(30, value);
338 BOOST_CHECK( rp2.
read(value));
339 BOOST_CHECK_EQUAL(10, value);
340 BOOST_CHECK( rp2.
read(value));
341 BOOST_CHECK_EQUAL(15, value);
342 BOOST_CHECK( rp2.
read(value));
343 BOOST_CHECK_EQUAL(20, value);
344 BOOST_CHECK( rp2.
read(value));
345 BOOST_CHECK_EQUAL(25, value);
347 BOOST_CHECK_EQUAL(25, value);
349 BOOST_CHECK( rp3.
read(value));
350 BOOST_CHECK_EQUAL(30, value);
361 BOOST_CHECK( rp1.
read(value));
362 BOOST_CHECK_EQUAL(10, value);
363 BOOST_CHECK( rp3.
read(value));
364 BOOST_CHECK_EQUAL(10, value);
410 BOOST_CHECK( rp1.
read(value));
411 BOOST_CHECK_EQUAL(10, value);
412 BOOST_CHECK( rp2.
read(value));
413 BOOST_CHECK_EQUAL(15, value);
414 BOOST_CHECK( rp3.
read(value));
415 BOOST_CHECK_EQUAL(20, value);
416 BOOST_CHECK( rp3.
read(value));
417 BOOST_CHECK_EQUAL(25, value);
420 BOOST_CHECK_EQUAL(25, value);
423 BOOST_CHECK_EQUAL(25, value);
426 BOOST_CHECK_EQUAL(25, value);
437 BOOST_CHECK( rp1.
read(value) );
438 BOOST_CHECK_EQUAL(10, value);
441 BOOST_CHECK_EQUAL(10, value);
501 BOOST_CHECK( rp.
read(value));
502 BOOST_CHECK_EQUAL(10, value);
503 BOOST_CHECK( rp.
read(value));
504 BOOST_CHECK_EQUAL(20, value);
505 BOOST_CHECK( rp.
read(value));
506 BOOST_CHECK_EQUAL(30, value);
507 BOOST_CHECK( rp.
read(value));
508 BOOST_CHECK_EQUAL(40, value);
521 BOOST_CHECK_EQUAL(60, value);
526 BOOST_CHECK_EQUAL(60, value);
582 BOOST_CHECK( rp.
read(value));
583 BOOST_CHECK_EQUAL(10, value);
584 BOOST_CHECK( rp.
read(value));
585 BOOST_CHECK_EQUAL(20, value);
586 BOOST_CHECK( rp.
read(value));
587 BOOST_CHECK_EQUAL(30, value);
588 BOOST_CHECK( rp.
read(value));
589 BOOST_CHECK_EQUAL(40, value);
600 BOOST_CHECK( rp.
read(value));
601 BOOST_CHECK_EQUAL(60, value);
604 BOOST_CHECK( rp.
read(value));
605 BOOST_CHECK_EQUAL(13, value);
606 BOOST_CHECK( rp.
read(value));
607 BOOST_CHECK_EQUAL(23, value);
612 BOOST_CHECK( rp.
read(value));
613 BOOST_CHECK_EQUAL(33, value);
614 BOOST_CHECK( rp.
read(value));
615 BOOST_CHECK_EQUAL(43, value);
619 BOOST_CHECK_EQUAL(70, value);
622 BOOST_CHECK_EQUAL(70, value);
652 BOOST_CHECK_EQUAL(11, value);
654 BOOST_CHECK_EQUAL(11, value);
658 BOOST_CHECK_EQUAL(12, value);
660 BOOST_CHECK_EQUAL(12, value);
664 BOOST_CHECK_EQUAL(21, value);
666 BOOST_CHECK_EQUAL(21, value);
670 BOOST_CHECK_EQUAL(22, value);
672 BOOST_CHECK_EQUAL(22, value);
679 BOOST_CHECK_EQUAL(31, value);
681 BOOST_CHECK_EQUAL(32, value);
683 BOOST_CHECK_EQUAL(33, value);
685 BOOST_CHECK_EQUAL(34, value);
687 BOOST_CHECK_EQUAL(34, value);
689 BOOST_CHECK_EQUAL(34, value);
714 BOOST_CHECK_EQUAL(34, value);
716 BOOST_CHECK_EQUAL(34, value);
718 BOOST_CHECK_EQUAL(34, value);
720 BOOST_CHECK_EQUAL(34, value);
722 BOOST_CHECK_EQUAL(34, value);
724 BOOST_CHECK_EQUAL(34, value);
738 BOOST_CHECK( wp1.
connectTo(&rp, cp_PerConnection) );
739 BOOST_CHECK( !wp2.
connectTo(&rp, cp_PerInputPort) );
747 BOOST_CHECK( wp1.
connectTo(&rp, cp_DATA) );
748 BOOST_CHECK( !wp2.
connectTo(&rp, cp_BUFFER) );
756 BOOST_CHECK( wp1.
connectTo(&rp, cp_LOCK_FREE) );
757 BOOST_CHECK( !wp2.
connectTo(&rp, cp_LOCKED) );
765 BOOST_CHECK( wp1.
connectTo(&rp, cp_BUFFER5) );
766 BOOST_CHECK( !wp2.
connectTo(&rp, cp_BUFFER10) );
791 tc->ports()->addPort( wp1 );
792 tc->ports()->addPort( rp1 );
795 BOOST_CHECK( tc->provides(
"Write") != 0 );
796 BOOST_CHECK( tc->provides(
"Read") != 0 );
808 mset = tc->provides(
"Write")->getOperation(
"write");
809 BOOST_CHECK( mset.
ready() );
811 mget = tc->provides(
"Read")->getOperation(
"read");
812 BOOST_CHECK( mget.ready() );
816 double get_value = 0;
817 BOOST_CHECK( mget(get_value) );
818 BOOST_CHECK_CLOSE( 3.991, get_value, 0.001 );
821 tc->ports()->removePort(
"Read");
822 BOOST_CHECK( tc->provides()->hasService(
"Read") == 0 );
823 BOOST_CHECK( tc->ports()->getPort(
"Read") == 0 );
825 tc->ports()->removePort(
"Write");
826 BOOST_CHECK( tc->provides()->hasService(
"Write") == 0 );
827 BOOST_CHECK( tc->ports()->getPort(
"Write") == 0 );
830 #ifdef ORO_SIGNALLING_PORTS 836 Handle hl( rp1.getNewDataOnPortEvent()->setup(
843 BOOST_CHECK(&rp1 == signalled_port);
849 BOOST_CHECK(&rp1 == signalled_port);
852 BOOST_CHECK(&rp1 == signalled_port);
855 BOOST_CHECK(0 == signalled_port);
867 tc.addEventPort( *ep1 );
876 tc.ports()->removePort(
"Write");
877 tc.ports()->removePort(
"Read");
878 tc.ports()->removePort(
"ERead");
898 tc.addEventPort( *ep1 );
907 tc.ports()->removePort(
"Write");
908 tc.ports()->removePort(
"Read");
909 tc.ports()->removePort(
"ERead");
926 BOOST_REQUIRE(tce->configure());
927 BOOST_REQUIRE(tce->isConfigured());
929 BOOST_REQUIRE(slsim->isActive());
937 BOOST_CHECK( slsim->execute() );
942 BOOST_CHECK(&rp1 == signalled_port);
943 BOOST_CHECK(tce->had_event);
951 BOOST_CHECK(&rp1 == signalled_port);
952 BOOST_CHECK(tce->had_event);
956 BOOST_CHECK(&rp1 == signalled_port);
957 BOOST_CHECK(tce->had_event);
963 BOOST_CHECK( slsim->execute() );
964 BOOST_CHECK(0 == signalled_port);
965 BOOST_CHECK( !tce->had_event);
969 tce->ports()->removePort( rp1.
getName() );
987 BOOST_CHECK( slsim->execute() );
988 BOOST_CHECK(&rp1 == signalled_port);
989 BOOST_CHECK(tc3->had_event);
998 BOOST_CHECK( slsim->execute() );
999 BOOST_CHECK(&rp1 == signalled_port);
1000 BOOST_CHECK(tc3->had_event);
1005 BOOST_CHECK( slsim->execute() );
1006 BOOST_CHECK(&rp1 == signalled_port);
1007 BOOST_CHECK(tc3->had_event);
1012 BOOST_CHECK( slsim->execute() );
1013 BOOST_CHECK(0 == signalled_port);
1014 BOOST_CHECK( tc3->had_event);
1019 BOOST_CHECK( slsim->execute() );
1020 BOOST_CHECK(&rp1 == signalled_port);
1024 tc3->ports()->removePort( rp1.
getName() );
1039 BOOST_CHECK( !tce->had_event );
1045 BOOST_CHECK( !tce->had_event );
1048 tce->ports()->removePort( rp1.
getName() );
1054 #if __cplusplus > 199711L 1055 unique_ptr<InputPortInterface>
1057 auto_ptr<InputPortInterface>
1059 reader(dynamic_cast<InputPortInterface*>(wp1.
antiClone()));
1063 BOOST_CHECK(source);
1065 BOOST_CHECK(!source->evaluate());
1069 BOOST_CHECK_EQUAL(0, source->value());
1072 BOOST_CHECK(source->evaluate());
1073 BOOST_CHECK_EQUAL(10, source->value());
1074 BOOST_CHECK_EQUAL(10, source->value());
1077 BOOST_CHECK_EQUAL(20, source->get());
1080 BOOST_CHECK(!source->evaluate());
1081 BOOST_CHECK_EQUAL(0, source->get());
1082 BOOST_CHECK_EQUAL(20, source->value());
1093 template <
typename T>
1098 : port(
"writer"), sample(sample), step_counter(0), write_counter(0)
1116 template <
typename T>
1121 : port(
"reader"), step_counter(0), read_counter(0)
1124 if (port.read(sample) ==
NewData) {
1143 : connect_port(connect_port), other_port(other_port), policy(policy),
1144 step_counter(0), connect_counter(0), connect_failure_counter(0),
1145 disconnect_counter(0), disconnect_failure_counter(0), connected(false)
1149 if ((!shared_connection && connect_port.connectTo(&other_port, policy)) ||
1150 (shared_connection && connect_port.createConnection(shared_connection, policy))) {
1154 ++connect_failure_counter;
1157 if ((!shared_connection && connect_port.disconnect(&other_port)) ||
1158 (shared_connection && connect_port.getManager()->removeConnection(shared_connection.get()))) {
1160 ++disconnect_counter;
1162 ++disconnect_failure_counter;
1193 , connector(writer.port, reader.port)
1194 , another_output_port(
"another_output_port")
1195 , another_input_port(
"another_input_port")
1196 , another_output_connector(another_output_port, reader.port)
1197 , another_input_connector(another_input_port, writer.port)
1207 connector.
policy = policy;
1208 another_output_connector.
policy = policy;
1209 another_input_connector.
policy = policy;
1210 return writer.
port.connectTo(&reader.
port, policy);
1214 writer.
port.disconnect();
1215 reader.
port.disconnect();
1223 result = writer.
start() && result;
1224 result = reader.
start() && result;
1225 result = connector.
start() && result;
1226 result = another_output_connector.
start() && result;
1227 result = another_input_connector.
start() && result;
1234 result = writer.
stop() && result;
1235 result = reader.
stop() && result;
1236 result = connector.
stop() && result;
1237 result = another_output_connector.
stop() && result;
1238 result = another_input_connector.
stop() && result;
1251 BOOST_REQUIRE( connector.connected = connect(policy) );
1252 BOOST_REQUIRE( start() );
1254 BOOST_REQUIRE( stop() );
1257 BOOST_TEST_MESSAGE(
"Number of successful writes: " << writer.write_counter);
1258 BOOST_CHECK_GE( writer.write_counter, 100 );
1259 BOOST_TEST_MESSAGE(
"Number of successful reads (NewData): " << reader.read_counter);
1260 BOOST_CHECK_GE( reader.read_counter, 100 );
1261 BOOST_TEST_MESSAGE(
"Number of connects/disconnects: " 1262 << connector.connect_counter <<
"/" << connector.disconnect_counter
1263 <<
" (" << connector.connect_failure_counter <<
"/" << connector.disconnect_failure_counter <<
" failures)");
1264 BOOST_CHECK_GE( connector.connect_counter, 100 );
1265 BOOST_CHECK_EQUAL( connector.connect_failure_counter, 0 );
1266 BOOST_CHECK_EQUAL( connector.disconnect_failure_counter, 0 );
1267 BOOST_TEST_MESSAGE(
"Number of connects/disconnects from another output port: " 1268 << another_output_connector.connect_counter <<
"/" << another_output_connector.disconnect_counter
1269 <<
" (" << another_output_connector.connect_failure_counter <<
"/" << another_output_connector.disconnect_failure_counter <<
" failures)");
1270 BOOST_CHECK_GE( another_output_connector.connect_counter, 100 );
1271 BOOST_CHECK_EQUAL( another_output_connector.connect_failure_counter, 0 );
1272 BOOST_CHECK_EQUAL( another_output_connector.disconnect_failure_counter, 0 );
1273 BOOST_TEST_MESSAGE(
"Number of connects/disconnects to another input port: " 1274 << another_input_connector.connect_counter <<
"/" << another_input_connector.disconnect_counter
1275 <<
" (" << another_input_connector.connect_failure_counter <<
"/" << another_input_connector.disconnect_failure_counter <<
" failures)");
1276 BOOST_CHECK_GE( another_input_connector.connect_counter, 100 );
1277 BOOST_CHECK_EQUAL( another_input_connector.connect_failure_counter, 0 );
1278 BOOST_CHECK_EQUAL( another_input_connector.disconnect_failure_counter, 0 );
1286 BOOST_REQUIRE( connector.connected = connect(policy) );
1287 BOOST_REQUIRE( start() );
1289 BOOST_REQUIRE( stop() );
1292 BOOST_TEST_MESSAGE(
"Number of successful writes: " << writer.write_counter);
1293 BOOST_CHECK_GE( writer.write_counter, 100 );
1294 BOOST_TEST_MESSAGE(
"Number of successful reads (NewData): " << reader.read_counter);
1295 BOOST_CHECK_GE( reader.read_counter, 100 );
1296 BOOST_TEST_MESSAGE(
"Number of connects/disconnects: " 1297 << connector.connect_counter <<
"/" << connector.disconnect_counter
1298 <<
" (" << connector.connect_failure_counter <<
"/" << connector.disconnect_failure_counter <<
" failures)");
1299 BOOST_CHECK_GE( connector.connect_counter, 100 );
1300 BOOST_CHECK_EQUAL( connector.connect_failure_counter, 0 );
1301 BOOST_CHECK_EQUAL( connector.disconnect_failure_counter, 0 );
1302 BOOST_TEST_MESSAGE(
"Number of connects/disconnects from another output port: " 1303 << another_output_connector.connect_counter <<
"/" << another_output_connector.disconnect_counter
1304 <<
" (" << another_output_connector.connect_failure_counter <<
"/" << another_output_connector.disconnect_failure_counter <<
" failures)");
1305 BOOST_CHECK_GE( another_output_connector.connect_counter, 100 );
1306 BOOST_CHECK_EQUAL( another_output_connector.connect_failure_counter, 0 );
1307 BOOST_CHECK_EQUAL( another_output_connector.disconnect_failure_counter, 0 );
1308 BOOST_TEST_MESSAGE(
"Number of connects/disconnects to another input port: " 1309 << another_input_connector.connect_counter <<
"/" << another_input_connector.disconnect_counter
1310 <<
" (" << another_input_connector.connect_failure_counter <<
"/" << another_input_connector.disconnect_failure_counter <<
" failures)");
1311 BOOST_CHECK_GE( another_input_connector.connect_counter, 100 );
1312 BOOST_CHECK_EQUAL( another_input_connector.connect_failure_counter, 0 );
1313 BOOST_CHECK_EQUAL( another_input_connector.disconnect_failure_counter, 0 );
1321 BOOST_REQUIRE( connector.connected = connect(policy) );
1322 BOOST_REQUIRE( start() );
1324 BOOST_REQUIRE( stop() );
1327 BOOST_TEST_MESSAGE(
"Number of successful writes: " << writer.write_counter);
1328 BOOST_CHECK_GE( writer.write_counter, 100 );
1329 BOOST_TEST_MESSAGE(
"Number of successful reads (NewData): " << reader.read_counter);
1330 BOOST_CHECK_GE( reader.read_counter, 100 );
1331 BOOST_TEST_MESSAGE(
"Number of connects/disconnects: " 1332 << connector.connect_counter <<
"/" << connector.disconnect_counter
1333 <<
" (" << connector.connect_failure_counter <<
"/" << connector.disconnect_failure_counter <<
" failures)");
1334 BOOST_CHECK_GE( connector.connect_counter, 100 );
1335 BOOST_CHECK_EQUAL( connector.connect_failure_counter, 0 );
1336 BOOST_CHECK_EQUAL( connector.disconnect_failure_counter, 0 );
1337 BOOST_TEST_MESSAGE(
"Number of connects/disconnects from another output port: " 1338 << another_output_connector.connect_counter <<
"/" << another_output_connector.disconnect_counter
1339 <<
" (" << another_output_connector.connect_failure_counter <<
"/" << another_output_connector.disconnect_failure_counter <<
" failures)");
1340 BOOST_CHECK_GE( another_output_connector.connect_counter, 100 );
1341 BOOST_CHECK_EQUAL( another_output_connector.connect_failure_counter, 0 );
1342 BOOST_CHECK_EQUAL( another_output_connector.disconnect_failure_counter, 0 );
1343 BOOST_TEST_MESSAGE(
"Number of connects/disconnects to another input port: " 1344 << another_input_connector.connect_counter <<
"/" << another_input_connector.disconnect_counter
1345 <<
" (" << another_input_connector.connect_failure_counter <<
"/" << another_input_connector.disconnect_failure_counter <<
" failures)");
1346 BOOST_CHECK_GE( another_input_connector.connect_counter, 100 );
1347 BOOST_CHECK_EQUAL( another_input_connector.connect_failure_counter, 0 );
1348 BOOST_CHECK_EQUAL( another_input_connector.disconnect_failure_counter, 0 );
1356 BOOST_REQUIRE( connector.connected = connect(policy) );
1357 connector.shared_connection = writer.port.getSharedConnection();
1358 another_output_connector.shared_connection = writer.port.getSharedConnection();
1359 another_input_connector.shared_connection = reader.port.getSharedConnection();
1363 yet_another_output_port.
createConnection(writer.port.getSharedConnection(), policy);
1365 BOOST_REQUIRE( start() );
1367 BOOST_REQUIRE( stop() );
1370 BOOST_TEST_MESSAGE(
"Number of successful writes: " << writer.write_counter);
1371 BOOST_CHECK_GE( writer.write_counter, 100 );
1372 BOOST_TEST_MESSAGE(
"Number of successful reads (NewData): " << reader.read_counter);
1373 BOOST_CHECK_GE( reader.read_counter, 100 );
1374 BOOST_TEST_MESSAGE(
"Number of connects/disconnects: " 1375 << connector.connect_counter <<
"/" << connector.disconnect_counter
1376 <<
" (" << connector.connect_failure_counter <<
"/" << connector.disconnect_failure_counter <<
" failures)");
1377 BOOST_CHECK_GE( connector.connect_counter, 100 );
1378 BOOST_CHECK_EQUAL( connector.connect_failure_counter, 0 );
1379 BOOST_CHECK_EQUAL( connector.disconnect_failure_counter, 0 );
1380 BOOST_TEST_MESSAGE(
"Number of connects/disconnects from another output port: " 1381 << another_output_connector.connect_counter <<
"/" << another_output_connector.disconnect_counter
1382 <<
" (" << another_output_connector.connect_failure_counter <<
"/" << another_output_connector.disconnect_failure_counter <<
" failures)");
1383 BOOST_CHECK_GE( another_output_connector.connect_counter, 100 );
1384 BOOST_CHECK_EQUAL( another_output_connector.connect_failure_counter, 0 );
1385 BOOST_CHECK_EQUAL( another_output_connector.disconnect_failure_counter, 0 );
1386 BOOST_TEST_MESSAGE(
"Number of connects/disconnects to another input port: " 1387 << another_input_connector.connect_counter <<
"/" << another_input_connector.disconnect_counter
1388 <<
" (" << another_input_connector.connect_failure_counter <<
"/" << another_input_connector.disconnect_failure_counter <<
" failures)");
1389 BOOST_CHECK_GE( another_input_connector.connect_counter, 100 );
1390 BOOST_CHECK_EQUAL( another_input_connector.connect_failure_counter, 0 );
1391 BOOST_CHECK_EQUAL( another_input_connector.disconnect_failure_counter, 0 );
PortInterface & connect_port
void setDataSample(const T &sample)
static ConnPolicy data(int lock_policy=LOCK_FREE, bool init_connection=true, bool pull=false)
ConcurrencyPortsTestFixture()
#define BOOST_FIXTURE_TEST_SUITE(suite_name, F)
boost::intrusive_ptr< SharedConnectionBase > shared_ptr
ActivityInterface * stsim
bool connect(const ConnPolicy &policy)
#define BOOST_AUTO_TEST_SUITE_END()
PortWriterThread< T > writer
const std::string & getName() const
void new_data_listener(PortInterface *port)
RTT::internal::SharedConnectionBase::shared_ptr shared_connection
bool setActivity(base::ActivityInterface *new_act)
ActivityInterface * slsim
DataFlowInterface * getInterface() const
PortInterface & other_port
virtual bool connectTo(PortInterface *other, ConnPolicy const &policy)
static ConnPolicy buffer(int size, int lock_policy=LOCK_FREE, bool init_connection=false, bool pull=false)
PortReaderThread< T > reader
WriteStatus write(const T &sample)
static const int LOCK_FREE
PortConnectorThread connector
OutputPort< T > another_output_port
virtual bool connected() const
An Activity executes a RunnableInterface object in a (periodic) thread.
unsigned int sleep(unsigned int s)
~ConcurrencyPortsTestFixture()
static void yield(TaskContext *tc)
PortInterface * signalled_port
virtual void disconnect()
PortConnectorThread another_output_connector
unsigned disconnect_failure_counter
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
PortConnectorThread(PortInterface &connect_port, PortInterface &other_port, const ConnPolicy &policy=ConnPolicy())
T getLastWrittenValue() const
bool createBufferConnection(InputPortInterface &sink, int size, int lock_policy=ConnPolicy::LOCK_FREE)
The Handle holds the information, and allows manipulation, of a connection between a internal::Signal...
BOOST_AUTO_TEST_CASE(testPortTaskInterface)
PortWriterThread(const T &sample=T())
virtual base::PortInterface * antiClone() const
unsigned connect_failure_counter
base::ActivityInterface * getActivity()
virtual bool createConnection(base::InputPortInterface &input_port, ConnPolicy const &policy)
InputPort< T > another_input_port
static bool trigger(TaskContext *tc)