summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/qpid/cluster/Cpg.h
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-07-28 18:28:56 +0000
committerAlan Conway <aconway@apache.org>2011-07-28 18:28:56 +0000
commit95ad2adfc443b227eba224279188c36906c1db66 (patch)
tree14c91400e2284b2c4f782d203a60d44dbee31f9e /qpid/cpp/src/qpid/cluster/Cpg.h
parent8db25489a2971803b21d73814521b40731111bd5 (diff)
downloadqpid-python-95ad2adfc443b227eba224279188c36906c1db66.tar.gz
Merge branch 'visibility-hidden' into qpid-3163qpid-3163
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qpid-3163@1151956 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid/cluster/Cpg.h')
-rw-r--r--qpid/cpp/src/qpid/cluster/Cpg.h40
1 files changed, 18 insertions, 22 deletions
diff --git a/qpid/cpp/src/qpid/cluster/Cpg.h b/qpid/cpp/src/qpid/cluster/Cpg.h
index 6b81c602bd..26de3fece1 100644
--- a/qpid/cpp/src/qpid/cluster/Cpg.h
+++ b/qpid/cpp/src/qpid/cluster/Cpg.h
@@ -34,7 +34,7 @@ namespace cluster {
/**
* Lightweight C++ interface to cpg.h operations.
- *
+ *
* Manages a single CPG handle, initialized in ctor, finialzed in destructor.
* On error all functions throw Cpg::Exception.
*
@@ -42,10 +42,6 @@ namespace cluster {
class Cpg : public sys::IOHandle {
public:
- struct Exception : public ::qpid::Exception {
- Exception(const std::string& msg) : ::qpid::Exception(msg) {}
- };
-
struct Name : public cpg_name {
Name() { length = 0; }
Name(const char* s) { copy(s, strlen(s)); }
@@ -87,22 +83,22 @@ class Cpg : public sys::IOHandle {
*@param handler for CPG events.
*/
Cpg(Handler&);
-
+
/** Destructor calls shutdown if not already calledx. */
~Cpg();
/** Disconnect from CPG */
void shutdown();
-
+
void dispatchOne();
void dispatchAll();
void dispatchBlocking();
- void join(const std::string& group);
+ void join(const std::string& group);
void leave();
/** Multicast to the group. NB: must not be called concurrently.
- *
+ *
*@return true if the message was multi-cast, false if
* it was not sent due to flow control.
*/
@@ -113,7 +109,7 @@ class Cpg : public sys::IOHandle {
MemberId self() const;
int getFd();
-
+
private:
// Maximum number of retries for cog functions that can tell
@@ -125,46 +121,46 @@ class Cpg : public sys::IOHandle {
// Base class for the Cpg operations that need retry capability.
- struct CpgOp {
+ struct CpgOp {
std::string opName;
- CpgOp ( std::string opName )
+ CpgOp ( std::string opName )
: opName(opName) { }
- virtual cpg_error_t op ( cpg_handle_t handle, struct cpg_name * ) = 0;
+ virtual cpg_error_t op ( cpg_handle_t handle, struct cpg_name * ) = 0;
virtual std::string msg(const Name&) = 0;
virtual ~CpgOp ( ) { }
};
- struct CpgJoinOp : public CpgOp {
+ struct CpgJoinOp : public CpgOp {
CpgJoinOp ( )
: CpgOp ( std::string("cpg_join") ) { }
- cpg_error_t op(cpg_handle_t handle, struct cpg_name * group) {
- return cpg_join ( handle, group );
+ cpg_error_t op(cpg_handle_t handle, struct cpg_name * group) {
+ return cpg_join ( handle, group );
}
std::string msg(const Name& name) { return cantJoinMsg(name); }
};
- struct CpgLeaveOp : public CpgOp {
+ struct CpgLeaveOp : public CpgOp {
CpgLeaveOp ( )
: CpgOp ( std::string("cpg_leave") ) { }
- cpg_error_t op(cpg_handle_t handle, struct cpg_name * group) {
- return cpg_leave ( handle, group );
+ cpg_error_t op(cpg_handle_t handle, struct cpg_name * group) {
+ return cpg_leave ( handle, group );
}
std::string msg(const Name& name) { return cantLeaveMsg(name); }
};
- struct CpgFinalizeOp : public CpgOp {
+ struct CpgFinalizeOp : public CpgOp {
CpgFinalizeOp ( )
: CpgOp ( std::string("cpg_finalize") ) { }
- cpg_error_t op(cpg_handle_t handle, struct cpg_name *) {
- return cpg_finalize ( handle );
+ cpg_error_t op(cpg_handle_t handle, struct cpg_name *) {
+ return cpg_finalize ( handle );
}
std::string msg(const Name& name) { return cantFinalizeMsg(name); }