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();
118 tc->ports()->addPort( wp1 );
119 tc->ports()->addPort( rp2 );
122 tc->ports()->addPort( wp1 );
126 tc->ports()->addPort( other_rp );
128 tc->ports()->removePort( other_rp.
getName() );
134 #if __cplusplus > 199711L 135 unique_ptr<TaskContext> tc1(
new TaskContext(
"tc", TaskContext::Stopped ));
136 unique_ptr<TaskContext> tc2(
new TaskContext(
"tc2", TaskContext::Stopped ));
138 auto_ptr<TaskContext> tc1(
new TaskContext(
"tc", TaskContext::Stopped ));
139 auto_ptr<TaskContext> tc2(
new TaskContext(
"tc2", TaskContext::Stopped ));
142 tc1->ports()->addPort( rp1 );
143 tc1->ports()->addPort( wp2 );
144 tc2->ports()->addPort( rp2 );
145 tc2->ports()->addPort( wp1 );
147 BOOST_CHECK( tc1->connectPorts(tc2.get()) );
152 BOOST_CHECK( rp1.
read(value) );
153 BOOST_CHECK_EQUAL(2, value);
159 BOOST_CHECK( rp2.
read(value) );
160 BOOST_CHECK_EQUAL(3, value);
171 tc->ports()->removePort( wp1.
getName() );
172 tc->ports()->removePort( rp2.
getName() );
184 BOOST_CHECK( !rp.
read(value) );
185 BOOST_CHECK_EQUAL( value, 0 );
188 BOOST_CHECK_EQUAL( -1, value );
191 BOOST_CHECK( rp.
read(value) );
192 BOOST_CHECK_EQUAL( 10, value );
200 BOOST_CHECK_EQUAL( 10, value );
205 BOOST_CHECK( rp.
read(value) );
206 BOOST_CHECK_EQUAL( 10, value );
219 BOOST_CHECK( !rp.
read(value) );
229 BOOST_CHECK( !rp.
read(value) );
231 BOOST_CHECK( rp.
read(value) );
232 BOOST_CHECK( 1 == value );
238 BOOST_CHECK( !rp.
read(value) );
240 BOOST_CHECK( rp.
read(value) );
241 BOOST_CHECK( 1 == value );
252 BOOST_CHECK( !rp.
read(value) );
258 BOOST_CHECK( !rp.
read(value) );
260 BOOST_CHECK( !rp.
read(value) );
266 BOOST_CHECK_EQUAL(0, value);
267 BOOST_CHECK( rp.
read(value) );
268 BOOST_CHECK_EQUAL(1, value);
269 BOOST_CHECK( rp.
read(value) );
270 BOOST_CHECK_EQUAL(2, value);
276 BOOST_CHECK( rp.
read(value) );
277 BOOST_CHECK_EQUAL(10, value);
278 BOOST_CHECK( rp.
read(value) );
279 BOOST_CHECK_EQUAL(20, value);
290 BOOST_CHECK( !rp.
read(value) );
334 BOOST_CHECK( rp1.
read(value));
335 BOOST_CHECK_EQUAL(30, value);
337 BOOST_CHECK( rp2.
read(value));
338 BOOST_CHECK_EQUAL(10, value);
339 BOOST_CHECK( rp2.
read(value));
340 BOOST_CHECK_EQUAL(15, value);
341 BOOST_CHECK( rp2.
read(value));
342 BOOST_CHECK_EQUAL(20, value);
343 BOOST_CHECK( rp2.
read(value));
344 BOOST_CHECK_EQUAL(25, value);
346 BOOST_CHECK_EQUAL(25, value);
348 BOOST_CHECK( rp3.
read(value));
349 BOOST_CHECK_EQUAL(30, value);
360 BOOST_CHECK( rp1.
read(value));
361 BOOST_CHECK_EQUAL(10, value);
362 BOOST_CHECK( rp3.
read(value));
363 BOOST_CHECK_EQUAL(10, value);
409 BOOST_CHECK( rp1.
read(value));
410 BOOST_CHECK_EQUAL(10, value);
411 BOOST_CHECK( rp2.
read(value));
412 BOOST_CHECK_EQUAL(15, value);
413 BOOST_CHECK( rp3.
read(value));
414 BOOST_CHECK_EQUAL(20, value);
415 BOOST_CHECK( rp3.
read(value));
416 BOOST_CHECK_EQUAL(25, value);
419 BOOST_CHECK_EQUAL(25, value);
422 BOOST_CHECK_EQUAL(25, value);
425 BOOST_CHECK_EQUAL(25, value);
436 BOOST_CHECK( rp1.
read(value) );
437 BOOST_CHECK_EQUAL(10, value);
440 BOOST_CHECK_EQUAL(10, value);
500 BOOST_CHECK( rp.
read(value));
501 BOOST_CHECK_EQUAL(10, value);
502 BOOST_CHECK( rp.
read(value));
503 BOOST_CHECK_EQUAL(20, value);
504 BOOST_CHECK( rp.
read(value));
505 BOOST_CHECK_EQUAL(30, value);
506 BOOST_CHECK( rp.
read(value));
507 BOOST_CHECK_EQUAL(40, value);
520 BOOST_CHECK_EQUAL(60, value);
525 BOOST_CHECK_EQUAL(60, value);
581 BOOST_CHECK( rp.
read(value));
582 BOOST_CHECK_EQUAL(10, value);
583 BOOST_CHECK( rp.
read(value));
584 BOOST_CHECK_EQUAL(20, value);
585 BOOST_CHECK( rp.
read(value));
586 BOOST_CHECK_EQUAL(30, value);
587 BOOST_CHECK( rp.
read(value));
588 BOOST_CHECK_EQUAL(40, value);
599 BOOST_CHECK( rp.
read(value));
600 BOOST_CHECK_EQUAL(60, value);
603 BOOST_CHECK( rp.
read(value));
604 BOOST_CHECK_EQUAL(13, value);
605 BOOST_CHECK( rp.
read(value));
606 BOOST_CHECK_EQUAL(23, value);
611 BOOST_CHECK( rp.
read(value));
612 BOOST_CHECK_EQUAL(33, value);
613 BOOST_CHECK( rp.
read(value));
614 BOOST_CHECK_EQUAL(43, value);
618 BOOST_CHECK_EQUAL(70, value);
621 BOOST_CHECK_EQUAL(70, value);
651 BOOST_CHECK_EQUAL(11, value);
653 BOOST_CHECK_EQUAL(11, value);
657 BOOST_CHECK_EQUAL(12, value);
659 BOOST_CHECK_EQUAL(12, value);
663 BOOST_CHECK_EQUAL(21, value);
665 BOOST_CHECK_EQUAL(21, value);
669 BOOST_CHECK_EQUAL(22, value);
671 BOOST_CHECK_EQUAL(22, value);
678 BOOST_CHECK_EQUAL(31, value);
680 BOOST_CHECK_EQUAL(32, value);
682 BOOST_CHECK_EQUAL(33, value);
684 BOOST_CHECK_EQUAL(34, value);
686 BOOST_CHECK_EQUAL(34, value);
688 BOOST_CHECK_EQUAL(34, value);
713 BOOST_CHECK_EQUAL(34, value);
715 BOOST_CHECK_EQUAL(34, value);
717 BOOST_CHECK_EQUAL(34, value);
719 BOOST_CHECK_EQUAL(34, value);
721 BOOST_CHECK_EQUAL(34, value);
723 BOOST_CHECK_EQUAL(34, value);
737 BOOST_CHECK( wp1.
connectTo(&rp, cp_PerConnection) );
738 BOOST_CHECK( !wp2.
connectTo(&rp, cp_PerInputPort) );
746 BOOST_CHECK( wp1.
connectTo(&rp, cp_DATA) );
747 BOOST_CHECK( !wp2.
connectTo(&rp, cp_BUFFER) );
755 BOOST_CHECK( wp1.
connectTo(&rp, cp_LOCK_FREE) );
756 BOOST_CHECK( !wp2.
connectTo(&rp, cp_LOCKED) );
764 BOOST_CHECK( wp1.
connectTo(&rp, cp_BUFFER5) );
765 BOOST_CHECK( !wp2.
connectTo(&rp, cp_BUFFER10) );
790 tc->ports()->addPort( wp1 );
791 tc->ports()->addPort( rp1 );
794 BOOST_CHECK( tc->provides(
"Write") != 0 );
795 BOOST_CHECK( tc->provides(
"Read") != 0 );
807 mset = tc->provides(
"Write")->getOperation(
"write");
808 BOOST_CHECK( mset.
ready() );
810 mget = tc->provides(
"Read")->getOperation(
"read");
811 BOOST_CHECK( mget.ready() );
815 double get_value = 0;
816 BOOST_CHECK( mget(get_value) );
817 BOOST_CHECK_CLOSE( 3.991, get_value, 0.001 );
820 tc->ports()->removePort(
"Read");
821 BOOST_CHECK( tc->provides()->hasService(
"Read") == 0 );
822 BOOST_CHECK( tc->ports()->getPort(
"Read") == 0 );
824 tc->ports()->removePort(
"Write");
825 BOOST_CHECK( tc->provides()->hasService(
"Write") == 0 );
826 BOOST_CHECK( tc->ports()->getPort(
"Write") == 0 );
829 #ifdef ORO_SIGNALLING_PORTS 835 Handle hl( rp1.getNewDataOnPortEvent()->setup(
842 BOOST_CHECK(&rp1 == signalled_port);
848 BOOST_CHECK(&rp1 == signalled_port);
851 BOOST_CHECK(&rp1 == signalled_port);
854 BOOST_CHECK(0 == signalled_port);
866 tc.addEventPort( *ep1 );
875 tc.ports()->removePort(
"Write");
876 tc.ports()->removePort(
"Read");
877 tc.ports()->removePort(
"ERead");
897 tc.addEventPort( *ep1 );
906 tc.ports()->removePort(
"Write");
907 tc.ports()->removePort(
"Read");
908 tc.ports()->removePort(
"ERead");
925 BOOST_REQUIRE(tce->configure());
926 BOOST_REQUIRE(tce->isConfigured());
928 BOOST_REQUIRE(slsim->isActive());
936 BOOST_CHECK( slsim->execute() );
941 BOOST_CHECK(&rp1 == signalled_port);
942 BOOST_CHECK(tce->had_event);
950 BOOST_CHECK(&rp1 == signalled_port);
951 BOOST_CHECK(tce->had_event);
955 BOOST_CHECK(&rp1 == signalled_port);
956 BOOST_CHECK(tce->had_event);
962 BOOST_CHECK( slsim->execute() );
963 BOOST_CHECK(0 == signalled_port);
964 BOOST_CHECK( !tce->had_event);
968 tce->ports()->removePort( rp1.
getName() );
986 BOOST_CHECK( slsim->execute() );
987 BOOST_CHECK(&rp1 == signalled_port);
988 BOOST_CHECK(tc3->had_event);
997 BOOST_CHECK( slsim->execute() );
998 BOOST_CHECK(&rp1 == signalled_port);
999 BOOST_CHECK(tc3->had_event);
1004 BOOST_CHECK( slsim->execute() );
1005 BOOST_CHECK(&rp1 == signalled_port);
1006 BOOST_CHECK(tc3->had_event);
1011 BOOST_CHECK( slsim->execute() );
1012 BOOST_CHECK(0 == signalled_port);
1013 BOOST_CHECK( tc3->had_event);
1018 BOOST_CHECK( slsim->execute() );
1019 BOOST_CHECK(&rp1 == signalled_port);
1023 tc3->ports()->removePort( rp1.
getName() );
1038 BOOST_CHECK( !tce->had_event );
1044 BOOST_CHECK( !tce->had_event );
1047 tce->ports()->removePort( rp1.
getName() );
1053 #if __cplusplus > 199711L 1054 unique_ptr<InputPortInterface>
1056 auto_ptr<InputPortInterface>
1058 reader(dynamic_cast<InputPortInterface*>(wp1.
antiClone()));
1062 BOOST_CHECK(source);
1064 BOOST_CHECK(!source->evaluate());
1068 BOOST_CHECK_EQUAL(0, source->value());
1071 BOOST_CHECK(source->evaluate());
1072 BOOST_CHECK_EQUAL(10, source->value());
1073 BOOST_CHECK_EQUAL(10, source->value());
1076 BOOST_CHECK_EQUAL(20, source->get());
1079 BOOST_CHECK(!source->evaluate());
1080 BOOST_CHECK_EQUAL(0, source->get());
1081 BOOST_CHECK_EQUAL(20, source->value());
1092 template <
typename T>
1097 : port(
"writer"), sample(sample), step_counter(0), write_counter(0)
1115 template <
typename T>
1120 : port(
"reader"), step_counter(0), read_counter(0)
1123 if (port.read(sample) ==
NewData) {
1142 : connect_port(connect_port), other_port(other_port), policy(policy),
1143 step_counter(0), connect_counter(0), connect_failure_counter(0),
1144 disconnect_counter(0), disconnect_failure_counter(0), connected(false)
1148 if ((!shared_connection && connect_port.connectTo(&other_port, policy)) ||
1149 (shared_connection && connect_port.createConnection(shared_connection, policy))) {
1153 ++connect_failure_counter;
1156 if ((!shared_connection && connect_port.disconnect(&other_port)) ||
1157 (shared_connection && connect_port.getManager()->removeConnection(shared_connection.get()))) {
1159 ++disconnect_counter;
1161 ++disconnect_failure_counter;
1192 , connector(writer.port, reader.port)
1193 , another_output_port(
"another_output_port")
1194 , another_input_port(
"another_input_port")
1195 , another_output_connector(another_output_port, reader.port)
1196 , another_input_connector(another_input_port, writer.port)
1206 connector.
policy = policy;
1207 another_output_connector.
policy = policy;
1208 another_input_connector.
policy = policy;
1209 return writer.
port.connectTo(&reader.
port, policy);
1213 writer.
port.disconnect();
1214 reader.
port.disconnect();
1222 result = writer.
start() && result;
1223 result = reader.
start() && result;
1224 result = connector.
start() && result;
1225 result = another_output_connector.
start() && result;
1226 result = another_input_connector.
start() && result;
1233 result = writer.
stop() && result;
1234 result = reader.
stop() && result;
1235 result = connector.
stop() && result;
1236 result = another_output_connector.
stop() && result;
1237 result = another_input_connector.
stop() && result;
1250 BOOST_REQUIRE( connector.connected = connect(policy) );
1251 BOOST_REQUIRE( start() );
1253 BOOST_REQUIRE( stop() );
1256 BOOST_TEST_MESSAGE(
"Number of successful writes: " << writer.write_counter);
1257 BOOST_CHECK_GE( writer.write_counter, 100 );
1258 BOOST_TEST_MESSAGE(
"Number of successful reads (NewData): " << reader.read_counter);
1259 BOOST_CHECK_GE( reader.read_counter, 100 );
1260 BOOST_TEST_MESSAGE(
"Number of connects/disconnects: " 1261 << connector.connect_counter <<
"/" << connector.disconnect_counter
1262 <<
" (" << connector.connect_failure_counter <<
"/" << connector.disconnect_failure_counter <<
" failures)");
1263 BOOST_CHECK_GE( connector.connect_counter, 100 );
1264 BOOST_CHECK_EQUAL( connector.connect_failure_counter, 0 );
1265 BOOST_CHECK_EQUAL( connector.disconnect_failure_counter, 0 );
1266 BOOST_TEST_MESSAGE(
"Number of connects/disconnects from another output port: " 1267 << another_output_connector.connect_counter <<
"/" << another_output_connector.disconnect_counter
1268 <<
" (" << another_output_connector.connect_failure_counter <<
"/" << another_output_connector.disconnect_failure_counter <<
" failures)");
1269 BOOST_CHECK_GE( another_output_connector.connect_counter, 100 );
1270 BOOST_CHECK_EQUAL( another_output_connector.connect_failure_counter, 0 );
1271 BOOST_CHECK_EQUAL( another_output_connector.disconnect_failure_counter, 0 );
1272 BOOST_TEST_MESSAGE(
"Number of connects/disconnects to another input port: " 1273 << another_input_connector.connect_counter <<
"/" << another_input_connector.disconnect_counter
1274 <<
" (" << another_input_connector.connect_failure_counter <<
"/" << another_input_connector.disconnect_failure_counter <<
" failures)");
1275 BOOST_CHECK_GE( another_input_connector.connect_counter, 100 );
1276 BOOST_CHECK_EQUAL( another_input_connector.connect_failure_counter, 0 );
1277 BOOST_CHECK_EQUAL( another_input_connector.disconnect_failure_counter, 0 );
1285 BOOST_REQUIRE( connector.connected = connect(policy) );
1286 BOOST_REQUIRE( start() );
1288 BOOST_REQUIRE( stop() );
1291 BOOST_TEST_MESSAGE(
"Number of successful writes: " << writer.write_counter);
1292 BOOST_CHECK_GE( writer.write_counter, 100 );
1293 BOOST_TEST_MESSAGE(
"Number of successful reads (NewData): " << reader.read_counter);
1294 BOOST_CHECK_GE( reader.read_counter, 100 );
1295 BOOST_TEST_MESSAGE(
"Number of connects/disconnects: " 1296 << connector.connect_counter <<
"/" << connector.disconnect_counter
1297 <<
" (" << connector.connect_failure_counter <<
"/" << connector.disconnect_failure_counter <<
" failures)");
1298 BOOST_CHECK_GE( connector.connect_counter, 100 );
1299 BOOST_CHECK_EQUAL( connector.connect_failure_counter, 0 );
1300 BOOST_CHECK_EQUAL( connector.disconnect_failure_counter, 0 );
1301 BOOST_TEST_MESSAGE(
"Number of connects/disconnects from another output port: " 1302 << another_output_connector.connect_counter <<
"/" << another_output_connector.disconnect_counter
1303 <<
" (" << another_output_connector.connect_failure_counter <<
"/" << another_output_connector.disconnect_failure_counter <<
" failures)");
1304 BOOST_CHECK_GE( another_output_connector.connect_counter, 100 );
1305 BOOST_CHECK_EQUAL( another_output_connector.connect_failure_counter, 0 );
1306 BOOST_CHECK_EQUAL( another_output_connector.disconnect_failure_counter, 0 );
1307 BOOST_TEST_MESSAGE(
"Number of connects/disconnects to another input port: " 1308 << another_input_connector.connect_counter <<
"/" << another_input_connector.disconnect_counter
1309 <<
" (" << another_input_connector.connect_failure_counter <<
"/" << another_input_connector.disconnect_failure_counter <<
" failures)");
1310 BOOST_CHECK_GE( another_input_connector.connect_counter, 100 );
1311 BOOST_CHECK_EQUAL( another_input_connector.connect_failure_counter, 0 );
1312 BOOST_CHECK_EQUAL( another_input_connector.disconnect_failure_counter, 0 );
1320 BOOST_REQUIRE( connector.connected = connect(policy) );
1321 BOOST_REQUIRE( start() );
1323 BOOST_REQUIRE( stop() );
1326 BOOST_TEST_MESSAGE(
"Number of successful writes: " << writer.write_counter);
1327 BOOST_CHECK_GE( writer.write_counter, 100 );
1328 BOOST_TEST_MESSAGE(
"Number of successful reads (NewData): " << reader.read_counter);
1329 BOOST_CHECK_GE( reader.read_counter, 100 );
1330 BOOST_TEST_MESSAGE(
"Number of connects/disconnects: " 1331 << connector.connect_counter <<
"/" << connector.disconnect_counter
1332 <<
" (" << connector.connect_failure_counter <<
"/" << connector.disconnect_failure_counter <<
" failures)");
1333 BOOST_CHECK_GE( connector.connect_counter, 100 );
1334 BOOST_CHECK_EQUAL( connector.connect_failure_counter, 0 );
1335 BOOST_CHECK_EQUAL( connector.disconnect_failure_counter, 0 );
1336 BOOST_TEST_MESSAGE(
"Number of connects/disconnects from another output port: " 1337 << another_output_connector.connect_counter <<
"/" << another_output_connector.disconnect_counter
1338 <<
" (" << another_output_connector.connect_failure_counter <<
"/" << another_output_connector.disconnect_failure_counter <<
" failures)");
1339 BOOST_CHECK_GE( another_output_connector.connect_counter, 100 );
1340 BOOST_CHECK_EQUAL( another_output_connector.connect_failure_counter, 0 );
1341 BOOST_CHECK_EQUAL( another_output_connector.disconnect_failure_counter, 0 );
1342 BOOST_TEST_MESSAGE(
"Number of connects/disconnects to another input port: " 1343 << another_input_connector.connect_counter <<
"/" << another_input_connector.disconnect_counter
1344 <<
" (" << another_input_connector.connect_failure_counter <<
"/" << another_input_connector.disconnect_failure_counter <<
" failures)");
1345 BOOST_CHECK_GE( another_input_connector.connect_counter, 100 );
1346 BOOST_CHECK_EQUAL( another_input_connector.connect_failure_counter, 0 );
1347 BOOST_CHECK_EQUAL( another_input_connector.disconnect_failure_counter, 0 );
1355 BOOST_REQUIRE( connector.connected = connect(policy) );
1356 connector.shared_connection = writer.port.getSharedConnection();
1357 another_output_connector.shared_connection = writer.port.getSharedConnection();
1358 another_input_connector.shared_connection = reader.port.getSharedConnection();
1362 yet_another_output_port.
createConnection(writer.port.getSharedConnection(), policy);
1364 BOOST_REQUIRE( start() );
1366 BOOST_REQUIRE( stop() );
1369 BOOST_TEST_MESSAGE(
"Number of successful writes: " << writer.write_counter);
1370 BOOST_CHECK_GE( writer.write_counter, 100 );
1371 BOOST_TEST_MESSAGE(
"Number of successful reads (NewData): " << reader.read_counter);
1372 BOOST_CHECK_GE( reader.read_counter, 100 );
1373 BOOST_TEST_MESSAGE(
"Number of connects/disconnects: " 1374 << connector.connect_counter <<
"/" << connector.disconnect_counter
1375 <<
" (" << connector.connect_failure_counter <<
"/" << connector.disconnect_failure_counter <<
" failures)");
1376 BOOST_CHECK_GE( connector.connect_counter, 100 );
1377 BOOST_CHECK_EQUAL( connector.connect_failure_counter, 0 );
1378 BOOST_CHECK_EQUAL( connector.disconnect_failure_counter, 0 );
1379 BOOST_TEST_MESSAGE(
"Number of connects/disconnects from another output port: " 1380 << another_output_connector.connect_counter <<
"/" << another_output_connector.disconnect_counter
1381 <<
" (" << another_output_connector.connect_failure_counter <<
"/" << another_output_connector.disconnect_failure_counter <<
" failures)");
1382 BOOST_CHECK_GE( another_output_connector.connect_counter, 100 );
1383 BOOST_CHECK_EQUAL( another_output_connector.connect_failure_counter, 0 );
1384 BOOST_CHECK_EQUAL( another_output_connector.disconnect_failure_counter, 0 );
1385 BOOST_TEST_MESSAGE(
"Number of connects/disconnects to another input port: " 1386 << another_input_connector.connect_counter <<
"/" << another_input_connector.disconnect_counter
1387 <<
" (" << another_input_connector.connect_failure_counter <<
"/" << another_input_connector.disconnect_failure_counter <<
" failures)");
1388 BOOST_CHECK_GE( another_input_connector.connect_counter, 100 );
1389 BOOST_CHECK_EQUAL( another_input_connector.connect_failure_counter, 0 );
1390 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)