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 54 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 48 of file bond.cpp.
Destructs the object, breaking the bond if it is still formed.
Definition at line 73 of file bond.cpp.
Member Function Documentation
void bond::Bond::breakBond |
( |
|
) |
|
Breaks the bond, notifying the other process.
Definition at line 236 of file bond.cpp.
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 230 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 172 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 166 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 155 of file bond.cpp.
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 208 of file bond.cpp.
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 204 of file bond.cpp.
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 182 of file bond.cpp.
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 178 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: