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 2012/10/18 20:58:04 UTC
svn commit: r1399781 [3/3] - in
/activemq/activemq-cpp/trunk/activemq-cpp/src/main: ./ activemq/library/
activemq/state/ activemq/threads/ activemq/transport/mock/ activemq/util/
activemq/wireformat/ activemq/wireformat/openwire/marshal/
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.cpp?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.cpp Thu Oct 18 18:58:02 2012
@@ -36,135 +36,119 @@ using namespace activemq::util;
////////////////////////////////////////////////////////////////////////////////
PrimitiveValueNode::PrimitiveValueNode() : valueType(NULL_TYPE), value() {
- memset( &value, 0, sizeof(value) );
+ memset(&value, 0, sizeof(value));
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( bool value ) : valueType(NULL_TYPE), value() {
- this->setBool( value );
+PrimitiveValueNode::PrimitiveValueNode(bool value) : valueType(NULL_TYPE), value() {
+ this->setBool(value);
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( unsigned char value ) : valueType(NULL_TYPE), value() {
- this->setByte( value );
+PrimitiveValueNode::PrimitiveValueNode(unsigned char value) : valueType(NULL_TYPE), value() {
+ this->setByte(value);
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( char value ) : valueType(NULL_TYPE), value() {
- this->setChar( value );
+PrimitiveValueNode::PrimitiveValueNode(char value) : valueType(NULL_TYPE), value() {
+ this->setChar(value);
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( short value ) : valueType(NULL_TYPE), value() {
- this->setShort( value );
+PrimitiveValueNode::PrimitiveValueNode(short value) : valueType(NULL_TYPE), value() {
+ this->setShort(value);
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( int value ) : valueType(NULL_TYPE), value() {
- this->setInt( value );
+PrimitiveValueNode::PrimitiveValueNode(int value) : valueType(NULL_TYPE), value() {
+ this->setInt(value);
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( long long value ) : valueType(NULL_TYPE), value() {
- this->setLong( value );
+PrimitiveValueNode::PrimitiveValueNode(long long value) : valueType(NULL_TYPE), value() {
+ this->setLong(value);
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( float value ) : valueType(NULL_TYPE), value() {
- this->setFloat( value );
+PrimitiveValueNode::PrimitiveValueNode(float value) : valueType(NULL_TYPE), value() {
+ this->setFloat(value);
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( double value ) : valueType(NULL_TYPE), value() {
- this->setDouble( value );
+PrimitiveValueNode::PrimitiveValueNode(double value) : valueType(NULL_TYPE), value() {
+ this->setDouble(value);
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( const char* value ) : valueType(NULL_TYPE), value() {
- if( value != NULL ) {
- this->setString( string( value ) );
+PrimitiveValueNode::PrimitiveValueNode(const char* value) : valueType(NULL_TYPE), value() {
+ if (value != NULL) {
+ this->setString(string(value));
}
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( const std::string& value ) : valueType(NULL_TYPE), value() {
- this->setString( value );
+PrimitiveValueNode::PrimitiveValueNode(const std::string& value) : valueType(NULL_TYPE), value() {
+ this->setString(value);
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( const std::vector<unsigned char>& value ) : valueType(NULL_TYPE), value() {
- this->setByteArray( value );
+PrimitiveValueNode::PrimitiveValueNode(const std::vector<unsigned char>& value) : valueType(NULL_TYPE), value() {
+ this->setByteArray(value);
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode(
- const decaf::util::List<PrimitiveValueNode>& value ) : valueType(NULL_TYPE), value() {
-
- this->setList( value );
+PrimitiveValueNode::PrimitiveValueNode(const decaf::util::List<PrimitiveValueNode>& value) : valueType(NULL_TYPE), value() {
+ this->setList(value);
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode(
- const decaf::util::Map<std::string, PrimitiveValueNode>& value ) : valueType(NULL_TYPE), value() {
-
- this->setMap( value );
+PrimitiveValueNode::PrimitiveValueNode(const decaf::util::Map<std::string, PrimitiveValueNode>& value) : valueType(NULL_TYPE), value() {
+ this->setMap(value);
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode::PrimitiveValueNode( const PrimitiveValueNode& node ) : valueType(NULL_TYPE), value() {
+PrimitiveValueNode::PrimitiveValueNode(const PrimitiveValueNode& node) : valueType(NULL_TYPE), value() {
(*this) = node;
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode& PrimitiveValueNode::operator =( const PrimitiveValueNode& node ) {
+PrimitiveValueNode& PrimitiveValueNode::operator =(const PrimitiveValueNode& node) {
clear();
- this->setValue( node.getValue(), node.getType() );
+ this->setValue(node.getValue(), node.getType());
return *this;
}
////////////////////////////////////////////////////////////////////////////////
-bool PrimitiveValueNode::operator==( const PrimitiveValueNode& node ) const {
+bool PrimitiveValueNode::operator==(const PrimitiveValueNode& node) const {
- if( valueType != node.valueType ) {
- return false;
+ if (valueType != node.valueType) {
+ return false;
}
- if( valueType == BOOLEAN_TYPE &&
- value.boolValue == node.value.boolValue ) {
- return true;
- } else if( valueType == BYTE_TYPE &&
- value.byteValue == node.value.byteValue ) {
- return true;
- } else if( valueType == CHAR_TYPE &&
- value.charValue == node.value.charValue ) {
- return true;
- } else if( valueType == SHORT_TYPE &&
- value.shortValue == node.value.shortValue ) {
- return true;
- } else if( valueType == INTEGER_TYPE &&
- value.intValue == node.value.intValue ) {
- return true;
- } else if( valueType == LONG_TYPE &&
- value.longValue == node.value.longValue ) {
- return true;
- } else if( valueType == DOUBLE_TYPE &&
- value.doubleValue == node.value.doubleValue ) {
- return true;
- } else if( valueType == FLOAT_TYPE &&
- value.floatValue == node.value.floatValue ) {
- return true;
- } else if( valueType == STRING_TYPE &&
- *value.stringValue == *node.value.stringValue ) {
- return true;
- } else if( valueType == BYTE_ARRAY_TYPE &&
- *value.byteArrayValue == *node.value.byteArrayValue ) {
- return true;
- } else if( valueType == LIST_TYPE &&
- value.listValue->equals( *node.value.listValue ) ) {
- return true;
- } else if( valueType == MAP_TYPE &&
- value.mapValue->equals( *node.value.mapValue ) ) {
- return true;
+ if (valueType == BOOLEAN_TYPE && value.boolValue == node.value.boolValue) {
+ return true;
+ } else if (valueType == BYTE_TYPE && value.byteValue == node.value.byteValue) {
+ return true;
+ } else if (valueType == CHAR_TYPE && value.charValue == node.value.charValue) {
+ return true;
+ } else if (valueType == SHORT_TYPE && value.shortValue == node.value.shortValue) {
+ return true;
+ } else if (valueType == INTEGER_TYPE && value.intValue == node.value.intValue) {
+ return true;
+ } else if (valueType == LONG_TYPE && value.longValue == node.value.longValue) {
+ return true;
+ } else if (valueType == DOUBLE_TYPE && value.doubleValue == node.value.doubleValue) {
+ return true;
+ } else if (valueType == FLOAT_TYPE && value.floatValue == node.value.floatValue) {
+ return true;
+ } else if (valueType == STRING_TYPE && *value.stringValue == *node.value.stringValue) {
+ return true;
+ } else if (valueType == BYTE_ARRAY_TYPE && *value.byteArrayValue == *node.value.byteArrayValue) {
+ return true;
+ } else if (valueType == LIST_TYPE && value.listValue->equals(*node.value.listValue)) {
+ return true;
+ } else if (valueType == MAP_TYPE && value.mapValue->equals(*node.value.mapValue)) {
+ return true;
}
return false;
@@ -173,55 +157,54 @@ bool PrimitiveValueNode::operator==( con
////////////////////////////////////////////////////////////////////////////////
void PrimitiveValueNode::clear() {
- if( valueType == STRING_TYPE && value.stringValue != NULL ) {
+ if (valueType == STRING_TYPE && value.stringValue != NULL) {
delete value.stringValue;
- } else if( valueType == BYTE_ARRAY_TYPE && value.byteArrayValue != NULL ) {
+ } else if (valueType == BYTE_ARRAY_TYPE && value.byteArrayValue != NULL) {
delete value.byteArrayValue;
- } else if( valueType == LIST_TYPE && value.listValue != NULL ) {
+ } else if (valueType == LIST_TYPE && value.listValue != NULL) {
delete value.listValue;
- } else if( valueType == MAP_TYPE && value.mapValue != NULL ) {
+ } else if (valueType == MAP_TYPE && value.mapValue != NULL) {
delete value.mapValue;
}
valueType = NULL_TYPE;
- memset( &value, 0, sizeof(value) );
+ memset(&value, 0, sizeof(value));
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setValue(
- const PrimitiveValue& value, PrimitiveType valueType ) {
+void PrimitiveValueNode::setValue(const PrimitiveValue& value, PrimitiveType valueType) {
- if( valueType == BOOLEAN_TYPE ) {
- this->setBool( value.boolValue );
- } else if( valueType == BYTE_TYPE ) {
- this->setByte( value.byteValue );
- } else if( valueType == CHAR_TYPE ) {
- this->setChar( value.charValue );
- } else if( valueType == SHORT_TYPE ) {
- this->setShort( value.shortValue );
- } else if( valueType == INTEGER_TYPE ) {
- this->setInt( value.intValue );
- } else if( valueType == LONG_TYPE ) {
- this->setLong( value.longValue );
- } else if( valueType == DOUBLE_TYPE ) {
- this->setDouble( value.doubleValue );
- } else if( valueType == FLOAT_TYPE ) {
- this->setFloat( value.floatValue );
- } else if( valueType == STRING_TYPE || valueType == BIG_STRING_TYPE ) {
- this->setString( *value.stringValue );
- } else if( valueType == BYTE_ARRAY_TYPE ) {
- this->setByteArray( *value.byteArrayValue );
- } else if( valueType == LIST_TYPE ) {
- this->setList( *value.listValue );
- } else if( valueType == MAP_TYPE ) {
- this->setMap( *value.mapValue );
+ if (valueType == BOOLEAN_TYPE) {
+ this->setBool(value.boolValue);
+ } else if (valueType == BYTE_TYPE) {
+ this->setByte(value.byteValue);
+ } else if (valueType == CHAR_TYPE) {
+ this->setChar(value.charValue);
+ } else if (valueType == SHORT_TYPE) {
+ this->setShort(value.shortValue);
+ } else if (valueType == INTEGER_TYPE) {
+ this->setInt(value.intValue);
+ } else if (valueType == LONG_TYPE) {
+ this->setLong(value.longValue);
+ } else if (valueType == DOUBLE_TYPE) {
+ this->setDouble(value.doubleValue);
+ } else if (valueType == FLOAT_TYPE) {
+ this->setFloat(value.floatValue);
+ } else if (valueType == STRING_TYPE || valueType == BIG_STRING_TYPE) {
+ this->setString(*value.stringValue);
+ } else if (valueType == BYTE_ARRAY_TYPE) {
+ this->setByteArray(*value.byteArrayValue);
+ } else if (valueType == LIST_TYPE) {
+ this->setList(*value.listValue);
+ } else if (valueType == MAP_TYPE) {
+ this->setMap(*value.mapValue);
} else {
this->clear();
}
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setBool( bool lvalue ) {
+void PrimitiveValueNode::setBool(bool lvalue) {
clear();
valueType = BOOLEAN_TYPE;
value.boolValue = lvalue;
@@ -230,16 +213,15 @@ void PrimitiveValueNode::setBool( bool l
////////////////////////////////////////////////////////////////////////////////
bool PrimitiveValueNode::getBool() const {
- if( valueType != BOOLEAN_TYPE ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__, "PrimitiveValue is not BOOLEAN_TYPE" );
+ if (valueType != BOOLEAN_TYPE) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not BOOLEAN_TYPE");
}
return value.boolValue;
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setByte( unsigned char lvalue ) {
+void PrimitiveValueNode::setByte(unsigned char lvalue) {
clear();
valueType = BYTE_TYPE;
value.byteValue = lvalue;
@@ -248,16 +230,15 @@ void PrimitiveValueNode::setByte( unsign
////////////////////////////////////////////////////////////////////////////////
unsigned char PrimitiveValueNode::getByte() const {
- if( valueType != BYTE_TYPE ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__, "PrimitiveValue is not BYTE_TYPE" );
+ if (valueType != BYTE_TYPE) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not BYTE_TYPE");
}
return value.byteValue;
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setChar( char lvalue ) {
+void PrimitiveValueNode::setChar(char lvalue) {
clear();
valueType = CHAR_TYPE;
value.charValue = lvalue;
@@ -266,16 +247,15 @@ void PrimitiveValueNode::setChar( char l
////////////////////////////////////////////////////////////////////////////////
char PrimitiveValueNode::getChar() const {
- if( valueType != CHAR_TYPE ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__, "PrimitiveValue is not CHAR_TYPE" );
+ if (valueType != CHAR_TYPE) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not CHAR_TYPE");
}
return value.charValue;
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setShort( short lvalue ) {
+void PrimitiveValueNode::setShort(short lvalue) {
clear();
valueType = SHORT_TYPE;
value.shortValue = lvalue;
@@ -284,16 +264,15 @@ void PrimitiveValueNode::setShort( short
////////////////////////////////////////////////////////////////////////////////
short PrimitiveValueNode::getShort() const {
- if( valueType != SHORT_TYPE ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__, "PrimitiveValue is not SHORT_TYPE" );
+ if (valueType != SHORT_TYPE) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not SHORT_TYPE");
}
return value.shortValue;
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setInt( int lvalue ) {
+void PrimitiveValueNode::setInt(int lvalue) {
clear();
valueType = INTEGER_TYPE;
value.intValue = lvalue;
@@ -302,16 +281,15 @@ void PrimitiveValueNode::setInt( int lva
////////////////////////////////////////////////////////////////////////////////
int PrimitiveValueNode::getInt() const {
- if( valueType != INTEGER_TYPE ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__, "PrimitiveValue is not INTEGER_TYPE" );
+ if (valueType != INTEGER_TYPE) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not INTEGER_TYPE");
}
return value.intValue;
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setLong( long long lvalue ) {
+void PrimitiveValueNode::setLong(long long lvalue) {
clear();
valueType = LONG_TYPE;
value.longValue = lvalue;
@@ -320,16 +298,15 @@ void PrimitiveValueNode::setLong( long l
////////////////////////////////////////////////////////////////////////////////
long long PrimitiveValueNode::getLong() const {
- if( valueType != LONG_TYPE ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__, "PrimitiveValue is not LONG_TYPE" );
+ if (valueType != LONG_TYPE) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not LONG_TYPE");
}
return value.longValue;
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setDouble( double lvalue ) {
+void PrimitiveValueNode::setDouble(double lvalue) {
clear();
valueType = DOUBLE_TYPE;
value.doubleValue = lvalue;
@@ -338,16 +315,15 @@ void PrimitiveValueNode::setDouble( doub
////////////////////////////////////////////////////////////////////////////////
double PrimitiveValueNode::getDouble() const {
- if( valueType != DOUBLE_TYPE ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__, "PrimitiveValue is not DOUBLE_TYPE" );
+ if (valueType != DOUBLE_TYPE) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not DOUBLE_TYPE");
}
return value.doubleValue;
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setFloat( float lvalue ) {
+void PrimitiveValueNode::setFloat(float lvalue) {
clear();
valueType = FLOAT_TYPE;
value.floatValue = lvalue;
@@ -356,30 +332,28 @@ void PrimitiveValueNode::setFloat( float
////////////////////////////////////////////////////////////////////////////////
float PrimitiveValueNode::getFloat() const {
- if( valueType != FLOAT_TYPE ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__, "PrimitiveValue is not FLOAT_TYPE" );
+ if (valueType != FLOAT_TYPE) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not FLOAT_TYPE");
}
return value.floatValue;
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setString( const std::string& lvalue ) {
+void PrimitiveValueNode::setString(const std::string& lvalue) {
clear();
valueType = STRING_TYPE;
- value.stringValue = new std::string( lvalue );
+ value.stringValue = new std::string(lvalue);
}
////////////////////////////////////////////////////////////////////////////////
std::string PrimitiveValueNode::getString() const {
- if( valueType != STRING_TYPE ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__, "PrimitiveValue is not STRING_TYPE" );
+ if (valueType != STRING_TYPE) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not STRING_TYPE");
}
- if( value.stringValue == NULL ){
+ if (value.stringValue == NULL) {
return std::string();
}
@@ -387,21 +361,20 @@ std::string PrimitiveValueNode::getStrin
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setByteArray( const std::vector<unsigned char>& lvalue ) {
+void PrimitiveValueNode::setByteArray(const std::vector<unsigned char>& lvalue) {
clear();
valueType = BYTE_ARRAY_TYPE;
- value.byteArrayValue = new std::vector<unsigned char>( lvalue );
+ value.byteArrayValue = new std::vector<unsigned char>(lvalue);
}
////////////////////////////////////////////////////////////////////////////////
std::vector<unsigned char> PrimitiveValueNode::getByteArray() const {
- if( valueType != BYTE_ARRAY_TYPE ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__, "PrimitiveValue is not BYTE_ARRAY_TYPE" );
+ if (valueType != BYTE_ARRAY_TYPE) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not BYTE_ARRAY_TYPE");
}
- if( value.byteArrayValue == NULL ){
+ if (value.byteArrayValue == NULL) {
return std::vector<unsigned char>();
}
@@ -409,53 +382,44 @@ std::vector<unsigned char> PrimitiveValu
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setList( const decaf::util::List<PrimitiveValueNode>& lvalue ) {
+void PrimitiveValueNode::setList(const decaf::util::List<PrimitiveValueNode>& lvalue) {
clear();
valueType = LIST_TYPE;
value.listValue = new decaf::util::LinkedList<PrimitiveValueNode>();
- value.listValue->copy( lvalue );
+ value.listValue->copy(lvalue);
}
////////////////////////////////////////////////////////////////////////////////
const decaf::util::List<PrimitiveValueNode>& PrimitiveValueNode::getList() const {
- if( valueType != LIST_TYPE ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__,
- "PrimitiveValue is not LIST_TYPE" );
+ if (valueType != LIST_TYPE) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not LIST_TYPE");
}
- if( value.listValue == NULL ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__,
- "PrimitiveValue is not set but an element was placed in the Map" );
+ if (value.listValue == NULL) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not set but an element was placed in the Map");
}
return *value.listValue;
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveValueNode::setMap(
- const decaf::util::Map<std::string, PrimitiveValueNode>& lvalue ) {
+void PrimitiveValueNode::setMap(const decaf::util::Map<std::string, PrimitiveValueNode>& lvalue) {
clear();
valueType = MAP_TYPE;
- value.mapValue = new decaf::util::StlMap<std::string, PrimitiveValueNode>( lvalue );
+ value.mapValue = new decaf::util::StlMap<std::string, PrimitiveValueNode>(lvalue);
}
////////////////////////////////////////////////////////////////////////////////
const decaf::util::Map<std::string, PrimitiveValueNode>& PrimitiveValueNode::getMap() const {
- if( valueType != MAP_TYPE ){
- throw decaf::util::NoSuchElementException(
- __FILE__, __LINE__,
- "PrimitiveValue is not MAP_TYPE" );
+ if (valueType != MAP_TYPE) {
+ throw decaf::util::NoSuchElementException(__FILE__, __LINE__, "PrimitiveValue is not MAP_TYPE");
}
- if( value.mapValue == NULL ){
- throw decaf::lang::exceptions::NullPointerException(
- __FILE__, __LINE__,
- "PrimitiveValue is not set but an element was placed in the Map" );
+ if (value.mapValue == NULL) {
+ throw decaf::lang::exceptions::NullPointerException(__FILE__, __LINE__, "PrimitiveValue is not set but an element was placed in the Map");
}
return *value.mapValue;
@@ -465,34 +429,33 @@ const decaf::util::Map<std::string, Prim
std::string PrimitiveValueNode::toString() const {
std::ostringstream stream;
- if( valueType == BOOLEAN_TYPE ) {
+ if (valueType == BOOLEAN_TYPE) {
stream << std::boolalpha << value.boolValue;
- } else if( valueType == BYTE_TYPE ) {
+ } else if (valueType == BYTE_TYPE) {
stream << value.byteValue;
- } else if( valueType == CHAR_TYPE ) {
+ } else if (valueType == CHAR_TYPE) {
stream << value.charValue;
- } else if( valueType == SHORT_TYPE ) {
+ } else if (valueType == SHORT_TYPE) {
stream << value.shortValue;
- } else if( valueType == INTEGER_TYPE ) {
+ } else if (valueType == INTEGER_TYPE) {
stream << value.intValue;
- } else if( valueType == LONG_TYPE ) {
+ } else if (valueType == LONG_TYPE) {
stream << value.longValue;
- } else if( valueType == DOUBLE_TYPE ) {
+ } else if (valueType == DOUBLE_TYPE) {
stream << value.doubleValue;
- } else if( valueType == FLOAT_TYPE ) {
+ } else if (valueType == FLOAT_TYPE) {
stream << value.floatValue;
- } else if( valueType == STRING_TYPE || valueType == BIG_STRING_TYPE ) {
+ } else if (valueType == STRING_TYPE || valueType == BIG_STRING_TYPE) {
stream << *value.stringValue;
- } else if( valueType == BYTE_ARRAY_TYPE ) {
- std::vector<unsigned char>::const_iterator iter =
- value.byteArrayValue->begin();
- for( ; iter != value.byteArrayValue->end(); ++iter ) {
- stream << '[' << (int)(*iter) << ']';
+ } else if (valueType == BYTE_ARRAY_TYPE) {
+ std::vector<unsigned char>::const_iterator iter = value.byteArrayValue->begin();
+ for (; iter != value.byteArrayValue->end(); ++iter) {
+ stream << '[' << (int) (*iter) << ']';
}
- } else if( valueType == LIST_TYPE ) {
- stream << PrimitiveList( *value.listValue ).toString();
- } else if( valueType == MAP_TYPE ) {
- stream << PrimitiveMap( *value.mapValue ).toString();
+ } else if (valueType == LIST_TYPE) {
+ stream << PrimitiveList(*value.listValue).toString();
+ } else if (valueType == MAP_TYPE) {
+ stream << PrimitiveMap(*value.mapValue).toString();
}
return stream.str();
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/PrimitiveValueNode.h Thu Oct 18 18:58:02 2012
@@ -23,8 +23,8 @@
#include <decaf/util/Map.h>
#include <decaf/util/List.h>
-namespace activemq{
-namespace util{
+namespace activemq {
+namespace util {
/**
* Class that wraps around a single value of one of the
@@ -94,89 +94,88 @@ namespace util{
* Boolean Value Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode( bool value );
+ PrimitiveValueNode(bool value);
/**
* Byte Value Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode( unsigned char value );
+ PrimitiveValueNode(unsigned char value);
/**
* Char Value Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode( char value );
+ PrimitiveValueNode(char value);
/**
* Short Value Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode( short value );
+ PrimitiveValueNode(short value);
/**
* Int Value Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode( int value );
+ PrimitiveValueNode(int value);
/**
* Long Value Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode( long long value );
+ PrimitiveValueNode(long long value);
/**
* Float Value Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode( float value );
+ PrimitiveValueNode(float value);
/**
* Double Value Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode( double value );
+ PrimitiveValueNode(double value);
/**
* String Value Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode( const char* value );
+ PrimitiveValueNode(const char* value);
/**
* String Value Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode( const std::string& value );
+ PrimitiveValueNode(const std::string& value);
/**
* Byte Array Value Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode( const std::vector<unsigned char>& value );
+ PrimitiveValueNode(const std::vector<unsigned char>& value);
/**
* Primtive List Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode( const decaf::util::List<PrimitiveValueNode>& value );
+ PrimitiveValueNode(const decaf::util::List<PrimitiveValueNode>& value);
/**
* Primtive Map Value Constructor
* @param value - the new value to store.
*/
- PrimitiveValueNode(
- const decaf::util::Map<std::string, PrimitiveValueNode>& value );
+ PrimitiveValueNode(const decaf::util::Map<std::string, PrimitiveValueNode>& value);
/**
* Copy constructor
* @param node
* The instance of another node to copy to this one.
*/
- PrimitiveValueNode( const PrimitiveValueNode& node );
+ PrimitiveValueNode(const PrimitiveValueNode& node);
- ~PrimitiveValueNode(){
+ ~PrimitiveValueNode() {
clear();
}
@@ -186,19 +185,21 @@ namespace util{
* @param node
* The instance of another node to copy to this one.
*/
- PrimitiveValueNode& operator =( const PrimitiveValueNode& node );
+ PrimitiveValueNode& operator =(const PrimitiveValueNode& node);
/**
* Comparison Operator, compares this node to the other node.
* @return true if the values are the same false otherwise.
*/
- bool operator==( const PrimitiveValueNode& node ) const;
+ bool operator==(const PrimitiveValueNode& node) const;
/**
* Gets the Value Type of this type wrapper.
* @return the PrimitiveType value for this wrapper.
*/
- PrimitiveType getType() const { return valueType; }
+ PrimitiveType getType() const {
+ return valueType;
+ }
/**
* Gets the internal Primitive Value object from this wrapper.
@@ -217,7 +218,7 @@ namespace util{
* @param valueType
* The type of the value being set into this one.
*/
- void setValue( const PrimitiveValue& value, PrimitiveType valueType );
+ void setValue(const PrimitiveValue& value, PrimitiveType valueType);
/**
* Clears the value from this wrapper converting it back to a blank
@@ -231,7 +232,7 @@ namespace util{
* given.
* @param value - the new value to assign to the element at index
*/
- void setBool( bool value );
+ void setBool(bool value);
/**
* Gets the Boolean value of this Node.
@@ -247,7 +248,7 @@ namespace util{
* given.
* @param value - the new value to assign to the element at index
*/
- void setByte( unsigned char value );
+ void setByte(unsigned char value);
/**
* Gets the Byte value of this Node.
@@ -263,7 +264,7 @@ namespace util{
* given.
* @param value - the new value to assign to the element at index
*/
- void setChar( char value );
+ void setChar(char value);
/**
* Gets the Character value of this Node.
@@ -279,7 +280,7 @@ namespace util{
* given.
* @param value - the new value to assign to the element at index
*/
- void setShort( short value );
+ void setShort(short value);
/**
* Gets the Short value of this Node.
@@ -295,7 +296,7 @@ namespace util{
* given.
* @param value - the new value to assign to the element at index
*/
- void setInt( int value );
+ void setInt(int value);
/**
* Gets the Integer value of this Node.
@@ -311,7 +312,7 @@ namespace util{
* given.
* @param value - the new value to assign to the element at index
*/
- void setLong( long long value );
+ void setLong(long long value);
/**
* Gets the Long value of this Node.
@@ -327,7 +328,7 @@ namespace util{
* given.
* @param value - the new value to assign to the element at index
*/
- void setFloat( float value );
+ void setFloat(float value);
/**
* Gets the Float value of this Node.
@@ -343,7 +344,7 @@ namespace util{
* given.
* @param value - the new value to assign to the element at index
*/
- void setDouble( double value );
+ void setDouble(double value);
/**
* Gets the Double value of this Node.
@@ -359,7 +360,7 @@ namespace util{
* given.
* @param value - the new value to assign to the element at index
*/
- void setString( const std::string& value );
+ void setString(const std::string& value);
/**
* Gets the String value of this Node.
@@ -375,7 +376,7 @@ namespace util{
* given.
* @param value - the new value to assign to the element at index
*/
- void setByteArray( const std::vector<unsigned char>& value );
+ void setByteArray(const std::vector<unsigned char>& value);
/**
* Gets the Byte Array value of this Node.
@@ -391,7 +392,7 @@ namespace util{
* given.
* @param value - the new value to assign to the element at index
*/
- void setList( const decaf::util::List<PrimitiveValueNode>& value );
+ void setList(const decaf::util::List<PrimitiveValueNode>& value);
/**
* Gets the Primitive List value of this Node.
@@ -407,7 +408,7 @@ namespace util{
* given.
* @param value - the new value to assign to the element at index
*/
- void setMap( const decaf::util::Map<std::string, PrimitiveValueNode>& value );
+ void setMap(const decaf::util::Map<std::string, PrimitiveValueNode>& value);
/**
* Gets the Primitive Map value of this Node.
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceStopper.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceStopper.cpp?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceStopper.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceStopper.cpp Thu Oct 18 18:58:02 2012
@@ -41,7 +41,7 @@ void ServiceStopper::stop(Service* servi
return;
}
- try{
+ try {
service->stop();
} catch(Exception& ex) {
this->onException(service, ex);
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceSupport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceSupport.cpp?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceSupport.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceSupport.cpp Thu Oct 18 18:58:02 2012
@@ -40,22 +40,22 @@ ServiceSupport::~ServiceSupport() {
////////////////////////////////////////////////////////////////////////////////
void ServiceSupport::dispose(Service* service) {
try {
- if(service != NULL) {
+ if (service != NULL) {
service->stop();
}
- } catch (Exception e) {
+ } catch (Exception& e) {
}
}
////////////////////////////////////////////////////////////////////////////////
void ServiceSupport::start() {
- if(started.compareAndSet(false, true)) {
+ if (started.compareAndSet(false, true)) {
bool success = false;
try {
this->doStart();
success = true;
- } catch(...) {
+ } catch (...) {
this->started.set(success);
}
@@ -63,8 +63,8 @@ void ServiceSupport::start() {
this->stopped.set(!success);
synchronized(&this->listeners) {
- std::auto_ptr< Iterator<ServiceListener*> > iter(this->listeners.iterator());
- while(iter->hasNext()) {
+ std::auto_ptr<Iterator<ServiceListener*> > iter(this->listeners.iterator());
+ while (iter->hasNext()) {
iter->next()->started(this);
}
}
@@ -73,12 +73,12 @@ void ServiceSupport::start() {
////////////////////////////////////////////////////////////////////////////////
void ServiceSupport::stop() {
- if(this->stopped.compareAndSet(false, true)) {
+ if (this->stopped.compareAndSet(false, true)) {
this->stopping.set(true);
ServiceStopper stopper;
try {
this->doStop(&stopper);
- } catch(Exception& e) {
+ } catch (Exception& e) {
stopper.onException(this, e);
}
@@ -87,8 +87,8 @@ void ServiceSupport::stop() {
this->stopping.set(false);
synchronized(&this->listeners) {
- std::auto_ptr< Iterator<ServiceListener*> > iter(this->listeners.iterator());
- while(iter->hasNext()) {
+ std::auto_ptr<Iterator<ServiceListener*> > iter(this->listeners.iterator());
+ while (iter->hasNext()) {
iter->next()->stopped(this);
}
}
@@ -114,7 +114,7 @@ bool ServiceSupport::isStopped() const {
////////////////////////////////////////////////////////////////////////////////
void ServiceSupport::addServiceListener(ServiceListener* listener) {
- if(listener != NULL) {
+ if (listener != NULL) {
synchronized(&this->listeners) {
this->listeners.add(listener);
}
@@ -123,7 +123,7 @@ void ServiceSupport::addServiceListener(
////////////////////////////////////////////////////////////////////////////////
void ServiceSupport::removeServiceListener(ServiceListener* listener) {
- if(listener != NULL) {
+ if (listener != NULL) {
synchronized(&this->listeners) {
this->listeners.remove(listener);
}
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceSupport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceSupport.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceSupport.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/ServiceSupport.h Thu Oct 18 18:58:02 2012
@@ -16,7 +16,7 @@
*/
#ifndef _ACTIVEMQ_UTIL_SERVICESUPPORT_H_
-#define SERVICESUPPORT_H_
+#define _ACTIVEMQ_UTIL_SERVICESUPPORT_H_
#include <activemq/util/Config.h>
#include <activemq/util/Service.h>
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/URISupport.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/URISupport.cpp?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/URISupport.cpp (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/URISupport.cpp Thu Oct 18 18:58:02 2012
@@ -35,157 +35,142 @@ using namespace decaf::lang;
using namespace decaf::lang::exceptions;
////////////////////////////////////////////////////////////////////////////////
-void URISupport::parseURL( const std::string& URI,
- decaf::util::Properties& properties ) {
+void URISupport::parseURL(const std::string& URI, decaf::util::Properties& properties) {
- try{
+ try {
- StringTokenizer tokenizer( URI, ":/" );
+ StringTokenizer tokenizer(URI, ":/");
std::vector<std::string> tokens;
// Require that there be three tokens at the least, these are
// transport, url, port.
- if( tokenizer.countTokens() < 3 ) {
- throw decaf::lang::exceptions::IllegalArgumentException(
- __FILE__, __LINE__,
- (string( "URISupport::parseURL - "
- "Marlformed URI: ") + URI).c_str() );
+ if (tokenizer.countTokens() < 3) {
+ throw decaf::lang::exceptions::IllegalArgumentException(__FILE__, __LINE__, (string("URISupport::parseURL - "
+ "Marlformed URI: ") + URI).c_str());
}
// First element should be the Transport Type, following that is the
// URL and any params.
- properties.setProperty( "transport.protocol", tokenizer.nextToken() );
+ properties.setProperty("transport.protocol", tokenizer.nextToken());
// Parse URL and Port as one item, optional params follow the ?
// and then each param set is delimited with & we extract first
// three chars as they are the left over ://
- properties.setProperty( "transport.uri", tokenizer.nextToken("&?").substr(3) );
+ properties.setProperty("transport.uri", tokenizer.nextToken("&?").substr(3));
// Now get all the optional parameters and store them as properties
- int count = tokenizer.toArray( tokens );
+ int count = tokenizer.toArray(tokens);
- for( int i = 0; i < count; ++i ) {
- tokenizer.reset( tokens[i], "=" );
+ for (int i = 0; i < count; ++i) {
+ tokenizer.reset(tokens[i], "=");
- if( tokenizer.countTokens() != 2 ) {
- throw decaf::lang::exceptions::IllegalArgumentException(
- __FILE__, __LINE__,
- ( string( "URISupport::parseURL - "
- "Marlformed Parameter = " ) + tokens[i] ).c_str() );
+ if (tokenizer.countTokens() != 2) {
+ throw decaf::lang::exceptions::IllegalArgumentException(__FILE__, __LINE__, (string("URISupport::parseURL - "
+ "Marlformed Parameter = ") + tokens[i]).c_str());
}
// Get them in order, passing both as nextToken calls in the
// set Property can cause reversed order.
string key = tokenizer.nextToken();
- string value = URISupport::replaceEnvValues( tokenizer.nextToken() );
+ string value = URISupport::replaceEnvValues(tokenizer.nextToken());
// Store this param as a property
- properties.setProperty( key, value );
+ properties.setProperty(key, value);
}
}
- AMQ_CATCH_RETHROW( IllegalArgumentException )
- AMQ_CATCH_EXCEPTION_CONVERT( Exception, IllegalArgumentException )
- AMQ_CATCHALL_THROW( IllegalArgumentException )
+ AMQ_CATCH_RETHROW(IllegalArgumentException)
+ AMQ_CATCH_EXCEPTION_CONVERT(Exception, IllegalArgumentException)
+ AMQ_CATCHALL_THROW(IllegalArgumentException)
}
////////////////////////////////////////////////////////////////////////////////
-Properties URISupport::parseQuery( std::string query ) {
+Properties URISupport::parseQuery(std::string query) {
try {
Properties options;
- URISupport::parseQuery( query, &options );
+ URISupport::parseQuery(query, &options);
return options;
}
- AMQ_CATCH_RETHROW( IllegalArgumentException )
- AMQ_CATCH_EXCEPTION_CONVERT( Exception, IllegalArgumentException )
- AMQ_CATCHALL_THROW( IllegalArgumentException )
+ AMQ_CATCH_RETHROW(IllegalArgumentException)
+ AMQ_CATCH_EXCEPTION_CONVERT(Exception, IllegalArgumentException)
+ AMQ_CATCHALL_THROW(IllegalArgumentException)
}
////////////////////////////////////////////////////////////////////////////////
-void URISupport::parseQuery( std::string query, Properties* properties ) {
+void URISupport::parseQuery(std::string query, Properties* properties) {
try {
- if( properties == NULL ) {
- throw IllegalArgumentException(
- __FILE__,
- __LINE__,
- "URISupport::parseQuery - Can't pass in a null properties object" );
+ if (properties == NULL) {
+ throw IllegalArgumentException(__FILE__, __LINE__, "URISupport::parseQuery - Can't pass in a null properties object");
}
// strip the initial "?"
- size_t pos = query.find_first_of( "?" );
- if( pos != std::string::npos ) {
- query = query.substr(pos+1);
+ size_t pos = query.find_first_of("?");
+ if (pos != std::string::npos) {
+ query = query.substr(pos + 1);
}
// split the query into parameters
- StringTokenizer tokenizer( query, "&" );
+ StringTokenizer tokenizer(query, "&");
std::vector<std::string> options;
- tokenizer.toArray( options );
+ tokenizer.toArray(options);
std::vector<std::string>::const_iterator iter = options.begin();
- for( ; iter != options.end(); ++iter ) {
+ for (; iter != options.end(); ++iter) {
- tokenizer.reset( *iter, "=" );
+ tokenizer.reset(*iter, "=");
std::string key = "";
std::string value = "";
- if( tokenizer.countTokens() != 2 ) {
- throw IllegalArgumentException(
- __FILE__,
- __LINE__,
- "URISupport::parseQuery - Invalid URI Option." );
+ if (tokenizer.countTokens() != 2) {
+ throw IllegalArgumentException(__FILE__, __LINE__, "URISupport::parseQuery - Invalid URI Option.");
}
// Get the Key
- if( tokenizer.hasMoreTokens() != false ) {
+ if (tokenizer.hasMoreTokens() != false) {
key = tokenizer.nextToken();
}
// Get the Value
- if( tokenizer.hasMoreTokens() != false ) {
- value = URISupport::replaceEnvValues( tokenizer.nextToken() );
+ if (tokenizer.hasMoreTokens() != false) {
+ value = URISupport::replaceEnvValues(tokenizer.nextToken());
}
// Store them.
- properties->setProperty( key, value );
+ properties->setProperty(key, value);
}
}
- AMQ_CATCH_RETHROW( IllegalArgumentException )
- AMQ_CATCH_EXCEPTION_CONVERT( Exception, IllegalArgumentException )
- AMQ_CATCHALL_THROW( IllegalArgumentException )
+ AMQ_CATCH_RETHROW(IllegalArgumentException)
+ AMQ_CATCH_EXCEPTION_CONVERT(Exception, IllegalArgumentException)
+ AMQ_CATCHALL_THROW(IllegalArgumentException)
}
////////////////////////////////////////////////////////////////////////////////
-std::string URISupport::replaceEnvValues( const std::string& value ) {
+std::string URISupport::replaceEnvValues(const std::string& value) {
try {
// If it matches the first env var indicator then we validate that it is
// surrounded by an { and } bracket. once done we remove the inner value
// and look up the env var.
- if( value.at(0) == '$' ) {
+ if (value.at(0) == '$') {
- if( value.size() > 3 && value.at(1) != '{' && value.at( value.size() - 1 ) != '}' ) {
- throw new decaf::lang::exceptions::IllegalArgumentException(
- __FILE__, __LINE__,
- "URISupport::replaceEnvValues - Invalid Env Var Syntax: %s",
- value.c_str() );
+ if (value.size() > 3 && value.at(1) != '{' && value.at(value.size() - 1) != '}') {
+ throw new decaf::lang::exceptions::IllegalArgumentException(__FILE__, __LINE__, "URISupport::replaceEnvValues - Invalid Env Var Syntax: %s",
+ value.c_str());
}
- string var = value.substr( 2, value.size() - 3 );
- var = decaf::lang::System::getenv( var );
+ string var = value.substr(2, value.size() - 3);
+ var = decaf::lang::System::getenv(var);
- if( var == "" ) {
- throw new decaf::lang::exceptions::IllegalArgumentException(
- __FILE__, __LINE__,
- "URISupport::replaceEnvValues - Env Var not set: %s",
- value.c_str() );
+ if (var == "") {
+ throw new decaf::lang::exceptions::IllegalArgumentException(__FILE__, __LINE__, "URISupport::replaceEnvValues - Env Var not set: %s",
+ value.c_str());
}
return var;
@@ -193,32 +178,31 @@ std::string URISupport::replaceEnvValues
return value;
}
- AMQ_CATCH_RETHROW( IllegalArgumentException )
- AMQ_CATCH_EXCEPTION_CONVERT( Exception, IllegalArgumentException )
- AMQ_CATCHALL_THROW( IllegalArgumentException )
+ AMQ_CATCH_RETHROW(IllegalArgumentException)
+ AMQ_CATCH_EXCEPTION_CONVERT(Exception, IllegalArgumentException)
+ AMQ_CATCHALL_THROW(IllegalArgumentException)
}
////////////////////////////////////////////////////////////////////////////////
-std::string URISupport::createQueryString( const Properties& options ) {
+std::string URISupport::createQueryString(const Properties& options) {
try {
- if( options.isEmpty() ) {
+ if (options.isEmpty()) {
ostringstream rc;
bool first = true;
- std::vector< std::pair< std::string, std::string > > values = options.toArray();
- std::vector< std::pair< std::string, std::string > >::const_iterator iter = values.begin();
+ std::vector<std::pair<std::string, std::string> > values = options.toArray();
+ std::vector<std::pair<std::string, std::string> >::const_iterator iter = values.begin();
- for( ; iter != values.end(); ++iter ) {
- if( first ) {
+ for (; iter != values.end(); ++iter) {
+ if (first) {
first = false;
} else {
rc << "&";
}
- rc << URLEncoder::encode( iter->first ) << "="
- << URLEncoder::encode( iter->second );
+ rc << URLEncoder::encode(iter->first) << "=" << URLEncoder::encode(iter->second);
}
return rc.str();
@@ -227,25 +211,25 @@ std::string URISupport::createQueryStrin
return "";
}
}
- AMQ_CATCH_RETHROW( URISyntaxException )
- AMQ_CATCH_EXCEPTION_CONVERT( Exception, URISyntaxException )
- AMQ_CATCHALL_THROW( URISyntaxException )
+ AMQ_CATCH_RETHROW(URISyntaxException)
+ AMQ_CATCH_EXCEPTION_CONVERT(Exception, URISyntaxException)
+ AMQ_CATCHALL_THROW(URISyntaxException)
}
////////////////////////////////////////////////////////////////////////////////
-bool URISupport::checkParenthesis( const std::string& str ) {
+bool URISupport::checkParenthesis(const std::string& str) {
bool result = true;
- if( str != "" ) {
+ if (str != "") {
int open = 0;
int closed = 0;
std::string::const_iterator iter = str.begin();
- for( ; iter != str.end(); ++iter ) {
- if( *iter == '(' ) {
+ for (; iter != str.end(); ++iter) {
+ if (*iter == '(') {
open++;
- } else if( *iter == ')' ){
+ } else if (*iter == ')') {
closed++;
}
}
@@ -257,70 +241,67 @@ bool URISupport::checkParenthesis( const
}
////////////////////////////////////////////////////////////////////////////////
-CompositeData URISupport::parseComposite( const URI& uri ) {
+CompositeData URISupport::parseComposite(const URI& uri) {
CompositeData result;
- result.setScheme( uri.getScheme() );
- string ssp = stripPrefix( uri.getSchemeSpecificPart(), "//" );
- parseComposite( uri, result, ssp );
- result.setFragment( uri.getFragment() );
+ result.setScheme(uri.getScheme());
+ string ssp = stripPrefix(uri.getSchemeSpecificPart(), "//");
+ parseComposite(uri, result, ssp);
+ result.setFragment(uri.getFragment());
return result;
}
////////////////////////////////////////////////////////////////////////////////
-void URISupport::parseComposite( const URI& uri, CompositeData& rc, const std::string& ssp ) {
+void URISupport::parseComposite(const URI& uri, CompositeData& rc, const std::string& ssp) {
std::string componentString;
std::string params;
- if( !checkParenthesis( ssp ) ) {
- throw URISyntaxException(
- __FILE__, __LINE__,
- "%s, Not a matching number of '(' and ')' parenthesis",
- uri.toString() );
+ if (!checkParenthesis(ssp)) {
+ throw URISyntaxException(__FILE__, __LINE__, "%s, Not a matching number of '(' and ')' parenthesis", uri.toString());
}
std::size_t p;
- std::size_t intialParen = ssp.find( "(" );
- if( intialParen == 0 ) {
- rc.setHost( ssp.substr( 0, intialParen ) );
- p = rc.getHost().find( "/" );
- if( p != string::npos ) {
- rc.setPath( rc.getHost().substr( p ) );
- rc.setHost( rc.getHost().substr( 0, p ) );
+ std::size_t intialParen = ssp.find("(");
+ if (intialParen == 0) {
+ rc.setHost(ssp.substr(0, intialParen));
+ p = rc.getHost().find("/");
+ if (p != string::npos) {
+ rc.setPath(rc.getHost().substr(p));
+ rc.setHost(rc.getHost().substr(0, p));
}
- p = ssp.rfind( ")" );
- componentString = ssp.substr( intialParen + 1, p - (intialParen + 1) );
- params = ssp.substr( p + 1 );
+ p = ssp.rfind(")");
+ componentString = ssp.substr(intialParen + 1, p - (intialParen + 1));
+ params = ssp.substr(p + 1);
} else {
componentString = ssp;
params = "";
}
- LinkedList<std::string> components = splitComponents( componentString );
- std::auto_ptr< Iterator<std::string> > iter( components.iterator() );
- while( iter->hasNext() ) {
- rc.getComponents().add( URI( iter->next() ) );
+ LinkedList<std::string> components = splitComponents(componentString);
+ std::auto_ptr<Iterator<std::string> > iter(components.iterator());
+ while (iter->hasNext()) {
+ rc.getComponents().add(URI(iter->next()));
}
- p = params.find( "?" );
- if( p != string::npos ) {
- if( p > 0 ) {
- rc.setPath( stripPrefix( params.substr( 0, p ), "/" ) );
+ p = params.find("?");
+ if (p != string::npos) {
+ if (p > 0) {
+ rc.setPath(stripPrefix(params.substr(0, p), "/"));
}
- rc.setParameters( parseQuery( params.substr( p + 1 ) ) );
+ rc.setParameters(parseQuery(params.substr(p + 1)));
} else {
- if( params.length() > 0 ) {
- rc.setPath( stripPrefix( params, "/" ) );
+ if (params.length() > 0) {
+ rc.setPath(stripPrefix(params, "/"));
}
}
}
////////////////////////////////////////////////////////////////////////////////
-LinkedList<std::string> URISupport::splitComponents( const std::string& str ) {
+LinkedList<std::string> URISupport::splitComponents(const std::string& str) {
LinkedList<std::string> components;
@@ -329,9 +310,9 @@ LinkedList<std::string> URISupport::spli
std::string::const_iterator iter = str.begin();
- for( std::size_t i = 0; iter != str.end(); ++iter, ++i ) {
+ for (std::size_t i = 0; iter != str.end(); ++iter, ++i) {
- switch( *iter ) {
+ switch (*iter) {
case '(':
depth++;
break;
@@ -339,9 +320,9 @@ LinkedList<std::string> URISupport::spli
depth--;
break;
case ',':
- if( depth == 0 ) {
- std::string s = str.substr( last, i - last );
- components.add( s );
+ if (depth == 0) {
+ std::string s = str.substr(last, i - last);
+ components.add(s);
last = i + 1;
}
break;
@@ -350,19 +331,19 @@ LinkedList<std::string> URISupport::spli
}
}
- std::string s = str.substr( last );
- if( s.length() != 0 ) {
- components.add( s );
+ std::string s = str.substr(last);
+ if (s.length() != 0) {
+ components.add(s);
}
return components;
}
////////////////////////////////////////////////////////////////////////////////
-std::string URISupport::stripPrefix( const std::string& value, const std::string& prefix ) {
+std::string URISupport::stripPrefix(const std::string& value, const std::string& prefix) {
- if( value.find( prefix ) == 0 ) {
- return value.substr( prefix.length() );
+ if (value.find(prefix) == 0) {
+ return value.substr(prefix.length());
}
return value;
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/URISupport.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/URISupport.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/URISupport.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/URISupport.h Thu Oct 18 18:58:02 2012
@@ -24,8 +24,8 @@
#include <decaf/util/LinkedList.h>
#include <decaf/lang/exceptions/IllegalArgumentException.h>
-namespace activemq{
-namespace util{
+namespace activemq {
+namespace util {
class AMQCPP_API URISupport {
public:
@@ -37,8 +37,7 @@ namespace util{
* @param properties a Properties object to set the parsed values in
* @throws IllegalArgumentException if the passed URI is invalid
*/
- static void parseURL( const std::string& URI,
- decaf::util::Properties& properties );
+ static void parseURL(const std::string& URI, decaf::util::Properties& properties);
/**
* Parses a Composite URI into a Composite Data instance, the Composite URI
@@ -50,7 +49,7 @@ namespace util{
*
* @throw URISyntaxException if the URI is not well formed.
*/
- static CompositeData parseComposite( const URI& uri );
+ static CompositeData parseComposite(const URI& uri);
/**
* Parse the Query portion of a URI String and return a Simple
@@ -64,7 +63,7 @@ namespace util{
*
* @throw IllegalArgumentException if the Query string is not well formed.
*/
- static decaf::util::Properties parseQuery( std::string query );
+ static decaf::util::Properties parseQuery(std::string query);
/**
* Parse the Query portion of a URI String and return a Simple
@@ -75,8 +74,7 @@ namespace util{
*
* @throw IllegalArgumentException if the Query string is not well formed.
*/
- static void parseQuery( std::string query,
- decaf::util::Properties* properties );
+ static void parseQuery(std::string query, decaf::util::Properties* properties);
/**
* Given a properties object create a string that can be appended to a URI
@@ -90,7 +88,7 @@ namespace util{
* @throw URISyntaxException if the string in the Properties object
* can't be encoded into a valid URI Query string.
*/
- static std::string createQueryString( const Properties& options );
+ static std::string createQueryString(const Properties& options);
private:
@@ -104,7 +102,7 @@ namespace util{
*
* @throw URISyntaxException if the URI is not well formed.
*/
- static void parseComposite( const URI& uri, CompositeData& rc, const std::string& ssp );
+ static void parseComposite(const URI& uri, CompositeData& rc, const std::string& ssp);
/**
* Splits all the Component URIs in a Composite URI into individual strings which
@@ -112,7 +110,7 @@ namespace util{
*
* @param str - the set of Composite URIs
*/
- static decaf::util::LinkedList<std::string> splitComponents( const std::string& str );
+ static decaf::util::LinkedList<std::string> splitComponents(const std::string& str);
/**
* Given a string value and a prefix value, return a new string that has the prefix
@@ -124,7 +122,7 @@ namespace util{
*
* @return the new string with prefix removed.
*/
- static std::string stripPrefix( const std::string& value, const std::string& prefix );
+ static std::string stripPrefix(const std::string& value, const std::string& prefix);
/**
* Matches all opening and closing parenthesis in a String
@@ -133,7 +131,7 @@ namespace util{
*
* @return true if all parenthesis have valid open and close values.
*/
- static bool checkParenthesis( const std::string& str );
+ static bool checkParenthesis(const std::string& str);
/**
* Accepts a string value and checks to see if that value is of the
@@ -144,7 +142,7 @@ namespace util{
* @returns the env var if value points to an env var else returns value
* @throws IllegalArgumentException if the var is not set or has bad syntax
*/
- static std::string replaceEnvValues( const std::string& value );
+ static std::string replaceEnvValues(const std::string& value);
};
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/Usage.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/Usage.cpp?rev=1399781&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/Usage.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/Usage.cpp Thu Oct 18 18:58:02 2012
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Usage.h"
+
+using namespace activemq;
+using namespace activemq::util;
+
+////////////////////////////////////////////////////////////////////////////////
+Usage::~Usage() {}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/Usage.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/Usage.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/Usage.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/Usage.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/util/Usage.h Thu Oct 18 18:58:02 2012
@@ -26,7 +26,7 @@ namespace util {
class AMQCPP_API Usage {
public:
- virtual ~Usage() {}
+ virtual ~Usage();
/**
* Waits forever for more space to be returned to this Usage Manager.
@@ -38,26 +38,26 @@ namespace util {
* when the given time span in milliseconds elapses.
* @param timeout The time to wait for more space.
*/
- virtual void waitForSpace( unsigned int timeout ) = 0;
+ virtual void waitForSpace(unsigned int timeout) = 0;
/**
* Tries to increase the usage by value amount but blocks if this object is
* currently full.
* @param value Amount of usage in bytes to add.
*/
- virtual void enqueueUsage( unsigned long long value ) = 0;
+ virtual void enqueueUsage(unsigned long long value) = 0;
/**
* Increases the usage by the value amount
* @param value Amount of usage to add.
*/
- virtual void increaseUsage( unsigned long long value ) = 0;
+ virtual void increaseUsage(unsigned long long value) = 0;
/**
* Decreases the usage by the value amount.
* @param value Amount of space to return to the pool
*/
- virtual void decreaseUsage( unsigned long long value ) = 0;
+ virtual void decreaseUsage(unsigned long long value) = 0;
/**
* Returns true if this Usage instance is full, i.e. Usage >= 100%
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/MarshalAware.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/MarshalAware.cpp?rev=1399781&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/MarshalAware.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/MarshalAware.cpp Thu Oct 18 18:58:02 2012
@@ -0,0 +1,25 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "MarshalAware.h"
+
+using namespace activemq;
+using namespace activemq::wireformat;
+
+////////////////////////////////////////////////////////////////////////////////
+MarshalAware::~MarshalAware() {}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/MarshalAware.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/MarshalAware.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/MarshalAware.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/MarshalAware.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/MarshalAware.h Thu Oct 18 18:58:02 2012
@@ -22,15 +22,15 @@
#include <decaf/io/IOException.h>
#include <activemq/util/Config.h>
-namespace activemq{
-namespace wireformat{
+namespace activemq {
+namespace wireformat {
class WireFormat;
class AMQCPP_API MarshalAware {
public:
- virtual ~MarshalAware() {}
+ virtual ~MarshalAware();
/**
* Determine if the class implementing this interface is really
@@ -52,7 +52,7 @@ namespace wireformat{
*
* @throws IOException if an I/O error occurs.
*/
- virtual void beforeMarshal( WireFormat* wireFormat ) = 0;
+ virtual void beforeMarshal(WireFormat* wireFormat) = 0;
/**
* Called after marshaling is started to cleanup the object being
@@ -63,7 +63,7 @@ namespace wireformat{
*
* @throws IOException if an I/O error occurs.
*/
- virtual void afterMarshal( WireFormat* wireFormat ) = 0;
+ virtual void afterMarshal(WireFormat* wireFormat) = 0;
/**
* Called before unmarshaling is started to prepare the object to be
@@ -74,7 +74,7 @@ namespace wireformat{
*
* @throws IOException if an I/O error occurs.
*/
- virtual void beforeUnmarshal( WireFormat* wireFormat ) = 0;
+ virtual void beforeUnmarshal(WireFormat* wireFormat) = 0;
/**
* Called after unmarshaling is started to cleanup the object being
@@ -85,7 +85,7 @@ namespace wireformat{
*
* @throws IOException if an I/O error occurs.
*/
- virtual void afterUnmarshal( WireFormat* wireFormat ) = 0;
+ virtual void afterUnmarshal(WireFormat* wireFormat) = 0;
/**
* Called to set the data to this object that will contain the objects
@@ -100,7 +100,7 @@ namespace wireformat{
*
* @throws IOException if an I/O error occurs.
*/
- virtual void setMarshaledForm( WireFormat* wireFormat, const std::vector<char>& data ) = 0;
+ virtual void setMarshaledForm(WireFormat* wireFormat, const std::vector<char>& data) = 0;
/**
* Called to get the data to this object that will contain the objects
@@ -111,7 +111,7 @@ namespace wireformat{
*
* @return buffer that holds the objects data.
*/
- virtual std::vector<unsigned char> getMarshaledForm( WireFormat* wireFormat ) = 0;
+ virtual std::vector<unsigned char> getMarshaledForm(WireFormat* wireFormat) = 0;
};
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormat.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormat.cpp?rev=1399781&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormat.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormat.cpp Thu Oct 18 18:58:02 2012
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "WireFormat.h"
+
+using namespace activemq;
+using namespace activemq::wireformat;
+
+////////////////////////////////////////////////////////////////////////////////
+WireFormat::~WireFormat() {}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormat.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormat.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormat.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormat.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormat.h Thu Oct 18 18:58:02 2012
@@ -31,21 +31,19 @@
#include <decaf/lang/exceptions/UnsupportedOperationException.h>
-namespace activemq{
-namespace wireformat{
+namespace activemq {
+namespace wireformat {
using decaf::lang::Pointer;
/**
* Provides a mechanism to marshal commands into and out of packets
* or into and out of streams, Channels and Datagrams.
- *
- * @version $Revision: 1.1 $
*/
class AMQCPP_API WireFormat {
public:
- virtual ~WireFormat() {}
+ virtual ~WireFormat();
/**
* Stream based marshaling of a Command, this method blocks until the entire
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatFactory.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatFactory.cpp?rev=1399781&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatFactory.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatFactory.cpp Thu Oct 18 18:58:02 2012
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "WireFormatFactory.h"
+
+using namespace activemq;
+using namespace activemq::wireformat;
+
+////////////////////////////////////////////////////////////////////////////////
+WireFormatFactory::~WireFormatFactory() {}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatFactory.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatFactory.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatFactory.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatFactory.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatFactory.h Thu Oct 18 18:58:02 2012
@@ -24,8 +24,8 @@
#include <decaf/lang/Pointer.h>
#include <decaf/lang/exceptions/IllegalStateException.h>
-namespace activemq{
-namespace wireformat{
+namespace activemq {
+namespace wireformat {
using decaf::lang::Pointer;
@@ -38,7 +38,7 @@ namespace wireformat{
class AMQCPP_API WireFormatFactory {
public:
- virtual ~WireFormatFactory() {}
+ virtual ~WireFormatFactory();
/**
* Creates a new WireFormat Object passing it a set of
@@ -51,7 +51,7 @@ namespace wireformat{
*
* @throws IllegalStateException if the factory has not been initialized.
*/
- virtual Pointer<WireFormat> createWireFormat( const decaf::util::Properties& properties ) = 0;
+ virtual Pointer<WireFormat> createWireFormat(const decaf::util::Properties& properties) = 0;
};
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatNegotiator.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatNegotiator.cpp?rev=1399781&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatNegotiator.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatNegotiator.cpp Thu Oct 18 18:58:02 2012
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "WireFormatNegotiator.h"
+
+using namespace activemq;
+using namespace activemq::wireformat;
+
+////////////////////////////////////////////////////////////////////////////////
+WireFormatNegotiator::~WireFormatNegotiator() {}
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatNegotiator.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatNegotiator.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatNegotiator.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatNegotiator.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/WireFormatNegotiator.h Thu Oct 18 18:58:02 2012
@@ -39,10 +39,10 @@ namespace wireformat {
* @param next
* The next Transport in the chain
*/
- WireFormatNegotiator(const Pointer<transport::Transport> next ) :
+ WireFormatNegotiator(const Pointer<transport::Transport> next) :
transport::TransportFilter(next) {}
- virtual ~WireFormatNegotiator() {}
+ virtual ~WireFormatNegotiator();
};
Added: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/DataStreamMarshaller.cpp
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/DataStreamMarshaller.cpp?rev=1399781&view=auto
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/DataStreamMarshaller.cpp (added)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/DataStreamMarshaller.cpp Thu Oct 18 18:58:02 2012
@@ -0,0 +1,27 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "DataStreamMarshaller.h"
+
+using namespace activemq;
+using namespace activemq::wireformat;
+using namespace activemq::wireformat::openwire;
+using namespace activemq::wireformat::openwire::marshal;
+
+////////////////////////////////////////////////////////////////////////////////
+DataStreamMarshaller::~DataStreamMarshaller() {}
+
Propchange: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/DataStreamMarshaller.cpp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/DataStreamMarshaller.h
URL: http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/DataStreamMarshaller.h?rev=1399781&r1=1399780&r2=1399781&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/DataStreamMarshaller.h (original)
+++ activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/wireformat/openwire/marshal/DataStreamMarshaller.h Thu Oct 18 18:58:02 2012
@@ -26,10 +26,10 @@
#include <activemq/wireformat/openwire/OpenWireFormat.h>
#include <activemq/util/Config.h>
-namespace activemq{
-namespace wireformat{
-namespace openwire{
-namespace marshal{
+namespace activemq {
+namespace wireformat {
+namespace openwire {
+namespace marshal {
/**
* Base class for all classes that marshal commands for Openwire
@@ -37,7 +37,7 @@ namespace marshal{
class AMQCPP_API DataStreamMarshaller {
public:
- virtual ~DataStreamMarshaller() {}
+ virtual ~DataStreamMarshaller();
/**
* Gets the DataStructureType that this class marshals/unmarshals
@@ -64,9 +64,9 @@ namespace marshal{
*
* @throws IOException if an error occurs.
*/
- virtual int tightMarshal1( OpenWireFormat* format,
- commands::DataStructure* command,
- utils::BooleanStream* bs ) = 0;
+ virtual int tightMarshal1(OpenWireFormat* format,
+ commands::DataStructure* command,
+ utils::BooleanStream* bs) = 0;
/**
* Tight Marhsal to the given stream
@@ -76,10 +76,10 @@ namespace marshal{
* @param bs - boolean stream to marshal to.
* @throws IOException if an error occurs.
*/
- virtual void tightMarshal2( OpenWireFormat* format,
- commands::DataStructure* command,
- decaf::io::DataOutputStream* ds,
- utils::BooleanStream* bs ) = 0;
+ virtual void tightMarshal2(OpenWireFormat* format,
+ commands::DataStructure* command,
+ decaf::io::DataOutputStream* ds,
+ utils::BooleanStream* bs) = 0;
/**
* Tight Un-marhsal to the given stream
@@ -89,10 +89,10 @@ namespace marshal{
* @param bs - boolean stream to unmarshal from.
* @throws IOException if an error occurs.
*/
- virtual void tightUnmarshal( OpenWireFormat* format,
- commands::DataStructure* command,
- decaf::io::DataInputStream* dis,
- utils::BooleanStream* bs ) = 0;
+ virtual void tightUnmarshal(OpenWireFormat* format,
+ commands::DataStructure* command,
+ decaf::io::DataInputStream* dis,
+ utils::BooleanStream* bs) = 0;
/**
* Tight Marhsal to the given stream
@@ -101,9 +101,9 @@ namespace marshal{
* @param ds - DataOutputStream to marshal to
* @throws IOException if an error occurs.
*/
- virtual void looseMarshal( OpenWireFormat* format,
- commands::DataStructure* command,
- decaf::io::DataOutputStream* ds ) = 0;
+ virtual void looseMarshal(OpenWireFormat* format,
+ commands::DataStructure* command,
+ decaf::io::DataOutputStream* ds) = 0;
/**
* Loose Un-marhsal to the given stream
@@ -112,9 +112,9 @@ namespace marshal{
* @param dis - the DataInputStream to Un-Marshal from
* @throws IOException if an error occurs.
*/
- virtual void looseUnmarshal( OpenWireFormat* format,
- commands::DataStructure* command,
- decaf::io::DataInputStream* dis ) = 0;
+ virtual void looseUnmarshal(OpenWireFormat* format,
+ commands::DataStructure* command,
+ decaf::io::DataInputStream* dis) = 0;
};