activemq-cpp-3.8.2
Command.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_COMMANDS_COMMAND_H_
19 #define _ACTIVEMQ_COMMANDS_COMMAND_H_
20 
21 #include <string>
22 #include <activemq/util/Config.h>
25 #include <decaf/lang/Pointer.h>
26 
27 namespace activemq{
28 namespace state{
29  class CommandVisitor;
30 }
31 namespace commands{
32 
34  public:
35 
36  virtual ~Command() {}
37 
42  virtual void setCommandId( int id ) = 0;
43 
48  virtual int getCommandId() const = 0;
49 
54  virtual void setResponseRequired( const bool required ) = 0;
55 
60  virtual bool isResponseRequired() const = 0;
61 
66  virtual std::string toString() const = 0;
67 
76  activemq::state::CommandVisitor* visitor ) = 0;
77 
78  /*
79  * This section contains a set of short-cut methods for determining if a
80  * Command is of a certain type. These are the most commonly used Commands
81  * and we save several casts and some ugly code by just adding these here.
82  */
83  virtual bool isBrokerInfo() const = 0;
84  virtual bool isControlCommand() const = 0;
85  virtual bool isConnectionControl() const = 0;
86  virtual bool isConnectionInfo() const = 0;
87  virtual bool isConnectionError() const = 0;
88  virtual bool isConsumerInfo() const = 0;
89  virtual bool isConsumerControl() const = 0;
90  virtual bool isDestinationInfo() const = 0;
91  virtual bool isFlushCommand() const = 0;
92  virtual bool isKeepAliveInfo() const = 0;
93  virtual bool isMessage() const = 0;
94  virtual bool isMessageAck() const = 0;
95  virtual bool isMessagePull() const = 0;
96  virtual bool isMessageDispatch() const = 0;
97  virtual bool isMessageDispatchNotification() const = 0;
98  virtual bool isProducerAck() const = 0;
99  virtual bool isProducerInfo() const = 0;
100  virtual bool isResponse() const = 0;
101  virtual bool isReplayCommand() const = 0;
102  virtual bool isRemoveInfo() const = 0;
103  virtual bool isRemoveSubscriptionInfo() const = 0;
104  virtual bool isSessionInfo() const = 0;
105  virtual bool isShutdownInfo() const = 0;
106  virtual bool isTransactionInfo() const = 0;
107  virtual bool isWireFormatInfo() const = 0;
108 
109  };
110 
111 }}
112 
113 #endif /*_ACTIVEMQ_COMMANDS_COMMAND_H_*/
#define AMQCPP_API
Definition: Config.h:30
Definition: BaseDataStructure.h:33
virtual ~Command()
Definition: Command.h:36
Interface for an Object that can visit the various Command Objects that are sent from and to this cli...
Definition: CommandVisitor.h:69
Definition: Command.h:33
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements...
Definition: CachedConsumer.h:24
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