diff options
| author | Alan Conway <aconway@apache.org> | 2008-06-18 17:53:30 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-06-18 17:53:30 +0000 |
| commit | 9bf82c2c8c45a5228643a285f8db0b1061a69ad9 (patch) | |
| tree | d38be99fcb793712c2a2b5fb56dcbbb8294ff818 /cpp/src/qpid/framing | |
| parent | 02757b560356e0ddb090fbe103e0b65db6dbd3b3 (diff) | |
| download | qpid-python-9bf82c2c8c45a5228643a285f8db0b1061a69ad9.tar.gz | |
Bring cluster code up to date.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@669236 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/framing')
| -rw-r--r-- | cpp/src/qpid/framing/Handler.h | 27 | ||||
| -rw-r--r-- | cpp/src/qpid/framing/HeaderProperties.h | 2 |
2 files changed, 13 insertions, 16 deletions
diff --git a/cpp/src/qpid/framing/Handler.h b/cpp/src/qpid/framing/Handler.h index b93869be85..5e3d48ac88 100644 --- a/cpp/src/qpid/framing/Handler.h +++ b/cpp/src/qpid/framing/Handler.h @@ -46,22 +46,21 @@ struct Handler { /** Pointer to next handler in a linked list. */ Handler<T>* next; - /** A Chain is a handler that forwards to a modifiable - * linked list of handlers. + /** A Chain is a handler holding a linked list of sub-handlers. + * Chain::next is invoked after the full, it is not itself part of the chain. + * Handlers inserted into the chain are deleted by the Chain dtor. */ - struct Chain : public Handler<T> { - Chain(Handler<T>* first=0) : Handler(first) {} - void operator=(Handler<T>* h) { next = h; } - void handle(T t) { next->handle(t); } - // TODO aconway 2007-08-29: chain modifier ops here. - }; + class Chain : public Handler<T> { + public: + Chain(Handler<T>& next_) : Handler(&next_), first(&next_) {} + ~Chain() { while (first != next) pop(); } + void handle(T t) { first->handle(t); } + void insert(Handler<T>* h) { h->next = first; first = h; } + bool empty() { return first == next; } - /** In/out pair of handler chains. */ - struct Chains { - Chains(Handler<T>* in_=0, Handler<T>* out_=0) : in(in_), out(out_) {} - void reset(Handler<T>* in_=0, Handler<T>* out_=0) { in = in_; out = out_; } - Chain in; - Chain out; + private: + void pop() { Handler<T>* p=first; first=first->next; delete p; } + Handler<T>* first; }; /** Adapt any void(T) functor as a Handler. diff --git a/cpp/src/qpid/framing/HeaderProperties.h b/cpp/src/qpid/framing/HeaderProperties.h index 0c805922e8..d66c1d00d6 100644 --- a/cpp/src/qpid/framing/HeaderProperties.h +++ b/cpp/src/qpid/framing/HeaderProperties.h @@ -27,8 +27,6 @@ namespace qpid { namespace framing { - enum header_classes{BASIC = 60}; - class HeaderProperties { |
