bond::Bond Class Reference
Forms a bond to monitor another process.
More...
#include <bond.h>
List of all members.
Detailed Description
Forms a bond to monitor another process.
The bond::Bond class implements a bond, allowing you to monitor another process and be notified when it dies. In turn, it will be notified when you die.
Definition at line 53 of file bond.h.
Constructor & Destructor Documentation
bond::Bond::Bond |
( |
const std::string & |
topic, |
|
|
const std::string & |
id, |
|
|
boost::function< void(void)> |
on_broken = boost::function<void(void)>() , |
|
|
boost::function< void(void)> |
on_formed = boost::function<void(void)>() | |
|
) |
| | |
Constructs a bond, but does not connect.
- Parameters:
-
| topic | The topic used to exchange the bond status messages. |
| id | The ID of the bond, which should match the ID used on the sister's end. |
| on_broken | callback that will be called when the bond is broken. |
| on_formed | callback that will be called when the bond is formed. |
Definition at line 44 of file bond.cpp.
Destructs the object, breaking the bond if it is still formed.
Definition at line 70 of file bond.cpp.
Member Function Documentation
void bond::Bond::bondStatusCB |
( |
const bond::Status::ConstPtr & |
msg |
) |
[private] |
void bond::Bond::breakBond |
( |
|
) |
|
Breaks the bond, notifying the other process.
Definition at line 211 of file bond.cpp.
void bond::Bond::doPublishing |
( |
const ros::WallTimerEvent & |
e |
) |
[private] |
void bond::Bond::flushPendingCallbacks |
( |
|
) |
[private] |
double bond::Bond::getConnectTimeout |
( |
|
) |
const [inline] |
double bond::Bond::getDisconnectTimeout |
( |
|
) |
const [inline] |
double bond::Bond::getHeartbeatPeriod |
( |
|
) |
const [inline] |
double bond::Bond::getHeartbeatTimeout |
( |
|
) |
const [inline] |
std::string bond::Bond::getId |
( |
|
) |
[inline] |
std::string bond::Bond::getInstanceId |
( |
|
) |
[inline] |
std::string bond::Bond::getTopic |
( |
|
) |
[inline] |
bool bond::Bond::isBroken |
( |
|
) |
|
Indicates if the bond is broken.
- Returns:
- true iff the bond has been broken.
Definition at line 205 of file bond.cpp.
void bond::Bond::onConnectTimeout |
( |
|
) |
[private] |
void bond::Bond::onDisconnectTimeout |
( |
|
) |
[private] |
void bond::Bond::onHeartbeatTimeout |
( |
|
) |
[private] |
void bond::Bond::publishStatus |
( |
bool |
active |
) |
[private] |
void bond::Bond::setBrokenCallback |
( |
boost::function< void(void)> |
on_broken |
) |
|
Sets the broken callback.
Definition at line 155 of file bond.cpp.
void bond::Bond::setConnectTimeout |
( |
double |
dur |
) |
|
void bond::Bond::setDisconnectTimeout |
( |
double |
dur |
) |
|
void bond::Bond::setFormedCallback |
( |
boost::function< void(void)> |
on_formed |
) |
|
Sets the formed callback.
Definition at line 149 of file bond.cpp.
void bond::Bond::setHeartbeatPeriod |
( |
double |
dur |
) |
|
void bond::Bond::setHeartbeatTimeout |
( |
double |
dur |
) |
|
void bond::Bond::start |
( |
|
) |
|
Starts the bond and connects to the sister process.
Definition at line 139 of file bond.cpp.
bool bond::Bond::waitUntilBroken |
( |
ros::Duration |
timeout = ros::Duration(-1) |
) |
|
Blocks until the bond is broken for at most 'duration'.
- Parameters:
-
| timeout | Maximum duration to wait. If -1 then this call will not timeout. |
- Returns:
- true iff the bond has been broken, even if it has never been formed.
Definition at line 183 of file bond.cpp.
bool bond::Bond::waitUntilFormed |
( |
ros::Duration |
timeout = ros::Duration(-1) |
) |
|
Blocks until the bond is formed for at most 'duration'.
- Parameters:
-
| timeout | Maximum duration to wait. If -1 then this call will not timeout. |
- Returns:
- true iff the bond has been formed.
Definition at line 161 of file bond.cpp.
Friends And Related Function Documentation
friend class ::BondSM [friend] |
Member Data Documentation
The documentation for this class was generated from the following files: