activemq-cpp-3.8.2
StompHelper.h
Go to the documentation of this file.
1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one or more
3  * contributor license agreements. See the NOTICE file distributed with
4  * this work for additional information regarding copyright ownership.
5  * The ASF licenses this file to You under the Apache License, Version 2.0
6  * (the "License"); you may not use this file except in compliance with
7  * the License. You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef _ACTIVEMQ_WIREFORMAT_STOMP_MARSHAL_STOMPHELPER_H_
19 #define _ACTIVEMQ_WIREFORMAT_STOMP_MARSHAL_STOMPHELPER_H_
20 
21 #include <activemq/util/Config.h>
30 #include <decaf/lang/Pointer.h>
31 
32 namespace activemq {
33 namespace wireformat {
34 namespace stomp {
35 
36  class StompWireFormat;
37 
45 
51  class StompHelper {
52  private:
53 
54  activemq::util::LongSequenceGenerator messageIdGenerator;
55  StompWireFormat* wireFormat;
56 
57  private:
58 
59  StompHelper(const StompHelper&);
60  StompHelper& operator=(const StompHelper&);
61 
62  public:
63 
64  StompHelper(StompWireFormat* wireFormat);
65 
66  virtual ~StompHelper();
67 
68  public:
69 
77  void convertProperties(const Pointer<StompFrame>& frame, const Pointer<Message>& message);
78 
86  void convertProperties(const Pointer<Message>& message, const Pointer<StompFrame>& frame);
87 
94  Pointer<ActiveMQDestination> convertDestination(const std::string& destination);
95 
102  std::string convertDestination(const Pointer<ActiveMQDestination>& destination);
103 
110  std::string convertMessageId(const Pointer<MessageId>& messageId);
111 
118  Pointer<MessageId> convertMessageId(const std::string& messageId);
119 
126  std::string convertConsumerId(const Pointer<ConsumerId>& consumerId);
127 
134  Pointer<ConsumerId> convertConsumerId(const std::string& consumerId);
135 
142  std::string convertProducerId(const Pointer<ProducerId>& producerId);
143 
150  Pointer<ProducerId> convertProducerId(const std::string& producerId);
151 
158  std::string convertTransactionId(const Pointer<TransactionId>& transactionId);
159 
166  Pointer<TransactionId> convertTransactionId(const std::string& transactionId);
167 
168  };
169 
170 }}}
171 
172 #endif /* _ACTIVEMQ_WIREFORMAT_STOMP_MARSHAL_STOMPHELPER_H_ */
Definition: ProducerId.h:48
std::string convertConsumerId(const Pointer< ConsumerId > &consumerId)
Converts a ConsumerId instance to a Stomp ConsumerId String.
Pointer< ActiveMQDestination > convertDestination(const std::string &destination)
Converts from a Stomp Destination to an ActiveMQDestination.
Definition: ConsumerId.h:48
void convertProperties(const Pointer< StompFrame > &frame, const Pointer< Message > &message)
Converts the Headers in a Stomp Frame into Headers in the given Message Command.
Definition: TransactionId.h:47
Definition: Message.h:59
Definition: StompWireFormat.h:38
Definition: MessageId.h:49
This class is used to generate a sequence of long long values that are incremented each time a new va...
Definition: LongSequenceGenerator.h:32
std::string convertTransactionId(const Pointer< TransactionId > &transactionId)
Converts a TransactionId instance to a Stomp TransactionId String.
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
Utility Methods used when marshaling to and from StompFrame&#39;s.
Definition: StompHelper.h:51
std::string convertProducerId(const Pointer< ProducerId > &producerId)
Converts a ProducerId instance to a Stomp ProducerId String.
std::string convertMessageId(const Pointer< MessageId > &messageId)
Converts a MessageId instance to a Stomp MessageId String.
Decaf&#39;s implementation of a Smart Pointer that is a template on a Type and is Thread Safe if the defa...
Definition: Pointer.h:53
Definition: ActiveMQDestination.h:38