test_mailbox.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2010,
3  * François Bleibel,
4  * Olivier Stasse,
5  *
6  * CNRS/AIST
7  *
8  */
9 
10 #include <iostream>
11 #include <sot/core/debug.hh>
12 
13 #ifndef WIN32
14 #include <unistd.h>
15 #endif
16 
17 using namespace std;
18 
19 #include <dynamic-graph/entity.h>
20 #include <dynamic-graph/factory.h>
21 
23 #include <sot/core/mailbox-vector.hh>
24 #include <sstream>
25 
26 using namespace dynamicgraph;
27 using namespace dynamicgraph::sot;
28 
29 #include <boost/thread.hpp>
30 
31 sot::MailboxVector *mailbox = NULL;
32 
33 void f(void) {
34  Vector vect(25);
35  Vector vect2(25);
36  for (int i = 0; i < 250; ++i) {
37  std::cout << " iter " << i << std::endl;
38  for (int j = 0; j < 25; ++j) vect(j) = j + i * 10;
39  mailbox->post(vect);
40  Vector V = mailbox->getObject(vect2, 1);
41  std::cout << vect2 << std::endl;
42  std::cout << " getClassName " << mailbox->getClassName() << std::endl;
43  std::cout << " getName " << mailbox->getName() << std::endl;
44  std::cout << " hasBeenUpdated " << mailbox->hasBeenUpdated() << std::endl;
45  std::cout << std::endl;
46  }
47 }
48 
49 int main(int, char **) {
50  mailbox = new sot::MailboxVector("mail");
51 
52  boost::thread th(f);
53  th.join();
54 
55  return 0;
56 }
V
V
dynamicgraph
i
int i
feature-abstract.hh
f
void f(void)
Definition: test_mailbox.cpp:33
debug.hh
main
int main(int, char **)
Definition: test_mailbox.cpp:49
Vector
Eigen::VectorXd Vector
dynamicgraph::sot
mailbox
sot::MailboxVector * mailbox
Definition: test_mailbox.cpp:31


sot-core
Author(s): Olivier Stasse, ostasse@laas.fr
autogenerated on Tue Oct 24 2023 02:26:32