activemq-cpp-3.4.0

src/main/activemq/commands/ActiveMQTempTopic.h

Go to the documentation of this file.
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_ACTIVEMQTEMPTOPIC_H_
00019 #define _ACTIVEMQ_COMMANDS_ACTIVEMQTEMPTOPIC_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/ActiveMQTempDestination.h>
00028 #include <cms/TemporaryTopic.h>
00029 #include <vector>
00030 #include <string>
00031 #include <memory>
00032 
00033 namespace activemq{
00034 namespace commands{
00035 
00036     class AMQCPP_API ActiveMQTempTopic : public ActiveMQTempDestination,
00037                                          public cms::TemporaryTopic {
00038     public:
00039 
00040         const static unsigned char ID_ACTIVEMQTEMPTOPIC = 103;
00041 
00042     private:
00043 
00044         ActiveMQTempTopic( const ActiveMQTempTopic& );
00045         ActiveMQTempTopic& operator= ( const ActiveMQTempTopic& );
00046 
00047     public:
00048 
00049         ActiveMQTempTopic();
00050         ActiveMQTempTopic( const std::string& name );
00051         virtual ~ActiveMQTempTopic() throw();
00052 
00053         virtual unsigned char getDataStructureType() const;
00054 
00055         virtual ActiveMQTempTopic* cloneDataStructure() const;
00056 
00057         virtual void copyDataStructure( const DataStructure* src );
00058 
00059         virtual std::string toString() const;
00060 
00061         virtual bool equals( const DataStructure* value ) const;
00062 
00063         virtual const cms::Destination* getCMSDestination() const {
00064             return this;
00065         }
00066 
00067     public:   // CMS Destination
00068 
00069         virtual cms::Destination::DestinationType getDestinationType() const {
00070             return cms::Destination::TEMPORARY_TOPIC;
00071         }
00072 
00073         virtual cms::Destination* clone() const {
00074             return dynamic_cast<cms::Destination*>(
00075                 this->cloneDataStructure() );
00076         }
00077 
00078         virtual void copy( const cms::Destination& source ) {
00079             this->copyDataStructure(
00080                 dynamic_cast<const DataStructure*>( &source ) );
00081         }
00082 
00083         virtual const cms::CMSProperties& getCMSProperties() const {
00084             return this->getOptions();
00085         }
00086 
00087         virtual bool equals( const cms::Destination& other ) const;
00088 
00089     public:  // CMS Temporary Topic
00090 
00091         virtual std::string getTopicName() const {
00092             return this->getPhysicalName();
00093         }
00094 
00095         virtual void destroy();
00096 
00097     };
00098 
00099 }}
00100 
00101 #endif /*_ACTIVEMQ_COMMANDS_ACTIVEMQTEMPTOPIC_H_*/