|
activemq-cpp-3.4.0
|
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 // Turn off warning message for ignored exception specification 00022 #ifdef _MSC_VER 00023 #pragma warning( disable : 4290 ) 00024 #endif 00025 00026 #include <activemq/util/Config.h> 00027 #include <activemq/commands/ActiveMQDestination.h> 00028 #include <activemq/exceptions/ActiveMQException.h> 00029 #include <decaf/lang/Exception.h> 00030 #include <cms/Topic.h> 00031 #include <vector> 00032 #include <string> 00033 #include <memory> 00034 00035 namespace activemq{ 00036 namespace commands{ 00037 00038 class AMQCPP_API ActiveMQTopic : public ActiveMQDestination, 00039 public cms::Topic { 00040 public: 00041 00042 const static unsigned char ID_ACTIVEMQTOPIC = 101; 00043 00044 private: 00045 00046 ActiveMQTopic( const ActiveMQTopic& ); 00047 ActiveMQTopic& operator= ( const ActiveMQTopic& ); 00048 00049 public: 00050 00051 ActiveMQTopic(); 00052 ActiveMQTopic( const std::string& name ); 00053 virtual ~ActiveMQTopic() throw(); 00054 00055 virtual unsigned char getDataStructureType() const; 00056 00057 virtual ActiveMQTopic* cloneDataStructure() const; 00058 00059 virtual void copyDataStructure( const DataStructure* src ); 00060 00061 virtual std::string toString() const; 00062 00063 virtual bool equals( const DataStructure* value ) const; 00064 00065 virtual const cms::Destination* getCMSDestination() const { 00066 return this; 00067 } 00068 00069 public: // CMS Destination 00070 00071 virtual cms::Destination::DestinationType getDestinationType() const { 00072 return cms::Destination::TOPIC; 00073 } 00074 00075 virtual cms::Destination* clone() const { 00076 return dynamic_cast<cms::Destination*>( 00077 this->cloneDataStructure() ); 00078 } 00079 00080 virtual void copy( const cms::Destination& source ) { 00081 this->copyDataStructure( 00082 dynamic_cast<const DataStructure*>( &source ) ); 00083 } 00084 00085 virtual const cms::CMSProperties& getCMSProperties() const { 00086 return this->getOptions(); 00087 } 00088 00089 virtual bool equals( const cms::Destination& other ) const; 00090 00091 public: // CMS Topic 00092 00093 virtual std::string getTopicName() const { 00094 return this->getPhysicalName(); 00095 } 00096 00097 }; 00098 00099 }} 00100 00101 #endif /*#define _ACTIVEMQ_COMMANDS_ACTIVEMQTOPIC_H_*/