diff options
| author | Ted Ross <tross@apache.org> | 2009-08-31 20:18:48 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2009-08-31 20:18:48 +0000 |
| commit | 13b692aac42bc0e896a31c176daf79920a82ea5e (patch) | |
| tree | a2b1b18ae6e3667afae4ce5f7d3331f7d9188057 /cpp/src/qmf/SequenceManager.h | |
| parent | a7d34ad1929e3d63e5cab290090d60920dfdd32c (diff) | |
| download | qpid-python-13b692aac42bc0e896a31c176daf79920a82ea5e.tar.gz | |
Added protocol module for codepoint definitions and header handling.
Fixed a deadlock case in ResilientConnection.
Added more code to the ConsoleEngine implementation.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@809728 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qmf/SequenceManager.h')
| -rw-r--r-- | cpp/src/qmf/SequenceManager.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/cpp/src/qmf/SequenceManager.h b/cpp/src/qmf/SequenceManager.h new file mode 100644 index 0000000000..c027872313 --- /dev/null +++ b/cpp/src/qmf/SequenceManager.h @@ -0,0 +1,52 @@ +#ifndef _QmfSequenceManager_ +#define _QmfSequenceManager_ + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include "qpid/sys/Mutex.h" +#include <map> + +namespace qmf { + + class SequenceContext { + public: + SequenceContext() {} + virtual ~SequenceContext() {} + + virtual void complete() = 0; + }; + + class SequenceManager { + public: + SequenceManager(); + + uint32_t reserve(SequenceContext* ctx); + void release(uint32_t sequence); + + private: + mutable qpid::sys::Mutex lock; + uint32_t nextSequence; + std::map<uint32_t, SequenceContext*> contextMap; + }; + +} + +#endif + |
