Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/Message.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -57,33 +58,33 @@ static const unsigned int DEFAULT_MESSAGE_SIZE = 1024; - ProducerId* producerId; - ActiveMQDestination* destination; - TransactionId* transactionId; - ActiveMQDestination* originalDestination; - MessageId* messageId; - TransactionId* originalTransactionId; + decaf::lang::Pointer producerId; + decaf::lang::Pointer destination; + decaf::lang::Pointer transactionId; + decaf::lang::Pointer originalDestination; + decaf::lang::Pointer messageId; + decaf::lang::Pointer originalTransactionId; std::string groupID; int groupSequence; std::string correlationId; bool persistent; long long expiration; unsigned char priority; - ActiveMQDestination* replyTo; + decaf::lang::Pointer replyTo; long long timestamp; std::string type; std::vector content; std::vector marshalledProperties; - DataStructure* dataStructure; - ConsumerId* targetConsumerId; + decaf::lang::Pointer dataStructure; + decaf::lang::Pointer targetConsumerId; bool compressed; int redeliveryCounter; - std::vector brokerPath; + std::vector< decaf::lang::Pointer > brokerPath; long long arrival; std::string userID; bool recievedByDFBridge; bool droppable; - std::vector cluster; + std::vector< decaf::lang::Pointer > cluster; long long brokerInTime; long long brokerOutTime; @@ -150,32 +151,32 @@ * * @return a Response to the visitor being called or NULL if no response. */ - virtual commands::Command* visit( activemq::state::CommandVisitor* visitor ) + virtual decaf::lang::Pointer visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ); - virtual const ProducerId* getProducerId() const; - virtual ProducerId* getProducerId(); - virtual void setProducerId( ProducerId* producerId ); - - virtual const ActiveMQDestination* getDestination() const; - virtual ActiveMQDestination* getDestination(); - virtual void setDestination( ActiveMQDestination* destination ); - - virtual const TransactionId* getTransactionId() const; - virtual TransactionId* getTransactionId(); - virtual void setTransactionId( TransactionId* transactionId ); - - virtual const ActiveMQDestination* getOriginalDestination() const; - virtual ActiveMQDestination* getOriginalDestination(); - virtual void setOriginalDestination( ActiveMQDestination* originalDestination ); - - virtual const MessageId* getMessageId() const; - virtual MessageId* getMessageId(); - virtual void setMessageId( MessageId* messageId ); - - virtual const TransactionId* getOriginalTransactionId() const; - virtual TransactionId* getOriginalTransactionId(); - virtual void setOriginalTransactionId( TransactionId* originalTransactionId ); + virtual const decaf::lang::Pointer& getProducerId() const; + virtual decaf::lang::Pointer& getProducerId(); + virtual void setProducerId( const decaf::lang::Pointer& producerId ); + + virtual const decaf::lang::Pointer& getDestination() const; + virtual decaf::lang::Pointer& getDestination(); + virtual void setDestination( const decaf::lang::Pointer& destination ); + + virtual const decaf::lang::Pointer& getTransactionId() const; + virtual decaf::lang::Pointer& getTransactionId(); + virtual void setTransactionId( const decaf::lang::Pointer& transactionId ); + + virtual const decaf::lang::Pointer& getOriginalDestination() const; + virtual decaf::lang::Pointer& getOriginalDestination(); + virtual void setOriginalDestination( const decaf::lang::Pointer& originalDestination ); + + virtual const decaf::lang::Pointer& getMessageId() const; + virtual decaf::lang::Pointer& getMessageId(); + virtual void setMessageId( const decaf::lang::Pointer& messageId ); + + virtual const decaf::lang::Pointer& getOriginalTransactionId() const; + virtual decaf::lang::Pointer& getOriginalTransactionId(); + virtual void setOriginalTransactionId( const decaf::lang::Pointer& originalTransactionId ); virtual const std::string& getGroupID() const; virtual std::string& getGroupID(); @@ -197,9 +198,9 @@ virtual unsigned char getPriority() const; virtual void setPriority( unsigned char priority ); - virtual const ActiveMQDestination* getReplyTo() const; - virtual ActiveMQDestination* getReplyTo(); - virtual void setReplyTo( ActiveMQDestination* replyTo ); + virtual const decaf::lang::Pointer& getReplyTo() const; + virtual decaf::lang::Pointer& getReplyTo(); + virtual void setReplyTo( const decaf::lang::Pointer& replyTo ); virtual long long getTimestamp() const; virtual void setTimestamp( long long timestamp ); @@ -216,13 +217,13 @@ virtual std::vector& getMarshalledProperties(); virtual void setMarshalledProperties( const std::vector& marshalledProperties ); - virtual const DataStructure* getDataStructure() const; - virtual DataStructure* getDataStructure(); - virtual void setDataStructure( DataStructure* dataStructure ); - - virtual const ConsumerId* getTargetConsumerId() const; - virtual ConsumerId* getTargetConsumerId(); - virtual void setTargetConsumerId( ConsumerId* targetConsumerId ); + virtual const decaf::lang::Pointer& getDataStructure() const; + virtual decaf::lang::Pointer& getDataStructure(); + virtual void setDataStructure( const decaf::lang::Pointer& dataStructure ); + + virtual const decaf::lang::Pointer& getTargetConsumerId() const; + virtual decaf::lang::Pointer& getTargetConsumerId(); + virtual void setTargetConsumerId( const decaf::lang::Pointer& targetConsumerId ); virtual bool isCompressed() const; virtual void setCompressed( bool compressed ); @@ -230,9 +231,9 @@ virtual int getRedeliveryCounter() const; virtual void setRedeliveryCounter( int redeliveryCounter ); - virtual const std::vector& getBrokerPath() const; - virtual std::vector& getBrokerPath(); - virtual void setBrokerPath( const std::vector& brokerPath ); + virtual const std::vector< decaf::lang::Pointer >& getBrokerPath() const; + virtual std::vector< decaf::lang::Pointer >& getBrokerPath(); + virtual void setBrokerPath( const std::vector< decaf::lang::Pointer >& brokerPath ); virtual long long getArrival() const; virtual void setArrival( long long arrival ); @@ -247,9 +248,9 @@ virtual bool isDroppable() const; virtual void setDroppable( bool droppable ); - virtual const std::vector& getCluster() const; - virtual std::vector& getCluster(); - virtual void setCluster( const std::vector& cluster ); + virtual const std::vector< decaf::lang::Pointer >& getCluster() const; + virtual std::vector< decaf::lang::Pointer >& getCluster(); + virtual void setCluster( const std::vector< decaf::lang::Pointer >& cluster ); virtual long long getBrokerInTime() const; virtual void setBrokerInTime( long long brokerInTime ); Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.cpp?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.cpp Fri Feb 6 23:11:28 2009 @@ -38,33 +38,23 @@ //////////////////////////////////////////////////////////////////////////////// MessageAck::MessageAck() { - this->destination = NULL; - this->transactionId = NULL; - this->consumerId = NULL; this->ackType = 0; - this->firstMessageId = NULL; - this->lastMessageId = NULL; this->messageCount = 0; } //////////////////////////////////////////////////////////////////////////////// MessageAck::~MessageAck() { - delete this->destination; - delete this->transactionId; - delete this->consumerId; - delete this->firstMessageId; - delete this->lastMessageId; } //////////////////////////////////////////////////////////////////////////////// MessageAck* MessageAck::cloneDataStructure() const { - MessageAck* messageAck = new MessageAck(); + std::auto_ptr messageAck( new MessageAck() ); // Copy the data from the base class or classes messageAck->copyDataStructure( this ); - return messageAck; + return messageAck.release(); } //////////////////////////////////////////////////////////////////////////////// @@ -85,32 +75,12 @@ __FILE__, __LINE__, "MessageAck::copyDataStructure - src is NULL or invalid" ); } - if( srcPtr->getDestination() != NULL ) { - this->setDestination( - dynamic_cast( - srcPtr->getDestination()->cloneDataStructure() ) ); - } - if( srcPtr->getTransactionId() != NULL ) { - this->setTransactionId( - dynamic_cast( - srcPtr->getTransactionId()->cloneDataStructure() ) ); - } - if( srcPtr->getConsumerId() != NULL ) { - this->setConsumerId( - dynamic_cast( - srcPtr->getConsumerId()->cloneDataStructure() ) ); - } + this->setDestination( srcPtr->getDestination() ); + this->setTransactionId( srcPtr->getTransactionId() ); + this->setConsumerId( srcPtr->getConsumerId() ); this->setAckType( srcPtr->getAckType() ); - if( srcPtr->getFirstMessageId() != NULL ) { - this->setFirstMessageId( - dynamic_cast( - srcPtr->getFirstMessageId()->cloneDataStructure() ) ); - } - if( srcPtr->getLastMessageId() != NULL ) { - this->setLastMessageId( - dynamic_cast( - srcPtr->getLastMessageId()->cloneDataStructure() ) ); - } + this->setFirstMessageId( srcPtr->getFirstMessageId() ); + this->setLastMessageId( srcPtr->getLastMessageId() ); this->setMessageCount( srcPtr->getMessageCount() ); } @@ -177,21 +147,21 @@ return false; } if( this->getDestination() != NULL ) { - if( !this->getDestination()->equals( valuePtr->getDestination() ) ) { + if( !this->getDestination()->equals( valuePtr->getDestination().get() ) ) { return false; } } else if( valuePtr->getDestination() != NULL ) { return false; } if( this->getTransactionId() != NULL ) { - if( !this->getTransactionId()->equals( valuePtr->getTransactionId() ) ) { + if( !this->getTransactionId()->equals( valuePtr->getTransactionId().get() ) ) { return false; } } else if( valuePtr->getTransactionId() != NULL ) { return false; } if( this->getConsumerId() != NULL ) { - if( !this->getConsumerId()->equals( valuePtr->getConsumerId() ) ) { + if( !this->getConsumerId()->equals( valuePtr->getConsumerId().get() ) ) { return false; } } else if( valuePtr->getConsumerId() != NULL ) { @@ -201,14 +171,14 @@ return false; } if( this->getFirstMessageId() != NULL ) { - if( !this->getFirstMessageId()->equals( valuePtr->getFirstMessageId() ) ) { + if( !this->getFirstMessageId()->equals( valuePtr->getFirstMessageId().get() ) ) { return false; } } else if( valuePtr->getFirstMessageId() != NULL ) { return false; } if( this->getLastMessageId() != NULL ) { - if( !this->getLastMessageId()->equals( valuePtr->getLastMessageId() ) ) { + if( !this->getLastMessageId()->equals( valuePtr->getLastMessageId().get() ) ) { return false; } } else if( valuePtr->getLastMessageId() != NULL ) { @@ -224,54 +194,54 @@ } //////////////////////////////////////////////////////////////////////////////// -commands::Command* MessageAck::visit( activemq::state::CommandVisitor* visitor ) +decaf::lang::Pointer MessageAck::visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ) { return visitor->processMessageAck( this ); } //////////////////////////////////////////////////////////////////////////////// -const ActiveMQDestination* MessageAck::getDestination() const { +const decaf::lang::Pointer& MessageAck::getDestination() const { return destination; } //////////////////////////////////////////////////////////////////////////////// -ActiveMQDestination* MessageAck::getDestination() { +decaf::lang::Pointer& MessageAck::getDestination() { return destination; } //////////////////////////////////////////////////////////////////////////////// -void MessageAck::setDestination( ActiveMQDestination* destination ) { +void MessageAck::setDestination( const decaf::lang::Pointer& destination ) { this->destination = destination; } //////////////////////////////////////////////////////////////////////////////// -const TransactionId* MessageAck::getTransactionId() const { +const decaf::lang::Pointer& MessageAck::getTransactionId() const { return transactionId; } //////////////////////////////////////////////////////////////////////////////// -TransactionId* MessageAck::getTransactionId() { +decaf::lang::Pointer& MessageAck::getTransactionId() { return transactionId; } //////////////////////////////////////////////////////////////////////////////// -void MessageAck::setTransactionId( TransactionId* transactionId ) { +void MessageAck::setTransactionId( const decaf::lang::Pointer& transactionId ) { this->transactionId = transactionId; } //////////////////////////////////////////////////////////////////////////////// -const ConsumerId* MessageAck::getConsumerId() const { +const decaf::lang::Pointer& MessageAck::getConsumerId() const { return consumerId; } //////////////////////////////////////////////////////////////////////////////// -ConsumerId* MessageAck::getConsumerId() { +decaf::lang::Pointer& MessageAck::getConsumerId() { return consumerId; } //////////////////////////////////////////////////////////////////////////////// -void MessageAck::setConsumerId( ConsumerId* consumerId ) { +void MessageAck::setConsumerId( const decaf::lang::Pointer& consumerId ) { this->consumerId = consumerId; } @@ -286,32 +256,32 @@ } //////////////////////////////////////////////////////////////////////////////// -const MessageId* MessageAck::getFirstMessageId() const { +const decaf::lang::Pointer& MessageAck::getFirstMessageId() const { return firstMessageId; } //////////////////////////////////////////////////////////////////////////////// -MessageId* MessageAck::getFirstMessageId() { +decaf::lang::Pointer& MessageAck::getFirstMessageId() { return firstMessageId; } //////////////////////////////////////////////////////////////////////////////// -void MessageAck::setFirstMessageId( MessageId* firstMessageId ) { +void MessageAck::setFirstMessageId( const decaf::lang::Pointer& firstMessageId ) { this->firstMessageId = firstMessageId; } //////////////////////////////////////////////////////////////////////////////// -const MessageId* MessageAck::getLastMessageId() const { +const decaf::lang::Pointer& MessageAck::getLastMessageId() const { return lastMessageId; } //////////////////////////////////////////////////////////////////////////////// -MessageId* MessageAck::getLastMessageId() { +decaf::lang::Pointer& MessageAck::getLastMessageId() { return lastMessageId; } //////////////////////////////////////////////////////////////////////////////// -void MessageAck::setLastMessageId( MessageId* lastMessageId ) { +void MessageAck::setLastMessageId( const decaf::lang::Pointer& lastMessageId ) { this->lastMessageId = lastMessageId; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageAck.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -49,12 +50,12 @@ class AMQCPP_API MessageAck : public BaseCommand { protected: - ActiveMQDestination* destination; - TransactionId* transactionId; - ConsumerId* consumerId; + decaf::lang::Pointer destination; + decaf::lang::Pointer transactionId; + decaf::lang::Pointer consumerId; unsigned char ackType; - MessageId* firstMessageId; - MessageId* lastMessageId; + decaf::lang::Pointer firstMessageId; + decaf::lang::Pointer lastMessageId; int messageCount; protected: @@ -114,31 +115,31 @@ * * @return a Response to the visitor being called or NULL if no response. */ - virtual commands::Command* visit( activemq::state::CommandVisitor* visitor ) + virtual decaf::lang::Pointer visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ); - virtual const ActiveMQDestination* getDestination() const; - virtual ActiveMQDestination* getDestination(); - virtual void setDestination( ActiveMQDestination* destination ); - - virtual const TransactionId* getTransactionId() const; - virtual TransactionId* getTransactionId(); - virtual void setTransactionId( TransactionId* transactionId ); - - virtual const ConsumerId* getConsumerId() const; - virtual ConsumerId* getConsumerId(); - virtual void setConsumerId( ConsumerId* consumerId ); + virtual const decaf::lang::Pointer& getDestination() const; + virtual decaf::lang::Pointer& getDestination(); + virtual void setDestination( const decaf::lang::Pointer& destination ); + + virtual const decaf::lang::Pointer& getTransactionId() const; + virtual decaf::lang::Pointer& getTransactionId(); + virtual void setTransactionId( const decaf::lang::Pointer& transactionId ); + + virtual const decaf::lang::Pointer& getConsumerId() const; + virtual decaf::lang::Pointer& getConsumerId(); + virtual void setConsumerId( const decaf::lang::Pointer& consumerId ); virtual unsigned char getAckType() const; virtual void setAckType( unsigned char ackType ); - virtual const MessageId* getFirstMessageId() const; - virtual MessageId* getFirstMessageId(); - virtual void setFirstMessageId( MessageId* firstMessageId ); - - virtual const MessageId* getLastMessageId() const; - virtual MessageId* getLastMessageId(); - virtual void setLastMessageId( MessageId* lastMessageId ); + virtual const decaf::lang::Pointer& getFirstMessageId() const; + virtual decaf::lang::Pointer& getFirstMessageId(); + virtual void setFirstMessageId( const decaf::lang::Pointer& firstMessageId ); + + virtual const decaf::lang::Pointer& getLastMessageId() const; + virtual decaf::lang::Pointer& getLastMessageId(); + virtual void setLastMessageId( const decaf::lang::Pointer& lastMessageId ); virtual int getMessageCount() const; virtual void setMessageCount( int messageCount ); Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.cpp?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.cpp Fri Feb 6 23:11:28 2009 @@ -38,28 +38,22 @@ //////////////////////////////////////////////////////////////////////////////// MessageDispatch::MessageDispatch() { - this->consumerId = NULL; - this->destination = NULL; - this->message = NULL; this->redeliveryCounter = 0; } //////////////////////////////////////////////////////////////////////////////// MessageDispatch::~MessageDispatch() { - delete this->consumerId; - delete this->destination; - delete this->message; } //////////////////////////////////////////////////////////////////////////////// MessageDispatch* MessageDispatch::cloneDataStructure() const { - MessageDispatch* messageDispatch = new MessageDispatch(); + std::auto_ptr messageDispatch( new MessageDispatch() ); // Copy the data from the base class or classes messageDispatch->copyDataStructure( this ); - return messageDispatch; + return messageDispatch.release(); } //////////////////////////////////////////////////////////////////////////////// @@ -80,21 +74,9 @@ __FILE__, __LINE__, "MessageDispatch::copyDataStructure - src is NULL or invalid" ); } - if( srcPtr->getConsumerId() != NULL ) { - this->setConsumerId( - dynamic_cast( - srcPtr->getConsumerId()->cloneDataStructure() ) ); - } - if( srcPtr->getDestination() != NULL ) { - this->setDestination( - dynamic_cast( - srcPtr->getDestination()->cloneDataStructure() ) ); - } - if( srcPtr->getMessage() != NULL ) { - this->setMessage( - dynamic_cast( - srcPtr->getMessage()->cloneDataStructure() ) ); - } + this->setConsumerId( srcPtr->getConsumerId() ); + this->setDestination( srcPtr->getDestination() ); + this->setMessage( srcPtr->getMessage() ); this->setRedeliveryCounter( srcPtr->getRedeliveryCounter() ); } @@ -148,21 +130,21 @@ return false; } if( this->getConsumerId() != NULL ) { - if( !this->getConsumerId()->equals( valuePtr->getConsumerId() ) ) { + if( !this->getConsumerId()->equals( valuePtr->getConsumerId().get() ) ) { return false; } } else if( valuePtr->getConsumerId() != NULL ) { return false; } if( this->getDestination() != NULL ) { - if( !this->getDestination()->equals( valuePtr->getDestination() ) ) { + if( !this->getDestination()->equals( valuePtr->getDestination().get() ) ) { return false; } } else if( valuePtr->getDestination() != NULL ) { return false; } if( this->getMessage() != NULL ) { - if( !this->getMessage()->equals( valuePtr->getMessage() ) ) { + if( !this->getMessage()->equals( valuePtr->getMessage().get() ) ) { return false; } } else if( valuePtr->getMessage() != NULL ) { @@ -178,54 +160,54 @@ } //////////////////////////////////////////////////////////////////////////////// -commands::Command* MessageDispatch::visit( activemq::state::CommandVisitor* visitor ) +decaf::lang::Pointer MessageDispatch::visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ) { return visitor->processMessageDispatch( this ); } //////////////////////////////////////////////////////////////////////////////// -const ConsumerId* MessageDispatch::getConsumerId() const { +const decaf::lang::Pointer& MessageDispatch::getConsumerId() const { return consumerId; } //////////////////////////////////////////////////////////////////////////////// -ConsumerId* MessageDispatch::getConsumerId() { +decaf::lang::Pointer& MessageDispatch::getConsumerId() { return consumerId; } //////////////////////////////////////////////////////////////////////////////// -void MessageDispatch::setConsumerId( ConsumerId* consumerId ) { +void MessageDispatch::setConsumerId( const decaf::lang::Pointer& consumerId ) { this->consumerId = consumerId; } //////////////////////////////////////////////////////////////////////////////// -const ActiveMQDestination* MessageDispatch::getDestination() const { +const decaf::lang::Pointer& MessageDispatch::getDestination() const { return destination; } //////////////////////////////////////////////////////////////////////////////// -ActiveMQDestination* MessageDispatch::getDestination() { +decaf::lang::Pointer& MessageDispatch::getDestination() { return destination; } //////////////////////////////////////////////////////////////////////////////// -void MessageDispatch::setDestination( ActiveMQDestination* destination ) { +void MessageDispatch::setDestination( const decaf::lang::Pointer& destination ) { this->destination = destination; } //////////////////////////////////////////////////////////////////////////////// -const Message* MessageDispatch::getMessage() const { +const decaf::lang::Pointer& MessageDispatch::getMessage() const { return message; } //////////////////////////////////////////////////////////////////////////////// -Message* MessageDispatch::getMessage() { +decaf::lang::Pointer& MessageDispatch::getMessage() { return message; } //////////////////////////////////////////////////////////////////////////////// -void MessageDispatch::setMessage( Message* message ) { +void MessageDispatch::setMessage( const decaf::lang::Pointer& message ) { this->message = message; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatch.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -47,9 +48,9 @@ class AMQCPP_API MessageDispatch : public BaseCommand { protected: - ConsumerId* consumerId; - ActiveMQDestination* destination; - Message* message; + decaf::lang::Pointer consumerId; + decaf::lang::Pointer destination; + decaf::lang::Pointer message; int redeliveryCounter; protected: @@ -109,20 +110,20 @@ * * @return a Response to the visitor being called or NULL if no response. */ - virtual commands::Command* visit( activemq::state::CommandVisitor* visitor ) + virtual decaf::lang::Pointer visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ); - virtual const ConsumerId* getConsumerId() const; - virtual ConsumerId* getConsumerId(); - virtual void setConsumerId( ConsumerId* consumerId ); - - virtual const ActiveMQDestination* getDestination() const; - virtual ActiveMQDestination* getDestination(); - virtual void setDestination( ActiveMQDestination* destination ); - - virtual const Message* getMessage() const; - virtual Message* getMessage(); - virtual void setMessage( Message* message ); + virtual const decaf::lang::Pointer& getConsumerId() const; + virtual decaf::lang::Pointer& getConsumerId(); + virtual void setConsumerId( const decaf::lang::Pointer& consumerId ); + + virtual const decaf::lang::Pointer& getDestination() const; + virtual decaf::lang::Pointer& getDestination(); + virtual void setDestination( const decaf::lang::Pointer& destination ); + + virtual const decaf::lang::Pointer& getMessage() const; + virtual decaf::lang::Pointer& getMessage(); + virtual void setMessage( const decaf::lang::Pointer& message ); virtual int getRedeliveryCounter() const; virtual void setRedeliveryCounter( int redeliveryCounter ); Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.cpp?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.cpp Fri Feb 6 23:11:28 2009 @@ -38,28 +38,22 @@ //////////////////////////////////////////////////////////////////////////////// MessageDispatchNotification::MessageDispatchNotification() { - this->consumerId = NULL; - this->destination = NULL; this->deliverySequenceId = 0; - this->messageId = NULL; } //////////////////////////////////////////////////////////////////////////////// MessageDispatchNotification::~MessageDispatchNotification() { - delete this->consumerId; - delete this->destination; - delete this->messageId; } //////////////////////////////////////////////////////////////////////////////// MessageDispatchNotification* MessageDispatchNotification::cloneDataStructure() const { - MessageDispatchNotification* messageDispatchNotification = new MessageDispatchNotification(); + std::auto_ptr messageDispatchNotification( new MessageDispatchNotification() ); // Copy the data from the base class or classes messageDispatchNotification->copyDataStructure( this ); - return messageDispatchNotification; + return messageDispatchNotification.release(); } //////////////////////////////////////////////////////////////////////////////// @@ -80,22 +74,10 @@ __FILE__, __LINE__, "MessageDispatchNotification::copyDataStructure - src is NULL or invalid" ); } - if( srcPtr->getConsumerId() != NULL ) { - this->setConsumerId( - dynamic_cast( - srcPtr->getConsumerId()->cloneDataStructure() ) ); - } - if( srcPtr->getDestination() != NULL ) { - this->setDestination( - dynamic_cast( - srcPtr->getDestination()->cloneDataStructure() ) ); - } + this->setConsumerId( srcPtr->getConsumerId() ); + this->setDestination( srcPtr->getDestination() ); this->setDeliverySequenceId( srcPtr->getDeliverySequenceId() ); - if( srcPtr->getMessageId() != NULL ) { - this->setMessageId( - dynamic_cast( - srcPtr->getMessageId()->cloneDataStructure() ) ); - } + this->setMessageId( srcPtr->getMessageId() ); } //////////////////////////////////////////////////////////////////////////////// @@ -148,14 +130,14 @@ return false; } if( this->getConsumerId() != NULL ) { - if( !this->getConsumerId()->equals( valuePtr->getConsumerId() ) ) { + if( !this->getConsumerId()->equals( valuePtr->getConsumerId().get() ) ) { return false; } } else if( valuePtr->getConsumerId() != NULL ) { return false; } if( this->getDestination() != NULL ) { - if( !this->getDestination()->equals( valuePtr->getDestination() ) ) { + if( !this->getDestination()->equals( valuePtr->getDestination().get() ) ) { return false; } } else if( valuePtr->getDestination() != NULL ) { @@ -165,7 +147,7 @@ return false; } if( this->getMessageId() != NULL ) { - if( !this->getMessageId()->equals( valuePtr->getMessageId() ) ) { + if( !this->getMessageId()->equals( valuePtr->getMessageId().get() ) ) { return false; } } else if( valuePtr->getMessageId() != NULL ) { @@ -178,39 +160,39 @@ } //////////////////////////////////////////////////////////////////////////////// -commands::Command* MessageDispatchNotification::visit( activemq::state::CommandVisitor* visitor ) +decaf::lang::Pointer MessageDispatchNotification::visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ) { return visitor->processMessageDispatchNotification( this ); } //////////////////////////////////////////////////////////////////////////////// -const ConsumerId* MessageDispatchNotification::getConsumerId() const { +const decaf::lang::Pointer& MessageDispatchNotification::getConsumerId() const { return consumerId; } //////////////////////////////////////////////////////////////////////////////// -ConsumerId* MessageDispatchNotification::getConsumerId() { +decaf::lang::Pointer& MessageDispatchNotification::getConsumerId() { return consumerId; } //////////////////////////////////////////////////////////////////////////////// -void MessageDispatchNotification::setConsumerId( ConsumerId* consumerId ) { +void MessageDispatchNotification::setConsumerId( const decaf::lang::Pointer& consumerId ) { this->consumerId = consumerId; } //////////////////////////////////////////////////////////////////////////////// -const ActiveMQDestination* MessageDispatchNotification::getDestination() const { +const decaf::lang::Pointer& MessageDispatchNotification::getDestination() const { return destination; } //////////////////////////////////////////////////////////////////////////////// -ActiveMQDestination* MessageDispatchNotification::getDestination() { +decaf::lang::Pointer& MessageDispatchNotification::getDestination() { return destination; } //////////////////////////////////////////////////////////////////////////////// -void MessageDispatchNotification::setDestination( ActiveMQDestination* destination ) { +void MessageDispatchNotification::setDestination( const decaf::lang::Pointer& destination ) { this->destination = destination; } @@ -225,17 +207,17 @@ } //////////////////////////////////////////////////////////////////////////////// -const MessageId* MessageDispatchNotification::getMessageId() const { +const decaf::lang::Pointer& MessageDispatchNotification::getMessageId() const { return messageId; } //////////////////////////////////////////////////////////////////////////////// -MessageId* MessageDispatchNotification::getMessageId() { +decaf::lang::Pointer& MessageDispatchNotification::getMessageId() { return messageId; } //////////////////////////////////////////////////////////////////////////////// -void MessageDispatchNotification::setMessageId( MessageId* messageId ) { +void MessageDispatchNotification::setMessageId( const decaf::lang::Pointer& messageId ) { this->messageId = messageId; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageDispatchNotification.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -47,10 +48,10 @@ class AMQCPP_API MessageDispatchNotification : public BaseCommand { protected: - ConsumerId* consumerId; - ActiveMQDestination* destination; + decaf::lang::Pointer consumerId; + decaf::lang::Pointer destination; long long deliverySequenceId; - MessageId* messageId; + decaf::lang::Pointer messageId; protected: @@ -109,23 +110,23 @@ * * @return a Response to the visitor being called or NULL if no response. */ - virtual commands::Command* visit( activemq::state::CommandVisitor* visitor ) + virtual decaf::lang::Pointer visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ); - virtual const ConsumerId* getConsumerId() const; - virtual ConsumerId* getConsumerId(); - virtual void setConsumerId( ConsumerId* consumerId ); - - virtual const ActiveMQDestination* getDestination() const; - virtual ActiveMQDestination* getDestination(); - virtual void setDestination( ActiveMQDestination* destination ); + virtual const decaf::lang::Pointer& getConsumerId() const; + virtual decaf::lang::Pointer& getConsumerId(); + virtual void setConsumerId( const decaf::lang::Pointer& consumerId ); + + virtual const decaf::lang::Pointer& getDestination() const; + virtual decaf::lang::Pointer& getDestination(); + virtual void setDestination( const decaf::lang::Pointer& destination ); virtual long long getDeliverySequenceId() const; virtual void setDeliverySequenceId( long long deliverySequenceId ); - virtual const MessageId* getMessageId() const; - virtual MessageId* getMessageId(); - virtual void setMessageId( MessageId* messageId ); + virtual const decaf::lang::Pointer& getMessageId() const; + virtual decaf::lang::Pointer& getMessageId(); + virtual void setMessageId( const decaf::lang::Pointer& messageId ); }; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.cpp?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.cpp Fri Feb 6 23:11:28 2009 @@ -39,7 +39,6 @@ //////////////////////////////////////////////////////////////////////////////// MessageId::MessageId() { - this->producerId = NULL; this->producerSequenceId = 0; this->brokerSequenceId = 0; } @@ -52,17 +51,16 @@ //////////////////////////////////////////////////////////////////////////////// MessageId::~MessageId() { - delete this->producerId; } //////////////////////////////////////////////////////////////////////////////// MessageId* MessageId::cloneDataStructure() const { - MessageId* messageId = new MessageId(); + std::auto_ptr messageId( new MessageId() ); // Copy the data from the base class or classes messageId->copyDataStructure( this ); - return messageId; + return messageId.release(); } //////////////////////////////////////////////////////////////////////////////// @@ -83,11 +81,7 @@ __FILE__, __LINE__, "MessageId::copyDataStructure - src is NULL or invalid" ); } - if( srcPtr->getProducerId() != NULL ) { - this->setProducerId( - dynamic_cast( - srcPtr->getProducerId()->cloneDataStructure() ) ); - } + this->setProducerId( srcPtr->getProducerId() ); this->setProducerSequenceId( srcPtr->getProducerSequenceId() ); this->setBrokerSequenceId( srcPtr->getBrokerSequenceId() ); } @@ -131,7 +125,7 @@ return false; } if( this->getProducerId() != NULL ) { - if( !this->getProducerId()->equals( valuePtr->getProducerId() ) ) { + if( !this->getProducerId()->equals( valuePtr->getProducerId().get() ) ) { return false; } } else if( valuePtr->getProducerId() != NULL ) { @@ -150,17 +144,17 @@ } //////////////////////////////////////////////////////////////////////////////// -const ProducerId* MessageId::getProducerId() const { +const decaf::lang::Pointer& MessageId::getProducerId() const { return producerId; } //////////////////////////////////////////////////////////////////////////////// -ProducerId* MessageId::getProducerId() { +decaf::lang::Pointer& MessageId::getProducerId() { return producerId; } //////////////////////////////////////////////////////////////////////////////// -void MessageId::setProducerId( ProducerId* producerId ) { +void MessageId::setProducerId( const decaf::lang::Pointer& producerId ) { this->producerId = producerId; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessageId.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -46,7 +47,7 @@ class AMQCPP_API MessageId : public BaseDataStructure, public decaf::lang::Comparable { protected: - ProducerId* producerId; + decaf::lang::Pointer producerId; long long producerSequenceId; long long brokerSequenceId; @@ -54,6 +55,8 @@ const static unsigned char ID_MESSAGEID = 110; + typedef decaf::lang::PointerComparator COMPARATOR; + public: MessageId(); @@ -96,9 +99,9 @@ */ virtual bool equals( const DataStructure* value ) const; - virtual const ProducerId* getProducerId() const; - virtual ProducerId* getProducerId(); - virtual void setProducerId( ProducerId* producerId ); + virtual const decaf::lang::Pointer& getProducerId() const; + virtual decaf::lang::Pointer& getProducerId(); + virtual void setProducerId( const decaf::lang::Pointer& producerId ); virtual long long getProducerSequenceId() const; virtual void setProducerSequenceId( long long producerSequenceId ); Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.cpp?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.cpp Fri Feb 6 23:11:28 2009 @@ -38,29 +38,23 @@ //////////////////////////////////////////////////////////////////////////////// MessagePull::MessagePull() { - this->consumerId = NULL; - this->destination = NULL; this->timeout = 0; this->correlationId = ""; - this->messageId = NULL; } //////////////////////////////////////////////////////////////////////////////// MessagePull::~MessagePull() { - delete this->consumerId; - delete this->destination; - delete this->messageId; } //////////////////////////////////////////////////////////////////////////////// MessagePull* MessagePull::cloneDataStructure() const { - MessagePull* messagePull = new MessagePull(); + std::auto_ptr messagePull( new MessagePull() ); // Copy the data from the base class or classes messagePull->copyDataStructure( this ); - return messagePull; + return messagePull.release(); } //////////////////////////////////////////////////////////////////////////////// @@ -81,23 +75,11 @@ __FILE__, __LINE__, "MessagePull::copyDataStructure - src is NULL or invalid" ); } - if( srcPtr->getConsumerId() != NULL ) { - this->setConsumerId( - dynamic_cast( - srcPtr->getConsumerId()->cloneDataStructure() ) ); - } - if( srcPtr->getDestination() != NULL ) { - this->setDestination( - dynamic_cast( - srcPtr->getDestination()->cloneDataStructure() ) ); - } + this->setConsumerId( srcPtr->getConsumerId() ); + this->setDestination( srcPtr->getDestination() ); this->setTimeout( srcPtr->getTimeout() ); this->setCorrelationId( srcPtr->getCorrelationId() ); - if( srcPtr->getMessageId() != NULL ) { - this->setMessageId( - dynamic_cast( - srcPtr->getMessageId()->cloneDataStructure() ) ); - } + this->setMessageId( srcPtr->getMessageId() ); } //////////////////////////////////////////////////////////////////////////////// @@ -151,14 +133,14 @@ return false; } if( this->getConsumerId() != NULL ) { - if( !this->getConsumerId()->equals( valuePtr->getConsumerId() ) ) { + if( !this->getConsumerId()->equals( valuePtr->getConsumerId().get() ) ) { return false; } } else if( valuePtr->getConsumerId() != NULL ) { return false; } if( this->getDestination() != NULL ) { - if( !this->getDestination()->equals( valuePtr->getDestination() ) ) { + if( !this->getDestination()->equals( valuePtr->getDestination().get() ) ) { return false; } } else if( valuePtr->getDestination() != NULL ) { @@ -171,7 +153,7 @@ return false; } if( this->getMessageId() != NULL ) { - if( !this->getMessageId()->equals( valuePtr->getMessageId() ) ) { + if( !this->getMessageId()->equals( valuePtr->getMessageId().get() ) ) { return false; } } else if( valuePtr->getMessageId() != NULL ) { @@ -184,39 +166,39 @@ } //////////////////////////////////////////////////////////////////////////////// -commands::Command* MessagePull::visit( activemq::state::CommandVisitor* visitor ) +decaf::lang::Pointer MessagePull::visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ) { return visitor->processMessagePull( this ); } //////////////////////////////////////////////////////////////////////////////// -const ConsumerId* MessagePull::getConsumerId() const { +const decaf::lang::Pointer& MessagePull::getConsumerId() const { return consumerId; } //////////////////////////////////////////////////////////////////////////////// -ConsumerId* MessagePull::getConsumerId() { +decaf::lang::Pointer& MessagePull::getConsumerId() { return consumerId; } //////////////////////////////////////////////////////////////////////////////// -void MessagePull::setConsumerId( ConsumerId* consumerId ) { +void MessagePull::setConsumerId( const decaf::lang::Pointer& consumerId ) { this->consumerId = consumerId; } //////////////////////////////////////////////////////////////////////////////// -const ActiveMQDestination* MessagePull::getDestination() const { +const decaf::lang::Pointer& MessagePull::getDestination() const { return destination; } //////////////////////////////////////////////////////////////////////////////// -ActiveMQDestination* MessagePull::getDestination() { +decaf::lang::Pointer& MessagePull::getDestination() { return destination; } //////////////////////////////////////////////////////////////////////////////// -void MessagePull::setDestination( ActiveMQDestination* destination ) { +void MessagePull::setDestination( const decaf::lang::Pointer& destination ) { this->destination = destination; } @@ -246,17 +228,17 @@ } //////////////////////////////////////////////////////////////////////////////// -const MessageId* MessagePull::getMessageId() const { +const decaf::lang::Pointer& MessagePull::getMessageId() const { return messageId; } //////////////////////////////////////////////////////////////////////////////// -MessageId* MessagePull::getMessageId() { +decaf::lang::Pointer& MessagePull::getMessageId() { return messageId; } //////////////////////////////////////////////////////////////////////////////// -void MessagePull::setMessageId( MessageId* messageId ) { +void MessagePull::setMessageId( const decaf::lang::Pointer& messageId ) { this->messageId = messageId; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/MessagePull.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -47,11 +48,11 @@ class AMQCPP_API MessagePull : public BaseCommand { protected: - ConsumerId* consumerId; - ActiveMQDestination* destination; + decaf::lang::Pointer consumerId; + decaf::lang::Pointer destination; long long timeout; std::string correlationId; - MessageId* messageId; + decaf::lang::Pointer messageId; protected: @@ -110,16 +111,16 @@ * * @return a Response to the visitor being called or NULL if no response. */ - virtual commands::Command* visit( activemq::state::CommandVisitor* visitor ) + virtual decaf::lang::Pointer visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ); - virtual const ConsumerId* getConsumerId() const; - virtual ConsumerId* getConsumerId(); - virtual void setConsumerId( ConsumerId* consumerId ); - - virtual const ActiveMQDestination* getDestination() const; - virtual ActiveMQDestination* getDestination(); - virtual void setDestination( ActiveMQDestination* destination ); + virtual const decaf::lang::Pointer& getConsumerId() const; + virtual decaf::lang::Pointer& getConsumerId(); + virtual void setConsumerId( const decaf::lang::Pointer& consumerId ); + + virtual const decaf::lang::Pointer& getDestination() const; + virtual decaf::lang::Pointer& getDestination(); + virtual void setDestination( const decaf::lang::Pointer& destination ); virtual long long getTimeout() const; virtual void setTimeout( long long timeout ); @@ -128,9 +129,9 @@ virtual std::string& getCorrelationId(); virtual void setCorrelationId( const std::string& correlationId ); - virtual const MessageId* getMessageId() const; - virtual MessageId* getMessageId(); - virtual void setMessageId( MessageId* messageId ); + virtual const decaf::lang::Pointer& getMessageId() const; + virtual decaf::lang::Pointer& getMessageId(); + virtual void setMessageId( const decaf::lang::Pointer& messageId ); }; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.cpp?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.cpp Fri Feb 6 23:11:28 2009 @@ -39,23 +39,21 @@ NetworkBridgeFilter::NetworkBridgeFilter() { this->networkTTL = 0; - this->networkBrokerId = NULL; } //////////////////////////////////////////////////////////////////////////////// NetworkBridgeFilter::~NetworkBridgeFilter() { - delete this->networkBrokerId; } //////////////////////////////////////////////////////////////////////////////// NetworkBridgeFilter* NetworkBridgeFilter::cloneDataStructure() const { - NetworkBridgeFilter* networkBridgeFilter = new NetworkBridgeFilter(); + std::auto_ptr networkBridgeFilter( new NetworkBridgeFilter() ); // Copy the data from the base class or classes networkBridgeFilter->copyDataStructure( this ); - return networkBridgeFilter; + return networkBridgeFilter.release(); } //////////////////////////////////////////////////////////////////////////////// @@ -77,11 +75,7 @@ "NetworkBridgeFilter::copyDataStructure - src is NULL or invalid" ); } this->setNetworkTTL( srcPtr->getNetworkTTL() ); - if( srcPtr->getNetworkBrokerId() != NULL ) { - this->setNetworkBrokerId( - dynamic_cast( - srcPtr->getNetworkBrokerId()->cloneDataStructure() ) ); - } + this->setNetworkBrokerId( srcPtr->getNetworkBrokerId() ); } //////////////////////////////////////////////////////////////////////////////// @@ -125,7 +119,7 @@ return false; } if( this->getNetworkBrokerId() != NULL ) { - if( !this->getNetworkBrokerId()->equals( valuePtr->getNetworkBrokerId() ) ) { + if( !this->getNetworkBrokerId()->equals( valuePtr->getNetworkBrokerId().get() ) ) { return false; } } else if( valuePtr->getNetworkBrokerId() != NULL ) { @@ -148,17 +142,17 @@ } //////////////////////////////////////////////////////////////////////////////// -const BrokerId* NetworkBridgeFilter::getNetworkBrokerId() const { +const decaf::lang::Pointer& NetworkBridgeFilter::getNetworkBrokerId() const { return networkBrokerId; } //////////////////////////////////////////////////////////////////////////////// -BrokerId* NetworkBridgeFilter::getNetworkBrokerId() { +decaf::lang::Pointer& NetworkBridgeFilter::getNetworkBrokerId() { return networkBrokerId; } //////////////////////////////////////////////////////////////////////////////// -void NetworkBridgeFilter::setNetworkBrokerId( BrokerId* networkBrokerId ) { +void NetworkBridgeFilter::setNetworkBrokerId( const decaf::lang::Pointer& networkBrokerId ) { this->networkBrokerId = networkBrokerId; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/NetworkBridgeFilter.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -46,7 +47,7 @@ protected: int networkTTL; - BrokerId* networkBrokerId; + decaf::lang::Pointer networkBrokerId; protected: @@ -101,9 +102,9 @@ virtual int getNetworkTTL() const; virtual void setNetworkTTL( int networkTTL ); - virtual const BrokerId* getNetworkBrokerId() const; - virtual BrokerId* getNetworkBrokerId(); - virtual void setNetworkBrokerId( BrokerId* networkBrokerId ); + virtual const decaf::lang::Pointer& getNetworkBrokerId() const; + virtual decaf::lang::Pointer& getNetworkBrokerId(); + virtual void setNetworkBrokerId( const decaf::lang::Pointer& networkBrokerId ); }; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.cpp?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.cpp Fri Feb 6 23:11:28 2009 @@ -48,12 +48,12 @@ //////////////////////////////////////////////////////////////////////////////// PartialCommand* PartialCommand::cloneDataStructure() const { - PartialCommand* partialCommand = new PartialCommand(); + std::auto_ptr partialCommand( new PartialCommand() ); // Copy the data from the base class or classes partialCommand->copyDataStructure( this ); - return partialCommand; + return partialCommand.release(); } //////////////////////////////////////////////////////////////////////////////// Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/PartialCommand.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.cpp?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.cpp Fri Feb 6 23:11:28 2009 @@ -38,24 +38,22 @@ //////////////////////////////////////////////////////////////////////////////// ProducerAck::ProducerAck() { - this->producerId = NULL; this->size = 0; } //////////////////////////////////////////////////////////////////////////////// ProducerAck::~ProducerAck() { - delete this->producerId; } //////////////////////////////////////////////////////////////////////////////// ProducerAck* ProducerAck::cloneDataStructure() const { - ProducerAck* producerAck = new ProducerAck(); + std::auto_ptr producerAck( new ProducerAck() ); // Copy the data from the base class or classes producerAck->copyDataStructure( this ); - return producerAck; + return producerAck.release(); } //////////////////////////////////////////////////////////////////////////////// @@ -76,11 +74,7 @@ __FILE__, __LINE__, "ProducerAck::copyDataStructure - src is NULL or invalid" ); } - if( srcPtr->getProducerId() != NULL ) { - this->setProducerId( - dynamic_cast( - srcPtr->getProducerId()->cloneDataStructure() ) ); - } + this->setProducerId( srcPtr->getProducerId() ); this->setSize( srcPtr->getSize() ); } @@ -122,7 +116,7 @@ return false; } if( this->getProducerId() != NULL ) { - if( !this->getProducerId()->equals( valuePtr->getProducerId() ) ) { + if( !this->getProducerId()->equals( valuePtr->getProducerId().get() ) ) { return false; } } else if( valuePtr->getProducerId() != NULL ) { @@ -138,24 +132,24 @@ } //////////////////////////////////////////////////////////////////////////////// -commands::Command* ProducerAck::visit( activemq::state::CommandVisitor* visitor ) +decaf::lang::Pointer ProducerAck::visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ) { return visitor->processProducerAck( this ); } //////////////////////////////////////////////////////////////////////////////// -const ProducerId* ProducerAck::getProducerId() const { +const decaf::lang::Pointer& ProducerAck::getProducerId() const { return producerId; } //////////////////////////////////////////////////////////////////////////////// -ProducerId* ProducerAck::getProducerId() { +decaf::lang::Pointer& ProducerAck::getProducerId() { return producerId; } //////////////////////////////////////////////////////////////////////////////// -void ProducerAck::setProducerId( ProducerId* producerId ) { +void ProducerAck::setProducerId( const decaf::lang::Pointer& producerId ) { this->producerId = producerId; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerAck.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -45,7 +46,7 @@ class AMQCPP_API ProducerAck : public BaseCommand { protected: - ProducerId* producerId; + decaf::lang::Pointer producerId; int size; protected: @@ -105,12 +106,12 @@ * * @return a Response to the visitor being called or NULL if no response. */ - virtual commands::Command* visit( activemq::state::CommandVisitor* visitor ) + virtual decaf::lang::Pointer visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ); - virtual const ProducerId* getProducerId() const; - virtual ProducerId* getProducerId(); - virtual void setProducerId( ProducerId* producerId ); + virtual const decaf::lang::Pointer& getProducerId() const; + virtual decaf::lang::Pointer& getProducerId(); + virtual void setProducerId( const decaf::lang::Pointer& producerId ); virtual int getSize() const; virtual void setSize( int size ); Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.cpp?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.cpp Fri Feb 6 23:11:28 2009 @@ -56,12 +56,12 @@ //////////////////////////////////////////////////////////////////////////////// ProducerId* ProducerId::cloneDataStructure() const { - ProducerId* producerId = new ProducerId(); + std::auto_ptr producerId( new ProducerId() ); // Copy the data from the base class or classes producerId->copyDataStructure( this ); - return producerId; + return producerId.release(); } //////////////////////////////////////////////////////////////////////////////// Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerId.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -53,6 +54,8 @@ const static unsigned char ID_PRODUCERID = 123; + typedef decaf::lang::PointerComparator COMPARATOR; + public: ProducerId(); Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.cpp?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.cpp Fri Feb 6 23:11:28 2009 @@ -38,8 +38,6 @@ //////////////////////////////////////////////////////////////////////////////// ProducerInfo::ProducerInfo() { - this->producerId = NULL; - this->destination = NULL; this->dispatchAsync = false; this->windowSize = 0; } @@ -47,21 +45,16 @@ //////////////////////////////////////////////////////////////////////////////// ProducerInfo::~ProducerInfo() { - delete this->producerId; - delete this->destination; - for( size_t ibrokerPath = 0; ibrokerPath < brokerPath.size(); ++ibrokerPath ) { - delete brokerPath[ibrokerPath]; - } } //////////////////////////////////////////////////////////////////////////////// ProducerInfo* ProducerInfo::cloneDataStructure() const { - ProducerInfo* producerInfo = new ProducerInfo(); + std::auto_ptr producerInfo( new ProducerInfo() ); // Copy the data from the base class or classes producerInfo->copyDataStructure( this ); - return producerInfo; + return producerInfo.release(); } //////////////////////////////////////////////////////////////////////////////// @@ -82,25 +75,9 @@ __FILE__, __LINE__, "ProducerInfo::copyDataStructure - src is NULL or invalid" ); } - if( srcPtr->getProducerId() != NULL ) { - this->setProducerId( - dynamic_cast( - srcPtr->getProducerId()->cloneDataStructure() ) ); - } - if( srcPtr->getDestination() != NULL ) { - this->setDestination( - dynamic_cast( - srcPtr->getDestination()->cloneDataStructure() ) ); - } - for( size_t ibrokerPath = 0; ibrokerPath < srcPtr->getBrokerPath().size(); ++ibrokerPath ) { - if( srcPtr->getBrokerPath()[ibrokerPath] != NULL ) { - this->getBrokerPath().push_back( - dynamic_cast( - srcPtr->getBrokerPath()[ibrokerPath]->cloneDataStructure() ) ); - } else { - this->getBrokerPath().push_back( NULL ); - } - } + this->setProducerId( srcPtr->getProducerId() ); + this->setDestination( srcPtr->getDestination() ); + this->setBrokerPath( srcPtr->getBrokerPath() ); this->setDispatchAsync( srcPtr->isDispatchAsync() ); this->setWindowSize( srcPtr->getWindowSize() ); } @@ -158,14 +135,14 @@ return false; } if( this->getProducerId() != NULL ) { - if( !this->getProducerId()->equals( valuePtr->getProducerId() ) ) { + if( !this->getProducerId()->equals( valuePtr->getProducerId().get() ) ) { return false; } } else if( valuePtr->getProducerId() != NULL ) { return false; } if( this->getDestination() != NULL ) { - if( !this->getDestination()->equals( valuePtr->getDestination() ) ) { + if( !this->getDestination()->equals( valuePtr->getDestination().get() ) ) { return false; } } else if( valuePtr->getDestination() != NULL ) { @@ -173,7 +150,7 @@ } for( size_t ibrokerPath = 0; ibrokerPath < this->getBrokerPath().size(); ++ibrokerPath ) { if( this->getBrokerPath()[ibrokerPath] != NULL ) { - if( !this->getBrokerPath()[ibrokerPath]->equals( valuePtr->getBrokerPath()[ibrokerPath] ) ) { + if( !this->getBrokerPath()[ibrokerPath]->equals( valuePtr->getBrokerPath()[ibrokerPath].get() ) ) { return false; } } else if( valuePtr->getBrokerPath()[ibrokerPath] != NULL ) { @@ -193,54 +170,54 @@ } //////////////////////////////////////////////////////////////////////////////// -commands::Command* ProducerInfo::visit( activemq::state::CommandVisitor* visitor ) +decaf::lang::Pointer ProducerInfo::visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ) { return visitor->processProducerInfo( this ); } //////////////////////////////////////////////////////////////////////////////// -const ProducerId* ProducerInfo::getProducerId() const { +const decaf::lang::Pointer& ProducerInfo::getProducerId() const { return producerId; } //////////////////////////////////////////////////////////////////////////////// -ProducerId* ProducerInfo::getProducerId() { +decaf::lang::Pointer& ProducerInfo::getProducerId() { return producerId; } //////////////////////////////////////////////////////////////////////////////// -void ProducerInfo::setProducerId( ProducerId* producerId ) { +void ProducerInfo::setProducerId( const decaf::lang::Pointer& producerId ) { this->producerId = producerId; } //////////////////////////////////////////////////////////////////////////////// -const ActiveMQDestination* ProducerInfo::getDestination() const { +const decaf::lang::Pointer& ProducerInfo::getDestination() const { return destination; } //////////////////////////////////////////////////////////////////////////////// -ActiveMQDestination* ProducerInfo::getDestination() { +decaf::lang::Pointer& ProducerInfo::getDestination() { return destination; } //////////////////////////////////////////////////////////////////////////////// -void ProducerInfo::setDestination( ActiveMQDestination* destination ) { +void ProducerInfo::setDestination( const decaf::lang::Pointer& destination ) { this->destination = destination; } //////////////////////////////////////////////////////////////////////////////// -const std::vector& ProducerInfo::getBrokerPath() const { +const std::vector< decaf::lang::Pointer >& ProducerInfo::getBrokerPath() const { return brokerPath; } //////////////////////////////////////////////////////////////////////////////// -std::vector& ProducerInfo::getBrokerPath() { +std::vector< decaf::lang::Pointer >& ProducerInfo::getBrokerPath() { return brokerPath; } //////////////////////////////////////////////////////////////////////////////// -void ProducerInfo::setBrokerPath( const std::vector& brokerPath ) { +void ProducerInfo::setBrokerPath( const std::vector< decaf::lang::Pointer >& brokerPath ) { this->brokerPath = brokerPath; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/ProducerInfo.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -47,9 +48,9 @@ class AMQCPP_API ProducerInfo : public BaseCommand { protected: - ProducerId* producerId; - ActiveMQDestination* destination; - std::vector brokerPath; + decaf::lang::Pointer producerId; + decaf::lang::Pointer destination; + std::vector< decaf::lang::Pointer > brokerPath; bool dispatchAsync; int windowSize; @@ -110,20 +111,20 @@ * * @return a Response to the visitor being called or NULL if no response. */ - virtual commands::Command* visit( activemq::state::CommandVisitor* visitor ) + virtual decaf::lang::Pointer visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ); - virtual const ProducerId* getProducerId() const; - virtual ProducerId* getProducerId(); - virtual void setProducerId( ProducerId* producerId ); - - virtual const ActiveMQDestination* getDestination() const; - virtual ActiveMQDestination* getDestination(); - virtual void setDestination( ActiveMQDestination* destination ); - - virtual const std::vector& getBrokerPath() const; - virtual std::vector& getBrokerPath(); - virtual void setBrokerPath( const std::vector& brokerPath ); + virtual const decaf::lang::Pointer& getProducerId() const; + virtual decaf::lang::Pointer& getProducerId(); + virtual void setProducerId( const decaf::lang::Pointer& producerId ); + + virtual const decaf::lang::Pointer& getDestination() const; + virtual decaf::lang::Pointer& getDestination(); + virtual void setDestination( const decaf::lang::Pointer& destination ); + + virtual const std::vector< decaf::lang::Pointer >& getBrokerPath() const; + virtual std::vector< decaf::lang::Pointer >& getBrokerPath(); + virtual void setBrokerPath( const std::vector< decaf::lang::Pointer >& brokerPath ); virtual bool isDispatchAsync() const; virtual void setDispatchAsync( bool dispatchAsync ); Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.cpp?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.cpp Fri Feb 6 23:11:28 2009 @@ -38,23 +38,21 @@ //////////////////////////////////////////////////////////////////////////////// RemoveInfo::RemoveInfo() { - this->objectId = NULL; } //////////////////////////////////////////////////////////////////////////////// RemoveInfo::~RemoveInfo() { - delete this->objectId; } //////////////////////////////////////////////////////////////////////////////// RemoveInfo* RemoveInfo::cloneDataStructure() const { - RemoveInfo* removeInfo = new RemoveInfo(); + std::auto_ptr removeInfo( new RemoveInfo() ); // Copy the data from the base class or classes removeInfo->copyDataStructure( this ); - return removeInfo; + return removeInfo.release(); } //////////////////////////////////////////////////////////////////////////////// @@ -75,11 +73,7 @@ __FILE__, __LINE__, "RemoveInfo::copyDataStructure - src is NULL or invalid" ); } - if( srcPtr->getObjectId() != NULL ) { - this->setObjectId( - dynamic_cast( - srcPtr->getObjectId()->cloneDataStructure() ) ); - } + this->setObjectId( srcPtr->getObjectId() ); } //////////////////////////////////////////////////////////////////////////////// @@ -119,7 +113,7 @@ return false; } if( this->getObjectId() != NULL ) { - if( !this->getObjectId()->equals( valuePtr->getObjectId() ) ) { + if( !this->getObjectId()->equals( valuePtr->getObjectId().get() ) ) { return false; } } else if( valuePtr->getObjectId() != NULL ) { @@ -132,24 +126,24 @@ } //////////////////////////////////////////////////////////////////////////////// -commands::Command* RemoveInfo::visit( activemq::state::CommandVisitor* visitor ) +decaf::lang::Pointer RemoveInfo::visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ) { return visitor->processRemoveInfo( this ); } //////////////////////////////////////////////////////////////////////////////// -const DataStructure* RemoveInfo::getObjectId() const { +const decaf::lang::Pointer& RemoveInfo::getObjectId() const { return objectId; } //////////////////////////////////////////////////////////////////////////////// -DataStructure* RemoveInfo::getObjectId() { +decaf::lang::Pointer& RemoveInfo::getObjectId() { return objectId; } //////////////////////////////////////////////////////////////////////////////// -void RemoveInfo::setObjectId( DataStructure* objectId ) { +void RemoveInfo::setObjectId( const decaf::lang::Pointer& objectId ) { this->objectId = objectId; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveInfo.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -45,7 +46,7 @@ class AMQCPP_API RemoveInfo : public BaseCommand { protected: - DataStructure* objectId; + decaf::lang::Pointer objectId; protected: @@ -104,12 +105,12 @@ * * @return a Response to the visitor being called or NULL if no response. */ - virtual commands::Command* visit( activemq::state::CommandVisitor* visitor ) + virtual decaf::lang::Pointer visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ); - virtual const DataStructure* getObjectId() const; - virtual DataStructure* getObjectId(); - virtual void setObjectId( DataStructure* objectId ); + virtual const decaf::lang::Pointer& getObjectId() const; + virtual decaf::lang::Pointer& getObjectId(); + virtual void setObjectId( const decaf::lang::Pointer& objectId ); }; Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.cpp URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.cpp?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.cpp (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.cpp Fri Feb 6 23:11:28 2009 @@ -38,7 +38,6 @@ //////////////////////////////////////////////////////////////////////////////// RemoveSubscriptionInfo::RemoveSubscriptionInfo() { - this->connectionId = NULL; this->subcriptionName = ""; this->clientId = ""; } @@ -46,17 +45,16 @@ //////////////////////////////////////////////////////////////////////////////// RemoveSubscriptionInfo::~RemoveSubscriptionInfo() { - delete this->connectionId; } //////////////////////////////////////////////////////////////////////////////// RemoveSubscriptionInfo* RemoveSubscriptionInfo::cloneDataStructure() const { - RemoveSubscriptionInfo* removeSubscriptionInfo = new RemoveSubscriptionInfo(); + std::auto_ptr removeSubscriptionInfo( new RemoveSubscriptionInfo() ); // Copy the data from the base class or classes removeSubscriptionInfo->copyDataStructure( this ); - return removeSubscriptionInfo; + return removeSubscriptionInfo.release(); } //////////////////////////////////////////////////////////////////////////////// @@ -77,11 +75,7 @@ __FILE__, __LINE__, "RemoveSubscriptionInfo::copyDataStructure - src is NULL or invalid" ); } - if( srcPtr->getConnectionId() != NULL ) { - this->setConnectionId( - dynamic_cast( - srcPtr->getConnectionId()->cloneDataStructure() ) ); - } + this->setConnectionId( srcPtr->getConnectionId() ); this->setSubcriptionName( srcPtr->getSubcriptionName() ); this->setClientId( srcPtr->getClientId() ); } @@ -125,7 +119,7 @@ return false; } if( this->getConnectionId() != NULL ) { - if( !this->getConnectionId()->equals( valuePtr->getConnectionId() ) ) { + if( !this->getConnectionId()->equals( valuePtr->getConnectionId().get() ) ) { return false; } } else if( valuePtr->getConnectionId() != NULL ) { @@ -144,24 +138,24 @@ } //////////////////////////////////////////////////////////////////////////////// -commands::Command* RemoveSubscriptionInfo::visit( activemq::state::CommandVisitor* visitor ) +decaf::lang::Pointer RemoveSubscriptionInfo::visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ) { return visitor->processRemoveSubscriptionInfo( this ); } //////////////////////////////////////////////////////////////////////////////// -const ConnectionId* RemoveSubscriptionInfo::getConnectionId() const { +const decaf::lang::Pointer& RemoveSubscriptionInfo::getConnectionId() const { return connectionId; } //////////////////////////////////////////////////////////////////////////////// -ConnectionId* RemoveSubscriptionInfo::getConnectionId() { +decaf::lang::Pointer& RemoveSubscriptionInfo::getConnectionId() { return connectionId; } //////////////////////////////////////////////////////////////////////////////// -void RemoveSubscriptionInfo::setConnectionId( ConnectionId* connectionId ) { +void RemoveSubscriptionInfo::setConnectionId( const decaf::lang::Pointer& connectionId ) { this->connectionId = connectionId; } Modified: activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.h URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.h?rev=741774&r1=741773&r2=741774&view=diff ============================================================================== --- activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.h (original) +++ activemq/activemq-cpp/trunk/src/main/activemq/commands/RemoveSubscriptionInfo.h Fri Feb 6 23:11:28 2009 @@ -25,6 +25,7 @@ #include #include +#include #include #include #include @@ -45,7 +46,7 @@ class AMQCPP_API RemoveSubscriptionInfo : public BaseCommand { protected: - ConnectionId* connectionId; + decaf::lang::Pointer connectionId; std::string subcriptionName; std::string clientId; @@ -106,12 +107,12 @@ * * @return a Response to the visitor being called or NULL if no response. */ - virtual commands::Command* visit( activemq::state::CommandVisitor* visitor ) + virtual decaf::lang::Pointer visit( activemq::state::CommandVisitor* visitor ) throw( exceptions::ActiveMQException ); - virtual const ConnectionId* getConnectionId() const; - virtual ConnectionId* getConnectionId(); - virtual void setConnectionId( ConnectionId* connectionId ); + virtual const decaf::lang::Pointer& getConnectionId() const; + virtual decaf::lang::Pointer& getConnectionId(); + virtual void setConnectionId( const decaf::lang::Pointer& connectionId ); virtual const std::string& getSubcriptionName() const; virtual std::string& getSubcriptionName();