activemq-cpp-3.3.0

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