00001 /* 00002 * Licensed to the Apache Software Foundation (ASF) under one or more 00003 * contributor license agreements. See the NOTICE file distributed with 00004 * this work for additional information regarding copyright ownership. 00005 * The ASF licenses this file to You under the Apache License, Version 2.0 00006 * (the "License"); you may not use this file except in compliance with 00007 * the License. You may obtain a copy of the License at 00008 * 00009 * http://www.apache.org/licenses/LICENSE-2.0 00010 * 00011 * Unless required by applicable law or agreed to in writing, software 00012 * distributed under the License is distributed on an "AS IS" BASIS, 00013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00014 * See the License for the specific language governing permissions and 00015 * limitations under the License. 00016 */ 00017 00018 #ifndef _ACTIVEMQ_COMMANDS_ACTIVEMQTOPIC_H_ 00019 #define _ACTIVEMQ_COMMANDS_ACTIVEMQTOPIC_H_ 00020 00021 #include <activemq/util/Config.h> 00022 #include <activemq/commands/ActiveMQDestination.h> 00023 #include <activemq/exceptions/ActiveMQException.h> 00024 #include <decaf/lang/Exception.h> 00025 #include <cms/Topic.h> 00026 #include <vector> 00027 #include <string> 00028 #include <memory> 00029 00030 namespace activemq { 00031 namespace commands { 00032 00033 class AMQCPP_API ActiveMQTopic: public ActiveMQDestination, public cms::Topic { 00034 public: 00035 00036 const static unsigned char ID_ACTIVEMQTOPIC = 101; 00037 00038 private: 00039 00040 ActiveMQTopic(const ActiveMQTopic&); 00041 ActiveMQTopic& operator=(const ActiveMQTopic&); 00042 00043 public: 00044 00045 ActiveMQTopic(); 00046 ActiveMQTopic(const std::string& name); 00047 virtual ~ActiveMQTopic() throw (); 00048 00049 virtual unsigned char getDataStructureType() const; 00050 00051 virtual ActiveMQTopic* cloneDataStructure() const; 00052 00053 virtual void copyDataStructure(const DataStructure* src); 00054 00055 virtual std::string toString() const; 00056 00057 virtual bool equals(const DataStructure* value) const; 00058 00059 virtual const cms::Topic* getCMSDestination() const { 00060 return this; 00061 } 00062 00063 public: // CMS Destination 00064 00065 virtual cms::Destination::DestinationType getDestinationType() const { 00066 return cms::Destination::TOPIC; 00067 } 00068 00069 virtual cms::Destination* clone() const { 00070 return dynamic_cast<cms::Destination*>(this->cloneDataStructure()); 00071 } 00072 00073 virtual void copy(const cms::Destination& source) { 00074 this->copyDataStructure(dynamic_cast<const DataStructure*>(&source)); 00075 } 00076 00077 virtual const cms::CMSProperties& getCMSProperties() const { 00078 return this->getOptions(); 00079 } 00080 00081 virtual bool equals(const cms::Destination& other) const; 00082 00083 public: // CMS Topic 00084 00085 virtual std::string getTopicName() const { 00086 return this->getPhysicalName(); 00087 } 00088 00089 }; 00090 00091 }} 00092 00093 #endif /*#define _ACTIVEMQ_COMMANDS_ACTIVEMQTOPIC_H_*/
1.6.1