10 #ifndef __SOT_MAILBOX_T_CPP
11 #define __SOT_MAILBOX_T_CPP
21 template <
class Object>
29 SOUT(boost::bind(&
Mailbox::get, this, _1, _2), sotNOSIGNAL,
30 "Mailbox(" + name +
")::output(Object)::sout"),
31 objSOUT(boost::bind(&
Mailbox::getObject, this, _1, _2), SOUT,
32 "Mailbox(" + name +
")::output(Object)::object"),
33 timeSOUT(boost::bind(&
Mailbox::getTimestamp, this, _1, _2), SOUT,
34 "Mailbox(" + name +
")::output(Object)::timestamp") {
36 SOUT.setDependencyType(TimeDependency<int>::BOOL_DEPENDENT);
39 template <
class Object>
41 boost::timed_mutex::scoped_lock lockMain(mainObjectMutex);
47 template <
class Object>
49 boost::timed_mutex::scoped_try_lock lockMain(this->mainObjectMutex);
51 if (lockMain.owns_lock()) {
59 template <
class Object>
63 boost::timed_mutex::scoped_try_lock lockMain(this->mainObjectMutex);
65 if (lockMain.owns_lock()) {
66 res.
timestamp.tv_sec = this->mainTimeStamp.tv_sec;
67 res.
timestamp.tv_usec = this->mainTimeStamp.tv_usec;
70 res.
obj = this->mainObject;
77 template <
class Object>
79 boost::timed_mutex::scoped_lock lockMain(this->mainObjectMutex);
81 gettimeofday(&this->mainTimeStamp, NULL);
88 template <
class Object>
95 template <
class Object>
107 #define MAILBOX_TEMPLATE_SPE(S) \
108 namespace dynamicgraph { \
110 template void Mailbox<S>::post(const S &obj); \
111 template dynamicgraph::Vector &Mailbox<S>::getObject(S &res, \
113 template bool Mailbox<S>::hasBeenUpdated(void); \
114 template Mailbox<S>::~Mailbox(); \
115 template Mailbox<S>::sotTimestampedObject &Mailbox<S>::get( \
116 Mailbox<S>::sotTimestampedObject &res, const int &dummy); \
117 template Mailbox<S>::Mailbox(const std::string &name); \
Definition: mailbox.hh:43
struct timeval & getTimestamp(struct timeval &res, const int &time)
Definition: mailbox.hxx:96
sotTimestampedObject & get(sotTimestampedObject &res, const int &dummy)
Definition: mailbox.hxx:60
bool hasBeenUpdated(void)
Definition: mailbox.hxx:48
void post(const Object &obj)
Definition: mailbox.hxx:78
~Mailbox(void)
Definition: mailbox.hxx:40
Mailbox(const std::string &name)
Definition: mailbox.hxx:22
dynamicgraph::SignalTimeDependent< struct timeval, int > timeSOUT
Definition: mailbox.hh:72
Object & getObject(Object &res, const int &time)
Definition: mailbox.hxx:89
dynamicgraph::SignalTimeDependent< Object, int > objSOUT
Definition: mailbox.hh:71
dynamicgraph::SignalTimeDependent< sotTimestampedObject, int > SOUT
Definition: mailbox.hh:70
Definition: abstract-sot-external-interface.hh:17
Definition: mailbox.hh:37
struct timeval timestamp
Definition: mailbox.hh:39
Object obj
Definition: mailbox.hh:38