You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2015/08/04 01:16:22 UTC
activemq-cpp git commit: Clean up some old code.
Repository: activemq-cpp
Updated Branches:
refs/heads/master 54c3b9d29 -> 615aa5183
Clean up some old code.
Project: http://git-wip-us.apache.org/repos/asf/activemq-cpp/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-cpp/commit/615aa518
Tree: http://git-wip-us.apache.org/repos/asf/activemq-cpp/tree/615aa518
Diff: http://git-wip-us.apache.org/repos/asf/activemq-cpp/diff/615aa518
Branch: refs/heads/master
Commit: 615aa51837f0338974775d9e1e762861f2f11166
Parents: 54c3b9d
Author: Timothy Bish <ta...@gmail.com>
Authored: Mon Aug 3 19:16:15 2015 -0400
Committer: Timothy Bish <ta...@gmail.com>
Committed: Mon Aug 3 19:16:15 2015 -0400
----------------------------------------------------------------------
.../activemq/commands/ActiveMQBlobMessage.cpp | 14 +-
.../activemq/commands/ActiveMQBlobMessage.h | 26 +-
.../activemq/commands/ActiveMQBytesMessage.cpp | 448 ++++++++++---------
.../activemq/commands/ActiveMQBytesMessage.h | 58 ++-
.../activemq/commands/ActiveMQMapMessage.cpp | 279 ++++++------
.../main/activemq/commands/ActiveMQMapMessage.h | 151 ++-----
.../main/activemq/commands/ActiveMQMessage.cpp | 26 +-
.../main/activemq/commands/ActiveMQMessage.h | 29 +-
.../activemq/commands/ActiveMQObjectMessage.cpp | 15 +-
.../activemq/commands/ActiveMQObjectMessage.h | 21 +-
.../activemq/commands/ActiveMQStreamMessage.cpp | 16 +-
.../activemq/commands/ActiveMQStreamMessage.h | 10 +-
12 files changed, 515 insertions(+), 578 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/615aa518/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.cpp b/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.cpp
index e1471df..4e33e5b 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.cpp
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.cpp
@@ -25,11 +25,7 @@ using namespace activemq::commands;
////////////////////////////////////////////////////////////////////////////////
const std::string ActiveMQBlobMessage::BINARY_MIME_TYPE = "application/octet-stream";
-
-std::string remoteBlobUrl;
-std::string mimeType;
-std::string name;
-bool deletedByBroker;
+const unsigned char ActiveMQBlobMessage::ID_ACTIVEMQBLOBMESSAGE = 29;
////////////////////////////////////////////////////////////////////////////////
ActiveMQBlobMessage::ActiveMQBlobMessage() : ActiveMQMessageTemplate<cms::Message>(),
@@ -50,6 +46,14 @@ ActiveMQBlobMessage* ActiveMQBlobMessage::cloneDataStructure() const {
}
////////////////////////////////////////////////////////////////////////////////
+cms::Message* ActiveMQBlobMessage::clone() const {
+ ActiveMQBlobMessage* clone = this->cloneDataStructure();
+ clone->setReadOnlyBody(false);
+ clone->setReadOnlyProperties(false);
+ return dynamic_cast<cms::Message*>(clone);
+}
+
+////////////////////////////////////////////////////////////////////////////////
void ActiveMQBlobMessage::copyDataStructure( const DataStructure* src ) {
ActiveMQMessageTemplate<cms::Message>::copyDataStructure( src );
}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/615aa518/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h
index caa3c9f..2b6e5b7 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQBlobMessage.h
@@ -27,9 +27,7 @@
namespace activemq {
namespace commands {
- class AMQCPP_API ActiveMQBlobMessage :
- public ActiveMQMessageTemplate< cms::Message > {
-
+ class AMQCPP_API ActiveMQBlobMessage : public ActiveMQMessageTemplate< cms::Message > {
private:
std::string remoteBlobUrl;
@@ -39,39 +37,35 @@ namespace commands {
public:
- static const unsigned char ID_ACTIVEMQBLOBMESSAGE = 29;
+ static const unsigned char ID_ACTIVEMQBLOBMESSAGE;
static const std::string BINARY_MIME_TYPE;
private:
- ActiveMQBlobMessage( const ActiveMQBlobMessage& );
- ActiveMQBlobMessage& operator= ( const ActiveMQBlobMessage& );
+ ActiveMQBlobMessage(const ActiveMQBlobMessage&);
+ ActiveMQBlobMessage& operator=(const ActiveMQBlobMessage&);
public:
ActiveMQBlobMessage();
+
virtual ~ActiveMQBlobMessage() throw() {}
virtual unsigned char getDataStructureType() const;
virtual ActiveMQBlobMessage* cloneDataStructure() const;
- virtual void copyDataStructure( const DataStructure* src );
+ virtual void copyDataStructure(const DataStructure* src);
virtual std::string toString() const;
- virtual bool equals( const DataStructure* value ) const;
+ virtual bool equals(const DataStructure* value) const;
- public: // cms::Message
+ public: // CMS Message
- virtual cms::Message* clone() const {
- ActiveMQBlobMessage* clone = this->cloneDataStructure();
- clone->setReadOnlyBody(false);
- clone->setReadOnlyProperties(false);
- return dynamic_cast<cms::Message*>(clone);
- }
+ virtual cms::Message* clone() const;
- public: // BlobMessage
+ public: // CMS BlobMessage
/**
* Get the Remote URL of the Blob.
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/615aa518/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp b/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp
index 86c82a9..d8cd596 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.cpp
@@ -38,7 +38,10 @@ using namespace decaf::util;
using namespace decaf::util::zip;
////////////////////////////////////////////////////////////////////////////////
-namespace{
+const unsigned char ActiveMQBytesMessage::ID_ACTIVEMQBYTESMESSAGE = 24;
+
+////////////////////////////////////////////////////////////////////////////////
+namespace {
class ByteCounterOutputStream : public FilterOutputStream {
private:
@@ -96,44 +99,51 @@ ActiveMQBytesMessage* ActiveMQBytesMessage::cloneDataStructure() const {
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::copyDataStructure( const DataStructure* src ) {
+cms::BytesMessage* ActiveMQBytesMessage::clone() const {
+ ActiveMQBytesMessage* clone = this->cloneDataStructure();
+ clone->setReadOnlyBody(false);
+ clone->setReadOnlyProperties(false);
+ return dynamic_cast<cms::BytesMessage*>(clone);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQBytesMessage::copyDataStructure(const DataStructure* src) {
// Protect against invalid self assignment.
- if( this == src ) {
+ if (this == src) {
return;
}
- const ActiveMQBytesMessage* srcPtr = dynamic_cast<const ActiveMQBytesMessage*>( src );
+ const ActiveMQBytesMessage* srcPtr = dynamic_cast<const ActiveMQBytesMessage*>(src);
- if( srcPtr == NULL || src == NULL ) {
+ if (srcPtr == NULL || src == NULL) {
throw decaf::lang::exceptions::NullPointerException(
__FILE__, __LINE__,
- "ActiveMQBytesMessage::copyDataStructure - src is NULL or invalid" );
+ "ActiveMQBytesMessage::copyDataStructure - src is NULL or invalid");
}
- ActiveMQBytesMessage* nonConstSrc = const_cast<ActiveMQBytesMessage*>( srcPtr );
+ ActiveMQBytesMessage* nonConstSrc = const_cast<ActiveMQBytesMessage*>(srcPtr);
nonConstSrc->storeContent();
- ActiveMQMessageTemplate<cms::BytesMessage>::copyDataStructure( src );
+ ActiveMQMessageTemplate<cms::BytesMessage>::copyDataStructure(src);
}
////////////////////////////////////////////////////////////////////////////////
-std::string ActiveMQBytesMessage::toString() const{
+std::string ActiveMQBytesMessage::toString() const {
return ActiveMQMessageTemplate<cms::BytesMessage>::toString();
}
////////////////////////////////////////////////////////////////////////////////
-bool ActiveMQBytesMessage::equals( const DataStructure* value ) const {
- return ActiveMQMessageTemplate<cms::BytesMessage>::equals( value );
+bool ActiveMQBytesMessage::equals(const DataStructure* value) const {
+ return ActiveMQMessageTemplate<cms::BytesMessage>::equals(value);
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::setBodyBytes( const unsigned char* buffer, int numBytes ) {
-
- try{
+void ActiveMQBytesMessage::setBodyBytes(const unsigned char* buffer, int numBytes) {
+ try {
initializeWriting();
- dataOut->write( buffer, (int)numBytes, 0, (int)numBytes );
+ dataOut->write(buffer, (int) numBytes, 0, (int) numBytes);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
@@ -141,15 +151,15 @@ void ActiveMQBytesMessage::setBodyBytes( const unsigned char* buffer, int numByt
////////////////////////////////////////////////////////////////////////////////
unsigned char* ActiveMQBytesMessage::getBodyBytes() const {
- try{
+ try {
initializeReading();
int length = this->getBodyLength();
- if( length != 0 ) {
+ if (length != 0) {
unsigned char* buffer = new unsigned char[length];
- this->readBytes( buffer, length );
+ this->readBytes(buffer, length);
return buffer;
} else {
return NULL;
@@ -161,7 +171,7 @@ unsigned char* ActiveMQBytesMessage::getBodyBytes() const {
////////////////////////////////////////////////////////////////////////////////
int ActiveMQBytesMessage::getBodyLength() const {
- try{
+ try {
initializeReading();
return this->length;
}
@@ -174,15 +184,14 @@ void ActiveMQBytesMessage::clearBody() {
// Invoke base class's version.
ActiveMQMessageTemplate<cms::BytesMessage>::clearBody();
- this->dataOut.reset( NULL );
+ this->dataOut.reset(NULL);
this->bytesOut = NULL;
- this->dataIn.reset( NULL );
+ this->dataIn.reset(NULL);
this->length = 0;
}
////////////////////////////////////////////////////////////////////////////////
void ActiveMQBytesMessage::onSend() {
-
this->storeContent();
ActiveMQMessageTemplate<cms::BytesMessage>::onSend();
}
@@ -190,11 +199,11 @@ void ActiveMQBytesMessage::onSend() {
////////////////////////////////////////////////////////////////////////////////
void ActiveMQBytesMessage::reset() {
- try{
+ try {
storeContent();
this->bytesOut = NULL;
- this->dataIn.reset( NULL );
- this->dataOut.reset( NULL );
+ this->dataIn.reset(NULL);
+ this->dataOut.reset(NULL);
this->length = 0;
this->setReadOnlyBody(true);
}
@@ -205,27 +214,27 @@ void ActiveMQBytesMessage::reset() {
bool ActiveMQBytesMessage::readBoolean() const {
initializeReading();
- try{
+ try {
return this->dataIn->readBoolean();
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( IOException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (IOException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeBoolean( bool value ) {
+void ActiveMQBytesMessage::writeBoolean(bool value) {
initializeWriting();
- try{
- this->dataOut->writeBoolean( value );
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ try {
+ this->dataOut->writeBoolean(value);
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
@@ -233,19 +242,19 @@ void ActiveMQBytesMessage::writeBoolean( bool value ) {
unsigned char ActiveMQBytesMessage::readByte() const {
initializeReading();
- try{
+ try {
return this->dataIn->readByte();
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( IOException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (IOException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeByte( unsigned char value ) {
+void ActiveMQBytesMessage::writeByte(unsigned char value) {
initializeWriting();
try{
@@ -258,69 +267,68 @@ void ActiveMQBytesMessage::writeByte( unsigned char value ) {
}
////////////////////////////////////////////////////////////////////////////////
-int ActiveMQBytesMessage::readBytes( std::vector<unsigned char>& value ) const {
-
- return this->readBytes( &value[0], (int)value.size() );
+int ActiveMQBytesMessage::readBytes(std::vector<unsigned char>& value) const {
+ return this->readBytes(&value[0], (int) value.size());
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeBytes( const std::vector<unsigned char>& value ) {
+void ActiveMQBytesMessage::writeBytes(const std::vector<unsigned char>& value) {
initializeWriting();
- try{
- this->dataOut->write( &value[0], (int)value.size() );
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ try {
+ this->dataOut->write(&value[0], (int) value.size());
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-int ActiveMQBytesMessage::readBytes( unsigned char* buffer, int length ) const {
+int ActiveMQBytesMessage::readBytes(unsigned char* buffer, int length) const {
initializeReading();
- try{
+ try {
- if( length < 0 ) {
+ if (length < 0) {
throw IndexOutOfBoundsException(__FILE__, __LINE__, "Array length given was negative");
}
int n = 0;
- while( n < length ) {
- int count = this->dataIn->read( buffer, (int)length, (int)n, (int)(length - n) );
- if( count < 0 ) {
+ while (n < length) {
+ int count = this->dataIn->read(buffer, (int) length, (int) n, (int) (length - n));
+ if (count < 0) {
break;
}
n += count;
}
- if( n == 0 && length > 0 ) {
+ if (n == 0 && length > 0) {
n = -1;
}
return n;
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( IOException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (IOException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeBytes( const unsigned char* value, int offset, int length ) {
+void ActiveMQBytesMessage::writeBytes(const unsigned char* value, int offset, int length) {
initializeWriting();
- try{
- this->dataOut->write( value, length, offset, length );
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ try {
+ this->dataOut->write(value, length, offset, length);
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
@@ -328,27 +336,27 @@ void ActiveMQBytesMessage::writeBytes( const unsigned char* value, int offset, i
char ActiveMQBytesMessage::readChar() const {
initializeReading();
- try{
+ try {
return this->dataIn->readChar();
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( IOException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (IOException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeChar( char value ) {
+void ActiveMQBytesMessage::writeChar(char value) {
initializeWriting();
- try{
- this->dataOut->writeChar( value );
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ try {
+ this->dataOut->writeChar(value);
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
@@ -356,27 +364,27 @@ void ActiveMQBytesMessage::writeChar( char value ) {
float ActiveMQBytesMessage::readFloat() const {
initializeReading();
- try{
+ try {
return this->dataIn->readFloat();
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( IOException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (IOException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeFloat( float value ) {
+void ActiveMQBytesMessage::writeFloat(float value) {
initializeWriting();
- try{
- this->dataOut->writeFloat( value );
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ try {
+ this->dataOut->writeFloat(value);
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
@@ -384,27 +392,27 @@ void ActiveMQBytesMessage::writeFloat( float value ) {
double ActiveMQBytesMessage::readDouble() const {
initializeReading();
- try{
+ try {
return this->dataIn->readDouble();
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( IOException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (IOException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeDouble( double value ) {
+void ActiveMQBytesMessage::writeDouble(double value) {
initializeWriting();
- try{
- this->dataOut->writeDouble( value );
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ try {
+ this->dataOut->writeDouble(value);
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
@@ -412,27 +420,27 @@ void ActiveMQBytesMessage::writeDouble( double value ) {
short ActiveMQBytesMessage::readShort() const {
initializeReading();
- try{
+ try {
return this->dataIn->readShort();
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( IOException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (IOException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeShort( short value ) {
+void ActiveMQBytesMessage::writeShort(short value) {
initializeWriting();
- try{
- this->dataOut->writeShort( value );
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ try {
+ this->dataOut->writeShort(value);
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
@@ -440,27 +448,27 @@ void ActiveMQBytesMessage::writeShort( short value ) {
unsigned short ActiveMQBytesMessage::readUnsignedShort() const {
initializeReading();
- try{
+ try {
return this->dataIn->readUnsignedShort();
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( IOException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (IOException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeUnsignedShort( unsigned short value ) {
+void ActiveMQBytesMessage::writeUnsignedShort(unsigned short value) {
initializeWriting();
- try{
- this->dataOut->writeUnsignedShort( value );
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ try {
+ this->dataOut->writeUnsignedShort(value);
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
@@ -468,27 +476,27 @@ void ActiveMQBytesMessage::writeUnsignedShort( unsigned short value ) {
int ActiveMQBytesMessage::readInt() const {
initializeReading();
- try{
+ try {
return this->dataIn->readInt();
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( IOException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (IOException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeInt( int value ) {
+void ActiveMQBytesMessage::writeInt(int value) {
initializeWriting();
- try{
- this->dataOut->writeInt( value );
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ try {
+ this->dataOut->writeInt(value);
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
@@ -496,27 +504,27 @@ void ActiveMQBytesMessage::writeInt( int value ) {
long long ActiveMQBytesMessage::readLong() const {
initializeReading();
- try{
+ try {
return this->dataIn->readLong();
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( IOException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (IOException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeLong( long long value ) {
+void ActiveMQBytesMessage::writeLong(long long value) {
initializeWriting();
- try{
- this->dataOut->writeLong( value );
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ try {
+ this->dataOut->writeLong(value);
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
@@ -524,27 +532,27 @@ void ActiveMQBytesMessage::writeLong( long long value ) {
std::string ActiveMQBytesMessage::readString() const {
initializeReading();
- try{
+ try {
return this->dataIn->readString();
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( IOException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (IOException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeString( const std::string& value ) {
+void ActiveMQBytesMessage::writeString(const std::string& value) {
initializeWriting();
- try{
- this->dataOut->writeChars( value );
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ try {
+ this->dataOut->writeChars(value);
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
@@ -552,27 +560,27 @@ void ActiveMQBytesMessage::writeString( const std::string& value ) {
std::string ActiveMQBytesMessage::readUTF() const {
initializeReading();
- try{
+ try {
return this->dataIn->readUTF();
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( IOException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (IOException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQBytesMessage::writeUTF( const std::string& value ) {
+void ActiveMQBytesMessage::writeUTF(const std::string& value) {
initializeWriting();
- try{
- this->dataOut->writeUTF( value );
- } catch( EOFException& ex ) {
- throw CMSExceptionSupport::createMessageEOFException( ex );
- } catch( Exception& ex ) {
- throw CMSExceptionSupport::create( ex );
+ try {
+ this->dataOut->writeUTF(value);
+ } catch (EOFException& ex) {
+ throw CMSExceptionSupport::createMessageEOFException(ex);
+ } catch (Exception& ex) {
+ throw CMSExceptionSupport::create(ex);
}
}
@@ -581,34 +589,34 @@ void ActiveMQBytesMessage::storeContent() {
try {
- if( this->dataOut.get() != NULL && this->bytesOut->size() > 0 ) {
+ if (this->dataOut.get() != NULL && this->bytesOut->size() > 0) {
this->dataOut->close();
- if( !this->compressed ) {
+ if (!this->compressed) {
std::pair<unsigned char*, int> array = this->bytesOut->toByteArray();
- this->setContent( std::vector<unsigned char>( array.first, array.first + array.second ) );
- delete [] array.first;
+ this->setContent(std::vector<unsigned char>(array.first, array.first + array.second));
+ delete[] array.first;
} else {
ByteArrayOutputStream buffer;
- DataOutputStream doBuffer( &buffer );
+ DataOutputStream doBuffer(&buffer);
// Start by writing the length of the written data before compression.
- doBuffer.writeInt( (int)this->length );
+ doBuffer.writeInt((int) this->length);
// Now write the Compressed bytes.
- this->bytesOut->writeTo( &doBuffer );
+ this->bytesOut->writeTo(&doBuffer);
// Now store the annotated content.
std::pair<unsigned char*, int> array = buffer.toByteArray();
- this->setContent( std::vector<unsigned char>( array.first, array.first + array.second ) );
- delete [] array.first;
+ this->setContent(std::vector<unsigned char>(array.first, array.first + array.second));
+ delete[] array.first;
}
- this->dataOut.reset( NULL );
+ this->dataOut.reset(NULL);
this->bytesOut = NULL;
}
}
@@ -648,23 +656,23 @@ void ActiveMQBytesMessage::initializeReading() const {
void ActiveMQBytesMessage::initializeWriting() {
this->failIfReadOnlyBody();
- try{
- if( this->dataOut.get() == NULL ) {
+ try {
+ if (this->dataOut.get() == NULL) {
this->length = 0;
this->bytesOut = new ByteArrayOutputStream();
OutputStream* os = this->bytesOut;
- if( this->connection != NULL && this->connection->isUseCompression() ) {
+ if (this->connection != NULL && this->connection->isUseCompression()) {
this->compressed = true;
- Deflater* deflator = new Deflater( this->connection->getCompressionLevel() );
+ Deflater* deflator = new Deflater(this->connection->getCompressionLevel());
- os = new DeflaterOutputStream( os, deflator, true, true );
- os = new ByteCounterOutputStream( &length, os, true );
+ os = new DeflaterOutputStream(os, deflator, true, true);
+ os = new ByteCounterOutputStream(&length, os, true);
}
- this->dataOut.reset( new DataOutputStream( os, true ) );
+ this->dataOut.reset(new DataOutputStream(os, true));
}
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/615aa518/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h
index 3b53c22..bdeb732 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQBytesMessage.h
@@ -28,11 +28,10 @@
#include <string>
#include <memory>
-namespace activemq{
-namespace commands{
+namespace activemq {
+namespace commands {
- class AMQCPP_API ActiveMQBytesMessage :
- public ActiveMQMessageTemplate< cms::BytesMessage > {
+ class AMQCPP_API ActiveMQBytesMessage : public ActiveMQMessageTemplate< cms::BytesMessage > {
private:
/**
@@ -58,37 +57,32 @@ namespace commands{
public:
- const static unsigned char ID_ACTIVEMQBYTESMESSAGE = 24;
+ const static unsigned char ID_ACTIVEMQBYTESMESSAGE;
private:
- ActiveMQBytesMessage( const ActiveMQBytesMessage& );
- ActiveMQBytesMessage& operator= ( const ActiveMQBytesMessage& );
+ ActiveMQBytesMessage(const ActiveMQBytesMessage&);
+ ActiveMQBytesMessage& operator=(const ActiveMQBytesMessage&);
public:
ActiveMQBytesMessage();
- virtual ~ActiveMQBytesMessage() throw();
+ virtual ~ActiveMQBytesMessage() throw ();
virtual unsigned char getDataStructureType() const;
virtual ActiveMQBytesMessage* cloneDataStructure() const;
- virtual void copyDataStructure( const DataStructure* src );
+ virtual void copyDataStructure(const DataStructure* src);
virtual std::string toString() const;
- virtual bool equals( const DataStructure* value ) const;
+ virtual bool equals(const DataStructure* value) const;
public: // CMS Message
- virtual cms::BytesMessage* clone() const {
- ActiveMQBytesMessage* clone = this->cloneDataStructure();
- clone->setReadOnlyBody(false);
- clone->setReadOnlyProperties(false);
- return dynamic_cast<cms::BytesMessage*>(clone);
- }
+ virtual cms::BytesMessage* clone() const;
virtual void clearBody();
@@ -96,7 +90,7 @@ namespace commands{
public: // CMS BytesMessage
- virtual void setBodyBytes( const unsigned char* buffer, int numBytes );
+ virtual void setBodyBytes(const unsigned char* buffer, int numBytes);
virtual unsigned char* getBodyBytes() const;
@@ -106,55 +100,55 @@ namespace commands{
virtual bool readBoolean() const;
- virtual void writeBoolean( bool value );
+ virtual void writeBoolean(bool value);
virtual unsigned char readByte() const;
- virtual void writeByte( unsigned char value );
+ virtual void writeByte(unsigned char value);
- virtual int readBytes( std::vector<unsigned char>& value ) const;
+ virtual int readBytes(std::vector<unsigned char>& value) const;
- virtual void writeBytes( const std::vector<unsigned char>& value );
+ virtual void writeBytes(const std::vector<unsigned char>& value);
- virtual int readBytes( unsigned char* buffer, int length ) const;
+ virtual int readBytes(unsigned char* buffer, int length) const;
- virtual void writeBytes( const unsigned char* value, int offset, int length );
+ virtual void writeBytes(const unsigned char* value, int offset, int length);
virtual char readChar() const;
- virtual void writeChar( char value );
+ virtual void writeChar(char value);
virtual float readFloat() const;
- virtual void writeFloat( float value );
+ virtual void writeFloat(float value);
virtual double readDouble() const;
- virtual void writeDouble( double value );
+ virtual void writeDouble(double value);
virtual short readShort() const;
- virtual void writeShort( short value );
+ virtual void writeShort(short value);
virtual unsigned short readUnsignedShort() const;
- virtual void writeUnsignedShort( unsigned short value );
+ virtual void writeUnsignedShort(unsigned short value);
virtual int readInt() const;
- virtual void writeInt( int value );
+ virtual void writeInt(int value);
virtual long long readLong() const;
- virtual void writeLong( long long value );
+ virtual void writeLong(long long value);
virtual std::string readString() const;
- virtual void writeString( const std::string& value );
+ virtual void writeString(const std::string& value);
virtual std::string readUTF() const;
- virtual void writeUTF( const std::string& value );
+ virtual void writeUTF(const std::string& value);
private:
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/615aa518/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.cpp b/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.cpp
index ca15dee..7115693 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.cpp
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.cpp
@@ -44,8 +44,10 @@ using namespace activemq::wireformat::openwire;
using namespace activemq::wireformat::openwire::marshal;
////////////////////////////////////////////////////////////////////////////////
-ActiveMQMapMessage::ActiveMQMapMessage() :
- ActiveMQMessageTemplate<cms::MapMessage>(), map() {
+const unsigned char ActiveMQMapMessage::ID_ACTIVEMQMAPMESSAGE = 25;
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQMapMessage::ActiveMQMapMessage() : ActiveMQMessageTemplate<cms::MapMessage>(), map() {
}
////////////////////////////////////////////////////////////////////////////////
@@ -65,97 +67,100 @@ ActiveMQMapMessage* ActiveMQMapMessage::cloneDataStructure() const {
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::copyDataStructure( const DataStructure* src ) {
- ActiveMQMessageTemplate<cms::MapMessage>::copyDataStructure( src );
+cms::MapMessage* ActiveMQMapMessage::clone() const {
+ ActiveMQMapMessage* clone = this->cloneDataStructure();
+ clone->setReadOnlyBody(false);
+ clone->setReadOnlyProperties(false);
+ return dynamic_cast<cms::MapMessage*>(clone);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+void ActiveMQMapMessage::copyDataStructure(const DataStructure* src) {
+ ActiveMQMessageTemplate<cms::MapMessage>::copyDataStructure(src);
- const ActiveMQMapMessage* srcMap =
- dynamic_cast< const ActiveMQMapMessage* >( src );
+ const ActiveMQMapMessage* srcMap = dynamic_cast<const ActiveMQMapMessage*>(src);
- if( srcMap != NULL && srcMap->map.get() != NULL ) {
- this->map.reset( new util::PrimitiveMap( *srcMap->map ) );
+ if (srcMap != NULL && srcMap->map.get() != NULL) {
+ this->map.reset(new util::PrimitiveMap(*srcMap->map));
}
}
////////////////////////////////////////////////////////////////////////////////
-std::string ActiveMQMapMessage::toString() const{
+std::string ActiveMQMapMessage::toString() const {
return ActiveMQMessageTemplate<cms::MapMessage>::toString();
}
////////////////////////////////////////////////////////////////////////////////
-bool ActiveMQMapMessage::equals( const DataStructure* value ) const {
- return ActiveMQMessageTemplate<cms::MapMessage>::equals( value );
+bool ActiveMQMapMessage::equals(const DataStructure* value) const {
+ return ActiveMQMessageTemplate<cms::MapMessage>::equals(value);
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::clearBody() throw( cms::CMSException ) {
-
+void ActiveMQMapMessage::clearBody() throw (cms::CMSException) {
ActiveMQMessageTemplate<cms::MapMessage>::clearBody();
this->getMap().clear();
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::beforeMarshal( WireFormat* wireFormat ) {
+void ActiveMQMapMessage::beforeMarshal(WireFormat* wireFormat) {
- try{
+ try {
// Let the base class do its thing.
- ActiveMQMessageTemplate<cms::MapMessage>::beforeMarshal( wireFormat );
+ ActiveMQMessageTemplate<cms::MapMessage>::beforeMarshal(wireFormat);
- if( map.get() != NULL && !map->isEmpty() ) {
+ if (map.get() != NULL && !map->isEmpty()) {
ByteArrayOutputStream* bytesOut = new ByteArrayOutputStream();
OutputStream* os = bytesOut;
- if( this->connection != NULL && this->connection->isUseCompression() ) {
+ if (this->connection != NULL && this->connection->isUseCompression()) {
this->compressed = true;
- Deflater* deflator = new Deflater( this->connection->getCompressionLevel() );
+ Deflater* deflator = new Deflater(this->connection->getCompressionLevel());
- os = new DeflaterOutputStream( os, deflator, true, true );
+ os = new DeflaterOutputStream(os, deflator, true, true);
}
- DataOutputStream dataOut( os, true );
- PrimitiveTypesMarshaller::marshalMap( map.get(), dataOut );
+ DataOutputStream dataOut(os, true);
+ PrimitiveTypesMarshaller::marshalMap(map.get(), dataOut);
dataOut.close();
std::pair<unsigned char*, int> array = bytesOut->toByteArray();
- this->setContent( std::vector<unsigned char>( array.first, array.first + array.second ) );
- delete [] array.first;
-
+ this->setContent(std::vector<unsigned char>(array.first, array.first + array.second));
+ delete[] array.first;
} else {
clearBody();
}
}
- AMQ_CATCH_RETHROW( decaf::io::IOException )
- AMQ_CATCH_EXCEPTION_CONVERT( Exception, decaf::io::IOException )
- AMQ_CATCHALL_THROW( decaf::io::IOException )
+ AMQ_CATCH_RETHROW(decaf::io::IOException)
+ AMQ_CATCH_EXCEPTION_CONVERT(Exception, decaf::io::IOException)
+ AMQ_CATCHALL_THROW(decaf::io::IOException)
}
////////////////////////////////////////////////////////////////////////////////
PrimitiveMap& ActiveMQMapMessage::getMap() {
- try{
-
+ try {
this->checkMapIsUnmarshalled();
return *map;
}
- AMQ_CATCH_RETHROW( NullPointerException )
- AMQ_CATCH_EXCEPTION_CONVERT( Exception, NullPointerException )
- AMQ_CATCHALL_THROW( NullPointerException )
+ AMQ_CATCH_RETHROW(NullPointerException)
+ AMQ_CATCH_EXCEPTION_CONVERT(Exception, NullPointerException)
+ AMQ_CATCHALL_THROW(NullPointerException)
}
////////////////////////////////////////////////////////////////////////////////
const PrimitiveMap& ActiveMQMapMessage::getMap() const {
- try{
-
+ try {
this->checkMapIsUnmarshalled();
return *map;
}
- AMQ_CATCH_RETHROW( NullPointerException )
- AMQ_CATCH_EXCEPTION_CONVERT( Exception, NullPointerException )
- AMQ_CATCHALL_THROW( NullPointerException )
+ AMQ_CATCH_RETHROW(NullPointerException)
+ AMQ_CATCH_EXCEPTION_CONVERT(Exception, NullPointerException)
+ AMQ_CATCHALL_THROW(NullPointerException)
}
////////////////////////////////////////////////////////////////////////////////
@@ -163,38 +168,37 @@ void ActiveMQMapMessage::checkMapIsUnmarshalled() const {
try {
- if( map.get() == NULL && !getContent().empty() ) {
+ if (map.get() == NULL && !getContent().empty()) {
- InputStream* is = new ByteArrayInputStream( getContent() );
+ InputStream* is = new ByteArrayInputStream(getContent());
- if( isCompressed() ) {
- is = new InflaterInputStream( is, true );
- is = new BufferedInputStream( is, true );
+ if (isCompressed()) {
+ is = new InflaterInputStream(is, true);
+ is = new BufferedInputStream(is, true);
}
- DataInputStream dataIn( is, true );
+ DataInputStream dataIn(is, true);
- map.reset( PrimitiveTypesMarshaller::unmarshalMap( dataIn ) );
+ map.reset(PrimitiveTypesMarshaller::unmarshalMap(dataIn));
- if( map.get() == NULL ) {
+ if (map.get() == NULL) {
throw NullPointerException(
__FILE__, __LINE__,
- "ActiveMQMapMessage::getMap() - All attempts to create a "
- "map have failed." );
+ "ActiveMQMapMessage::getMap() - All attempts to create a map have failed.");
}
- } else if( map.get() == NULL ) {
- map.reset( new PrimitiveMap() );
+ } else if (map.get() == NULL) {
+ map.reset(new PrimitiveMap());
}
}
- AMQ_CATCH_RETHROW( NullPointerException )
- AMQ_CATCH_EXCEPTION_CONVERT( Exception, NullPointerException )
- AMQ_CATCHALL_THROW( NullPointerException )
+ AMQ_CATCH_RETHROW(NullPointerException)
+ AMQ_CATCH_EXCEPTION_CONVERT(Exception, NullPointerException)
+ AMQ_CATCHALL_THROW(NullPointerException)
}
////////////////////////////////////////////////////////////////////////////////
bool ActiveMQMapMessage::isEmpty() const {
- try{
+ try {
return getMap().isEmpty();
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
@@ -203,7 +207,7 @@ bool ActiveMQMapMessage::isEmpty() const {
////////////////////////////////////////////////////////////////////////////////
std::vector<std::string> ActiveMQMapMessage::getMapNames() const {
- try{
+ try {
return getMap().keySet().toArray();
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
@@ -213,7 +217,7 @@ std::vector<std::string> ActiveMQMapMessage::getMapNames() const {
bool ActiveMQMapMessage::itemExists(const std::string& name) const {
try {
- return getMap().containsKey( name );
+ return getMap().containsKey(name);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
@@ -224,7 +228,7 @@ cms::Message::ValueType ActiveMQMapMessage::getValueType(const std::string& key)
try {
util::PrimitiveValueNode::PrimitiveType type = this->getMap().getValueType(key);
- switch(type) {
+ switch (type) {
case util::PrimitiveValueNode::NULL_TYPE:
return cms::Message::NULL_TYPE;
case util::PrimitiveValueNode::BOOLEAN_TYPE:
@@ -258,212 +262,211 @@ cms::Message::ValueType ActiveMQMapMessage::getValueType(const std::string& key)
}
////////////////////////////////////////////////////////////////////////////////
-bool ActiveMQMapMessage::getBoolean( const std::string& name ) const {
+bool ActiveMQMapMessage::getBoolean(const std::string& name) const {
- try{
- return getMap().getBool( name );
- } catch( UnsupportedOperationException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
+ try {
+ return getMap().getBool(name);
+ } catch (UnsupportedOperationException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::setBoolean( const std::string& name, bool value ) {
+void ActiveMQMapMessage::setBoolean(const std::string& name, bool value) {
failIfReadOnlyBody();
- try{
- getMap().setBool( name, value );
+ try {
+ getMap().setBool(name, value);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-unsigned char ActiveMQMapMessage::getByte( const std::string& name ) const {
+unsigned char ActiveMQMapMessage::getByte(const std::string& name) const {
- try{
- return getMap().getByte( name );
- } catch( UnsupportedOperationException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
+ try {
+ return getMap().getByte(name);
+ } catch (UnsupportedOperationException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::setByte( const std::string& name, unsigned char value ) {
+void ActiveMQMapMessage::setByte(const std::string& name, unsigned char value) {
failIfReadOnlyBody();
- try{
- getMap().setByte( name, value );
+ try {
+ getMap().setByte(name, value);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-std::vector<unsigned char> ActiveMQMapMessage::getBytes( const std::string& name ) const {
+std::vector<unsigned char> ActiveMQMapMessage::getBytes(const std::string& name) const {
- try{
- return getMap().getByteArray( name );
- } catch( UnsupportedOperationException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
+ try {
+ return getMap().getByteArray(name);
+ } catch (UnsupportedOperationException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::setBytes( const std::string& name,
- const std::vector<unsigned char>& value ) {
+void ActiveMQMapMessage::setBytes(const std::string& name, const std::vector<unsigned char>& value) {
failIfReadOnlyBody();
- try{
- getMap().setByteArray( name, value );
+ try {
+ getMap().setByteArray(name, value);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-char ActiveMQMapMessage::getChar( const std::string& name ) const {
+char ActiveMQMapMessage::getChar(const std::string& name) const {
- try{
- return getMap().getChar( name );
- } catch( UnsupportedOperationException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
+ try {
+ return getMap().getChar(name);
+ } catch (UnsupportedOperationException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::setChar( const std::string& name, char value ) {
+void ActiveMQMapMessage::setChar(const std::string& name, char value) {
failIfReadOnlyBody();
- try{
- getMap().setChar( name, value );
+ try {
+ getMap().setChar(name, value);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-double ActiveMQMapMessage::getDouble( const std::string& name ) const {
+double ActiveMQMapMessage::getDouble(const std::string& name) const {
- try{
- return getMap().getDouble( name );
- } catch( UnsupportedOperationException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
+ try {
+ return getMap().getDouble(name);
+ } catch (UnsupportedOperationException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::setDouble( const std::string& name, double value ) {
+void ActiveMQMapMessage::setDouble(const std::string& name, double value) {
failIfReadOnlyBody();
- try{
- getMap().setDouble( name, value );
+ try {
+ getMap().setDouble(name, value);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-float ActiveMQMapMessage::getFloat( const std::string& name ) const {
+float ActiveMQMapMessage::getFloat(const std::string& name) const {
- try{
- return getMap().getFloat( name );
- } catch( UnsupportedOperationException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
+ try {
+ return getMap().getFloat(name);
+ } catch (UnsupportedOperationException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::setFloat( const std::string& name, float value ) {
+void ActiveMQMapMessage::setFloat(const std::string& name, float value) {
failIfReadOnlyBody();
- try{
- getMap().setFloat( name, value );
+ try {
+ getMap().setFloat(name, value);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-int ActiveMQMapMessage::getInt( const std::string& name ) const {
+int ActiveMQMapMessage::getInt(const std::string& name) const {
- try{
- return getMap().getInt( name );
- } catch( UnsupportedOperationException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
+ try {
+ return getMap().getInt(name);
+ } catch (UnsupportedOperationException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::setInt( const std::string& name, int value ) {
+void ActiveMQMapMessage::setInt(const std::string& name, int value) {
failIfReadOnlyBody();
- try{
- getMap().setInt( name, value );
+ try {
+ getMap().setInt(name, value);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-long long ActiveMQMapMessage::getLong( const std::string& name ) const {
+long long ActiveMQMapMessage::getLong(const std::string& name) const {
- try{
- return getMap().getLong( name );
- } catch( UnsupportedOperationException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
+ try {
+ return getMap().getLong(name);
+ } catch (UnsupportedOperationException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::setLong( const std::string& name, long long value ) {
+void ActiveMQMapMessage::setLong(const std::string& name, long long value) {
failIfReadOnlyBody();
- try{
- getMap().setLong( name, value );
+ try {
+ getMap().setLong(name, value);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-short ActiveMQMapMessage::getShort( const std::string& name ) const {
+short ActiveMQMapMessage::getShort(const std::string& name) const {
- try{
- return getMap().getShort( name );
- } catch( UnsupportedOperationException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
+ try {
+ return getMap().getShort(name);
+ } catch (UnsupportedOperationException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::setShort( const std::string& name, short value ) {
+void ActiveMQMapMessage::setShort(const std::string& name, short value) {
failIfReadOnlyBody();
- try{
- getMap().setShort( name, value );
+ try {
+ getMap().setShort(name, value);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-std::string ActiveMQMapMessage::getString( const std::string& name ) const {
+std::string ActiveMQMapMessage::getString(const std::string& name) const {
- try{
- return getMap().getString( name );
- } catch( UnsupportedOperationException& ex ) {
- throw CMSExceptionSupport::createMessageFormatException( ex );
+ try {
+ return getMap().getString(name);
+ } catch (UnsupportedOperationException& ex) {
+ throw CMSExceptionSupport::createMessageFormatException(ex);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMapMessage::setString( const std::string& name, const std::string& value ) {
+void ActiveMQMapMessage::setString(const std::string& name, const std::string& value) {
failIfReadOnlyBody();
- try{
- getMap().setString( name, value );
+ try {
+ getMap().setString(name, value);
}
AMQ_CATCH_ALL_THROW_CMSEXCEPTION()
}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/615aa518/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h
index 153c436..f30ddbe 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQMapMessage.h
@@ -27,12 +27,10 @@
#include <string>
#include <memory>
-namespace activemq{
-namespace commands{
-
- class AMQCPP_API ActiveMQMapMessage :
- public ActiveMQMessageTemplate<cms::MapMessage> {
+namespace activemq {
+namespace commands {
+ class AMQCPP_API ActiveMQMapMessage : public ActiveMQMessageTemplate<cms::MapMessage> {
private:
// Map Structure to hold unmarshaled Map Data
@@ -40,18 +38,18 @@ namespace commands{
public:
- const static unsigned char ID_ACTIVEMQMAPMESSAGE = 25;
+ const static unsigned char ID_ACTIVEMQMAPMESSAGE;
private:
- ActiveMQMapMessage( const ActiveMQMapMessage& );
- ActiveMQMapMessage& operator= ( const ActiveMQMapMessage& );
+ ActiveMQMapMessage(const ActiveMQMapMessage&);
+ ActiveMQMapMessage& operator=(const ActiveMQMapMessage&);
public:
ActiveMQMapMessage();
- virtual ~ActiveMQMapMessage() throw();
+ virtual ~ActiveMQMapMessage() throw ();
virtual unsigned char getDataStructureType() const;
@@ -61,146 +59,69 @@ namespace commands{
virtual ActiveMQMapMessage* cloneDataStructure() const;
- virtual void copyDataStructure( const DataStructure* src );
+ virtual void copyDataStructure(const DataStructure* src);
- virtual void beforeMarshal( wireformat::WireFormat* wireFormat );
+ virtual void beforeMarshal(wireformat::WireFormat* wireFormat);
virtual std::string toString() const;
- virtual bool equals( const DataStructure* value ) const;
+ virtual bool equals(const DataStructure* value) const;
- virtual void clearBody() throw( cms::CMSException );
+ virtual void clearBody() throw (cms::CMSException);
- public: // CMS Message
+ public: // CMS Message
- virtual cms::MapMessage* clone() const {
- ActiveMQMapMessage* clone = this->cloneDataStructure();
- clone->setReadOnlyBody(false);
- clone->setReadOnlyProperties(false);
- return dynamic_cast<cms::MapMessage*>(clone);
- }
+ virtual cms::MapMessage* clone() const;
- public: // CMS MapMessage
+ public: // CMS MapMessage
- /**
- * {@inheritDoc}
- */
virtual bool isEmpty() const;
- /**
- * {@inheritDoc}
- */
- virtual std::vector< std::string > getMapNames() const;
+ virtual std::vector<std::string> getMapNames() const;
- /**
- * {@inheritDoc}
- */
- virtual bool itemExists( const std::string& name ) const;
+ virtual bool itemExists(const std::string& name) const;
- /**
- * {@inheritDoc}
- */
virtual cms::Message::ValueType getValueType(const std::string& key) const;
- /**
- * {@inheritDoc}
- */
- virtual bool getBoolean( const std::string& name ) const;
+ virtual bool getBoolean(const std::string& name) const;
- /**
- * {@inheritDoc}
- */
- virtual void setBoolean( const std::string& name, bool value );
+ virtual void setBoolean(const std::string& name, bool value);
- /**
- * {@inheritDoc}
- */
- virtual unsigned char getByte( const std::string& name ) const;
+ virtual unsigned char getByte(const std::string& name) const;
- /**
- * {@inheritDoc}
- */
- virtual void setByte( const std::string& name, unsigned char value );
+ virtual void setByte(const std::string& name, unsigned char value);
- /**
- * {@inheritDoc}
- */
- virtual std::vector<unsigned char> getBytes( const std::string& name ) const;
+ virtual std::vector<unsigned char> getBytes(const std::string& name) const;
- /**
- * {@inheritDoc}
- */
- virtual void setBytes( const std::string& name, const std::vector<unsigned char>& value );
+ virtual void setBytes(const std::string& name, const std::vector<unsigned char>& value);
- /**
- * {@inheritDoc}
- */
- virtual char getChar( const std::string& name ) const;
+ virtual char getChar(const std::string& name) const;
- /**
- * {@inheritDoc}
- */
- virtual void setChar( const std::string& name, char value );
+ virtual void setChar(const std::string& name, char value);
- /**
- * {@inheritDoc}
- */
- virtual double getDouble( const std::string& name ) const;
+ virtual double getDouble(const std::string& name) const;
- /**
- * {@inheritDoc}
- */
- virtual void setDouble( const std::string& name, double value );
+ virtual void setDouble(const std::string& name, double value);
- /**
- * {@inheritDoc}
- */
- virtual float getFloat( const std::string& name ) const;
+ virtual float getFloat(const std::string& name) const;
- /**
- * {@inheritDoc}
- */
- virtual void setFloat( const std::string& name, float value );
+ virtual void setFloat(const std::string& name, float value);
- /**
- * {@inheritDoc}
- */
- virtual int getInt( const std::string& name ) const;
+ virtual int getInt(const std::string& name) const;
- /**
- * {@inheritDoc}
- */
- virtual void setInt( const std::string& name, int value );
+ virtual void setInt(const std::string& name, int value);
- /**
- * {@inheritDoc}
- */
- virtual long long getLong( const std::string& name ) const;
+ virtual long long getLong(const std::string& name) const;
- /**
- * {@inheritDoc}
- */
- virtual void setLong( const std::string& name, long long value );
+ virtual void setLong(const std::string& name, long long value);
- /**
- * {@inheritDoc}
- */
- virtual short getShort( const std::string& name ) const;
+ virtual short getShort(const std::string& name) const;
- /**
- * {@inheritDoc}
- */
- virtual void setShort( const std::string& name, short value );
+ virtual void setShort(const std::string& name, short value);
- /**
- * {@inheritDoc}
- */
- virtual std::string getString( const std::string& name ) const;
+ virtual std::string getString(const std::string& name) const;
- /**
- * {@inheritDoc}
- */
- virtual void setString( const std::string& name, const std::string& value );
+ virtual void setString(const std::string& name, const std::string& value);
protected:
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/615aa518/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.cpp b/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.cpp
index a0d87c8..3b4f3cd 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.cpp
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.cpp
@@ -22,8 +22,10 @@ using namespace activemq::util;
using namespace activemq::commands;
////////////////////////////////////////////////////////////////////////////////
-ActiveMQMessage::ActiveMQMessage() :
- ActiveMQMessageTemplate<cms::Message>()
+const unsigned char ActiveMQMessage::ID_ACTIVEMQMESSAGE = 23;
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQMessage::ActiveMQMessage() : ActiveMQMessageTemplate<cms::Message>()
{}
////////////////////////////////////////////////////////////////////////////////
@@ -32,23 +34,31 @@ unsigned char ActiveMQMessage::getDataStructureType() const {
}
////////////////////////////////////////////////////////////////////////////////
-void ActiveMQMessage::copyDataStructure( const DataStructure* src ) {
- ActiveMQMessageTemplate<cms::Message>::copyDataStructure( src );
+void ActiveMQMessage::copyDataStructure(const DataStructure* src) {
+ ActiveMQMessageTemplate<cms::Message>::copyDataStructure(src);
}
////////////////////////////////////////////////////////////////////////////////
ActiveMQMessage* ActiveMQMessage::cloneDataStructure() const {
ActiveMQMessage* message = new ActiveMQMessage();
- message->copyDataStructure( this );
+ message->copyDataStructure(this);
return message;
}
////////////////////////////////////////////////////////////////////////////////
-std::string ActiveMQMessage::toString() const{
+cms::Message* ActiveMQMessage::clone() const {
+ ActiveMQMessage* clone = this->cloneDataStructure();
+ clone->setReadOnlyBody(false);
+ clone->setReadOnlyProperties(false);
+ return dynamic_cast<cms::Message*>(clone);
+}
+
+////////////////////////////////////////////////////////////////////////////////
+std::string ActiveMQMessage::toString() const {
return ActiveMQMessageTemplate<cms::Message>::toString();
}
////////////////////////////////////////////////////////////////////////////////
-bool ActiveMQMessage::equals( const DataStructure* value ) const {
- return ActiveMQMessageTemplate<cms::Message>::equals( value );
+bool ActiveMQMessage::equals(const DataStructure* value) const {
+ return ActiveMQMessageTemplate<cms::Message>::equals(value);
}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/615aa518/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h
index 57fdac8..aec86f0 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQMessage.h
@@ -22,45 +22,38 @@
#include <activemq/util/Config.h>
#include <activemq/commands/ActiveMQMessageTemplate.h>
-namespace activemq{
-namespace commands{
-
- class AMQCPP_API ActiveMQMessage :
- public ActiveMQMessageTemplate<cms::Message> {
+namespace activemq {
+namespace commands {
+ class AMQCPP_API ActiveMQMessage : public ActiveMQMessageTemplate<cms::Message> {
public:
- static const unsigned char ID_ACTIVEMQMESSAGE = 23;
+ static const unsigned char ID_ACTIVEMQMESSAGE;
private:
- ActiveMQMessage( const ActiveMQMessage& );
- ActiveMQMessage& operator= ( const ActiveMQMessage& );
+ ActiveMQMessage(const ActiveMQMessage&);
+ ActiveMQMessage& operator=(const ActiveMQMessage&);
public:
ActiveMQMessage();
- virtual ~ActiveMQMessage() throw() {}
+ virtual ~ActiveMQMessage() throw () {}
virtual unsigned char getDataStructureType() const;
- virtual void copyDataStructure( const DataStructure* src );
+ virtual void copyDataStructure(const DataStructure* src);
virtual ActiveMQMessage* cloneDataStructure() const;
virtual std::string toString() const;
- virtual bool equals( const DataStructure* value ) const;
+ virtual bool equals(const DataStructure* value) const;
- public: // cms::Message
+ public: // CMS Message
- virtual cms::Message* clone() const {
- ActiveMQMessage* clone = this->cloneDataStructure();
- clone->setReadOnlyBody(false);
- clone->setReadOnlyProperties(false);
- return dynamic_cast<cms::Message*>(clone);
- }
+ virtual cms::Message* clone() const;
};
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/615aa518/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.cpp b/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.cpp
index 87fceee..112320f 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.cpp
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.cpp
@@ -39,8 +39,10 @@ using namespace decaf::util;
using namespace decaf::util::zip;
////////////////////////////////////////////////////////////////////////////////
-ActiveMQObjectMessage::ActiveMQObjectMessage() :
- ActiveMQMessageTemplate<cms::ObjectMessage> () {
+const unsigned char ActiveMQObjectMessage::ID_ACTIVEMQOBJECTMESSAGE = 26;
+
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQObjectMessage::ActiveMQObjectMessage() : ActiveMQMessageTemplate<cms::ObjectMessage> () {
}
////////////////////////////////////////////////////////////////////////////////
@@ -56,6 +58,14 @@ ActiveMQObjectMessage* ActiveMQObjectMessage::cloneDataStructure() const {
}
////////////////////////////////////////////////////////////////////////////////
+cms::Message* ActiveMQObjectMessage::clone() const {
+ ActiveMQObjectMessage* clone = this->cloneDataStructure();
+ clone->setReadOnlyBody(false);
+ clone->setReadOnlyProperties(false);
+ return dynamic_cast<cms::Message*>(clone);
+}
+
+////////////////////////////////////////////////////////////////////////////////
void ActiveMQObjectMessage::copyDataStructure(const DataStructure* src) {
ActiveMQMessageTemplate<cms::ObjectMessage>::copyDataStructure(src);
}
@@ -129,7 +139,6 @@ std::vector<unsigned char> ActiveMQObjectMessage::getObjectBytes() const {
inflater.close();
return uncompressed;
-
} else {
return this->getContent();
}
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/615aa518/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h
index 79a0c3b..52f095f 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQObjectMessage.h
@@ -23,15 +23,13 @@
#include <activemq/util/Config.h>
#include <memory>
-namespace activemq{
-namespace commands{
-
- class AMQCPP_API ActiveMQObjectMessage :
- public ActiveMQMessageTemplate<cms::ObjectMessage> {
+namespace activemq {
+namespace commands {
+ class AMQCPP_API ActiveMQObjectMessage : public ActiveMQMessageTemplate<cms::ObjectMessage> {
public:
- const static unsigned char ID_ACTIVEMQOBJECTMESSAGE = 26;
+ const static unsigned char ID_ACTIVEMQOBJECTMESSAGE;
private:
@@ -55,16 +53,11 @@ namespace commands{
virtual bool equals(const DataStructure* value) const;
- public: // cms::Message
+ public: // CMS Message
- virtual cms::Message* clone() const {
- ActiveMQObjectMessage* clone = this->cloneDataStructure();
- clone->setReadOnlyBody(false);
- clone->setReadOnlyProperties(false);
- return dynamic_cast<cms::Message*>(clone);
- }
+ virtual cms::Message* clone() const;
- public: // cms::ObjectMessage
+ public: // CMS ObjectMessage
virtual void setObjectBytes(const std::vector<unsigned char>& bytes);
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/615aa518/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp b/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp
index ebc88bc..b38ba71 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.cpp
@@ -85,9 +85,13 @@ namespace commands {
}}
////////////////////////////////////////////////////////////////////////////////
-ActiveMQStreamMessage::ActiveMQStreamMessage() :
- ActiveMQMessageTemplate<cms::StreamMessage>(), impl(new ActiveMQStreamMessageImpl()), dataIn(), dataOut() {
+const unsigned char ActiveMQStreamMessage::ID_ACTIVEMQSTREAMMESSAGE = 27;
+////////////////////////////////////////////////////////////////////////////////
+ActiveMQStreamMessage::ActiveMQStreamMessage() : ActiveMQMessageTemplate<cms::StreamMessage>(),
+ impl(new ActiveMQStreamMessageImpl()),
+ dataIn(),
+ dataOut() {
this->clearBody();
}
@@ -113,6 +117,14 @@ ActiveMQStreamMessage* ActiveMQStreamMessage::cloneDataStructure() const {
}
////////////////////////////////////////////////////////////////////////////////
+cms::StreamMessage* ActiveMQStreamMessage::clone() const {
+ ActiveMQStreamMessage* clone = this->cloneDataStructure();
+ clone->setReadOnlyBody(false);
+ clone->setReadOnlyProperties(false);
+ return dynamic_cast<cms::StreamMessage*>(clone);
+}
+
+////////////////////////////////////////////////////////////////////////////////
void ActiveMQStreamMessage::copyDataStructure(const DataStructure* src) {
// Protect against invalid self assignment.
http://git-wip-us.apache.org/repos/asf/activemq-cpp/blob/615aa518/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h
----------------------------------------------------------------------
diff --git a/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h b/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h
index 0514131..790238a 100644
--- a/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h
+++ b/activemq-cpp/src/main/activemq/commands/ActiveMQStreamMessage.h
@@ -47,7 +47,7 @@ namespace commands {
public:
- const static unsigned char ID_ACTIVEMQSTREAMMESSAGE = 27;
+ const static unsigned char ID_ACTIVEMQSTREAMMESSAGE;
private:
@@ -57,6 +57,7 @@ namespace commands {
public:
ActiveMQStreamMessage();
+
virtual ~ActiveMQStreamMessage() throw ();
virtual unsigned char getDataStructureType() const;
@@ -73,12 +74,7 @@ namespace commands {
public: // CMS Message
- virtual cms::StreamMessage* clone() const {
- ActiveMQStreamMessage* clone = this->cloneDataStructure();
- clone->setReadOnlyBody(false);
- clone->setReadOnlyProperties(false);
- return dynamic_cast<cms::StreamMessage*>(clone);
- }
+ virtual cms::StreamMessage* clone() const;
virtual void clearBody();