Author: tabish
Date: Sat May 31 12:35:14 2008
New Revision: 662066
URL: http://svn.apache.org/viewvc?rev=662066&view=rev
Log:
https://issues.apache.org/activemq/browse/AMQCPP-172
Removed:
activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveValueTypes.h
Modified:
activemq/activemq-cpp/trunk/src/main/Makefile.am
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessageBase.h
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/marshal/PrimitiveMapMarshaller.cpp
activemq/activemq-cpp/trunk/src/main/activemq/util/ActiveMQProperties.h
activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.h
activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveList.h
activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.cpp
activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.h
activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveValueNode.h
activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.h
activemq/activemq-cpp/trunk/src/main/decaf/util/Map.h
activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp
activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveMapTest.cpp
activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveValueNodeTest.cpp
Modified: activemq/activemq-cpp/trunk/src/main/Makefile.am
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/Makefile.am?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/Makefile.am (original)
+++ activemq/activemq-cpp/trunk/src/main/Makefile.am Sat May 31 12:35:14 2008
@@ -270,7 +270,6 @@
activemq/util/PrimitiveValueNode.h \
activemq/util/PrimitiveMap.h \
activemq/util/PrimitiveList.h \
- activemq/util/PrimitiveValueTypes.h \
activemq/util/URISupport.h \
cms/DeliveryMode.h \
cms/TemporaryQueue.h \
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp
(original)
+++
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp
Sat May 31 12:35:14 2008
@@ -136,7 +136,7 @@
bool ActiveMQMapMessage::itemExists( const std::string& name ) const {
try{
- return getMap().contains( name );
+ return getMap().containsKey( name );
}
AMQ_CATCH_RETHROW( ActiveMQException )
AMQ_CATCH_EXCEPTION_CONVERT( Exception, ActiveMQException )
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessageBase.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessageBase.h?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessageBase.h
(original)
+++
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/commands/ActiveMQMessageBase.h
Sat May 31 12:35:14 2008
@@ -268,7 +268,7 @@
* @return True if the property exists in this message.
*/
virtual bool propertyExists( const std::string& name ) const {
- return properties.contains( name );
+ return properties.containsKey( name );
}
/**
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/marshal/PrimitiveMapMarshaller.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/marshal/PrimitiveMapMarshaller.cpp?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/marshal/PrimitiveMapMarshaller.cpp
(original)
+++
activemq/activemq-cpp/trunk/src/main/activemq/connector/openwire/marshal/PrimitiveMapMarshaller.cpp
Sat May 31 12:35:14 2008
@@ -17,7 +17,6 @@
#include "PrimitiveMapMarshaller.h"
-#include <activemq/util/PrimitiveValueTypes.h>
#include <decaf/io/ByteArrayInputStream.h>
#include <decaf/io/ByteArrayOutputStream.h>
#include <decaf/io/DataInputStream.h>
@@ -135,64 +134,64 @@
try {
- if( value.getValueType() == BOOLEAN_TYPE ) {
+ if( value.getValueType() == PrimitiveValueNode::BOOLEAN_TYPE ) {
- dataOut.writeByte( BOOLEAN_TYPE );
+ dataOut.writeByte( PrimitiveValueNode::BOOLEAN_TYPE );
dataOut.writeBoolean( value.getBool() );
- } else if( value.getValueType() == BYTE_TYPE ) {
+ } else if( value.getValueType() == PrimitiveValueNode::BYTE_TYPE ) {
- dataOut.writeByte( BYTE_TYPE );
+ dataOut.writeByte( PrimitiveValueNode::BYTE_TYPE );
dataOut.writeByte( value.getByte() );
- } else if( value.getValueType() == CHAR_TYPE ) {
+ } else if( value.getValueType() == PrimitiveValueNode::CHAR_TYPE ) {
- dataOut.writeByte( CHAR_TYPE );
+ dataOut.writeByte( PrimitiveValueNode::CHAR_TYPE );
dataOut.writeChar( value.getChar() );
- } else if( value.getValueType() == SHORT_TYPE ) {
+ } else if( value.getValueType() == PrimitiveValueNode::SHORT_TYPE ) {
- dataOut.writeByte( SHORT_TYPE );
+ dataOut.writeByte( PrimitiveValueNode::SHORT_TYPE );
dataOut.writeShort( value.getShort() );
- } else if( value.getValueType() == INTEGER_TYPE ) {
+ } else if( value.getValueType() == PrimitiveValueNode::INTEGER_TYPE ) {
- dataOut.writeByte( INTEGER_TYPE );
+ dataOut.writeByte( PrimitiveValueNode::INTEGER_TYPE );
dataOut.writeInt( value.getInt() );
- } else if( value.getValueType() == LONG_TYPE ) {
+ } else if( value.getValueType() == PrimitiveValueNode::LONG_TYPE ) {
- dataOut.writeByte( LONG_TYPE );
+ dataOut.writeByte( PrimitiveValueNode::LONG_TYPE );
dataOut.writeLong( value.getLong() );
- } else if( value.getValueType() == FLOAT_TYPE ) {
+ } else if( value.getValueType() == PrimitiveValueNode::FLOAT_TYPE ) {
- dataOut.writeByte( FLOAT_TYPE );
+ dataOut.writeByte( PrimitiveValueNode::FLOAT_TYPE );
dataOut.writeFloat( value.getFloat() );
- } else if( value.getValueType() == DOUBLE_TYPE ) {
+ } else if( value.getValueType() == PrimitiveValueNode::DOUBLE_TYPE ) {
- dataOut.writeByte( DOUBLE_TYPE );
+ dataOut.writeByte( PrimitiveValueNode::DOUBLE_TYPE );
dataOut.writeDouble( value.getDouble() );
- } else if( value.getValueType() == BYTE_ARRAY_TYPE ) {
+ } else if( value.getValueType() == PrimitiveValueNode::BYTE_ARRAY_TYPE
) {
- dataOut.writeByte( BYTE_ARRAY_TYPE );
+ dataOut.writeByte( PrimitiveValueNode::BYTE_ARRAY_TYPE );
std::vector<unsigned char> data = value.getByteArray();
dataOut.writeInt( (int)data.size() );
dataOut.write( data );
- } else if( value.getValueType() == STRING_TYPE ) {
+ } else if( value.getValueType() == PrimitiveValueNode::STRING_TYPE ) {
std::string data = value.getString();
// is the string big??
if( data.size() > 8191 ) {
- dataOut.writeByte( BIG_STRING_TYPE );
+ dataOut.writeByte( PrimitiveValueNode::BIG_STRING_TYPE );
} else {
- dataOut.writeByte( STRING_TYPE );
+ dataOut.writeByte( PrimitiveValueNode::STRING_TYPE );
}
OpenwireStringSupport::writeString( dataOut, &data );
@@ -221,34 +220,34 @@
switch( type )
{
- case NULL_TYPE:
+ case PrimitiveValueNode::NULL_TYPE:
map.setString( key, "" );
break;
- case BYTE_TYPE:
+ case PrimitiveValueNode::BYTE_TYPE:
map.setByte( key, dataIn.readByte() );
break;
- case BOOLEAN_TYPE:
+ case PrimitiveValueNode::BOOLEAN_TYPE:
map.setBool( key, dataIn.readBoolean() );
break;
- case CHAR_TYPE:
+ case PrimitiveValueNode::CHAR_TYPE:
map.setChar( key, dataIn.readChar() );
break;
- case SHORT_TYPE:
+ case PrimitiveValueNode::SHORT_TYPE:
map.setShort( key, dataIn.readShort() );
break;
- case INTEGER_TYPE:
+ case PrimitiveValueNode::INTEGER_TYPE:
map.setInt( key, dataIn.readInt() );
break;
- case LONG_TYPE:
+ case PrimitiveValueNode::LONG_TYPE:
map.setLong( key, dataIn.readLong() );
break;
- case FLOAT_TYPE:
+ case PrimitiveValueNode::FLOAT_TYPE:
map.setFloat( key, dataIn.readFloat() );
break;
- case DOUBLE_TYPE:
+ case PrimitiveValueNode::DOUBLE_TYPE:
map.setDouble( key, dataIn.readDouble() );
break;
- case BYTE_ARRAY_TYPE:
+ case PrimitiveValueNode::BYTE_ARRAY_TYPE:
{
int size = dataIn.readInt();
std::vector<unsigned char> data;
@@ -257,8 +256,8 @@
map.setByteArray( key, data );
break;
}
- case STRING_TYPE:
- case BIG_STRING_TYPE:
+ case PrimitiveValueNode::STRING_TYPE:
+ case PrimitiveValueNode::BIG_STRING_TYPE:
map.setString(
key,
OpenwireStringSupport::readString( dataIn ) );
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/util/ActiveMQProperties.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/ActiveMQProperties.h?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/ActiveMQProperties.h
(original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/ActiveMQProperties.h Sat
May 31 12:35:14 2008
@@ -21,6 +21,7 @@
#include <map>
#include <string>
#include <sstream>
+#include <activemq/util/Config.h>
#include <cms/CMSProperties.h>
#include <decaf/util/Properties.h>
@@ -31,7 +32,7 @@
* Implementation of the CMSProperties interface that
* delegates to a decaf::util::Properties object.
*/
- class ActiveMQProperties : public cms::CMSProperties {
+ class AMQCPP_API ActiveMQProperties : public cms::CMSProperties {
private:
decaf::util::Properties properties;
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.h?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.h
(original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/LongSequenceGenerator.h
Sat May 31 12:35:14 2008
@@ -29,7 +29,7 @@
* are incremented each time a new value is requested. This class is
* thread safe so the ids can be requested in different threads safely.
*/
- class LongSequenceGenerator {
+ class AMQCPP_API LongSequenceGenerator {
private:
long long lastSequenceId;
Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveList.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveList.h?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveList.h
(original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveList.h Sat May
31 12:35:14 2008
@@ -23,7 +23,6 @@
#include <decaf/util/List.h>
#include <decaf/lang/exceptions/NoSuchElementException.h>
#include <stdio.h>
-#include <activemq/util/PrimitiveValueTypes.h>
#include <activemq/util/PrimitiveValueNode.h>
namespace activemq{
@@ -32,7 +31,7 @@
/**
* List of primitives.
*/
- class PrimitiveList : public decaf::util::List<PrimitiveValueNode> {
+ class AMQCPP_API PrimitiveList : public
decaf::util::List<PrimitiveValueNode> {
public:
/**
Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.cpp?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.cpp Sat May
31 12:35:14 2008
@@ -32,26 +32,21 @@
}
////////////////////////////////////////////////////////////////////////////////
-PrimitiveMap::PrimitiveMap( const PrimitiveMap& src ) {
- this->copy( src );
-}
-
-////////////////////////////////////////////////////////////////////////////////
-bool PrimitiveMap::equals( const PrimitiveMap& src ) const {
- return this->valueNodeMap.equals( src.valueNodeMap );
+PrimitiveMap::PrimitiveMap( const PrimitiveMap& src )
+ : decaf::util::Map<std::string, PrimitiveValueNode>( src ) {
}
////////////////////////////////////////////////////////////////////////////////
std::string PrimitiveMap::toString() const {
- std::vector<std::string> keys = this->valueNodeMap.getKeys();
+ std::vector<std::string> keys = this->getKeys();
ostringstream stream;
stream << "Begin Class PrimitiveMap:" << std::endl;
for( std::size_t i = 0; i < keys.size(); ++i ) {
stream << "map[" << keys[i] << "] = "
- << valueNodeMap.getValue( keys[i] ).toString() << std::endl;
+ << this->getValue( keys[i] ).toString() << std::endl;
}
stream << "End Class PrimitiveMap:" << std::endl;
@@ -60,35 +55,10 @@
}
////////////////////////////////////////////////////////////////////////////////
-void PrimitiveMap::copy( const PrimitiveMap& src ) {
- return this->valueNodeMap.copy( src.valueNodeMap );
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void PrimitiveMap::clear() {
- valueNodeMap.clear();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-bool PrimitiveMap::contains( const string& key ) const{
- return valueNodeMap.containsKey( key );
-}
-
-////////////////////////////////////////////////////////////////////////////////
-std::size_t PrimitiveMap::size() const{
- return valueNodeMap.size();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-bool PrimitiveMap::isEmpty() const{
- return valueNodeMap.isEmpty();
-}
-
-////////////////////////////////////////////////////////////////////////////////
bool PrimitiveMap::getBool( const string& key ) const
throw( NoSuchElementException ){
- PrimitiveValueNode node = valueNodeMap.getValue( key );
+ PrimitiveValueNode node = this->getValue( key );
return node.getBool();
}
@@ -98,14 +68,14 @@
PrimitiveValueNode node;
node.setBool( value );
- valueNodeMap.setValue( key, node );
+ this->setValue( key, node );
}
////////////////////////////////////////////////////////////////////////////////
unsigned char PrimitiveMap::getByte( const string& key ) const
throw( NoSuchElementException ){
- PrimitiveValueNode node = valueNodeMap.getValue( key );
+ PrimitiveValueNode node = this->getValue( key );
return node.getByte();
}
@@ -114,14 +84,14 @@
PrimitiveValueNode node;
node.setByte( value );
- valueNodeMap.setValue( key, node );
+ this->setValue( key, node );
}
////////////////////////////////////////////////////////////////////////////////
char PrimitiveMap::getChar( const string& key ) const
throw( NoSuchElementException ){
- PrimitiveValueNode node = valueNodeMap.getValue( key );
+ PrimitiveValueNode node = this->getValue( key );
return node.getChar();
}
@@ -130,14 +100,14 @@
PrimitiveValueNode node;
node.setChar( value );
- valueNodeMap.setValue( key, node );
+ this->setValue( key, node );
}
////////////////////////////////////////////////////////////////////////////////
short PrimitiveMap::getShort( const string& key ) const
throw( NoSuchElementException ){
- PrimitiveValueNode node = valueNodeMap.getValue( key );
+ PrimitiveValueNode node = this->getValue( key );
return node.getShort();
}
@@ -146,14 +116,14 @@
PrimitiveValueNode node;
node.setShort( value );
- valueNodeMap.setValue( key, node );
+ this->setValue( key, node );
}
////////////////////////////////////////////////////////////////////////////////
int PrimitiveMap::getInt( const string& key ) const
throw( NoSuchElementException ){
- PrimitiveValueNode node = valueNodeMap.getValue( key );
+ PrimitiveValueNode node = this->getValue( key );
return node.getInt();
}
@@ -162,14 +132,14 @@
PrimitiveValueNode node;
node.setInt( value );
- valueNodeMap.setValue( key, node );
+ this->setValue( key, node );
}
////////////////////////////////////////////////////////////////////////////////
long long PrimitiveMap::getLong( const string& key ) const
throw( NoSuchElementException ){
- PrimitiveValueNode node = valueNodeMap.getValue( key );
+ PrimitiveValueNode node = this->getValue( key );
return node.getLong();
}
@@ -178,14 +148,14 @@
PrimitiveValueNode node;
node.setLong( value );
- valueNodeMap.setValue( key, node );
+ this->setValue( key, node );
}
////////////////////////////////////////////////////////////////////////////////
double PrimitiveMap::getDouble( const string& key ) const
throw( NoSuchElementException ){
- PrimitiveValueNode node = valueNodeMap.getValue( key );
+ PrimitiveValueNode node = this->getValue( key );
return node.getDouble();
}
@@ -194,14 +164,14 @@
PrimitiveValueNode node;
node.setDouble( value );
- valueNodeMap.setValue( key, node );
+ this->setValue( key, node );
}
////////////////////////////////////////////////////////////////////////////////
float PrimitiveMap::getFloat( const string& key ) const
throw( NoSuchElementException ){
- PrimitiveValueNode node = valueNodeMap.getValue( key );
+ PrimitiveValueNode node = this->getValue( key );
return node.getFloat();
}
@@ -210,14 +180,14 @@
PrimitiveValueNode node;
node.setFloat( value );
- valueNodeMap.setValue( key, node );
+ this->setValue( key, node );
}
////////////////////////////////////////////////////////////////////////////////
string PrimitiveMap::getString( const string& key ) const
throw( NoSuchElementException ){
- PrimitiveValueNode node = valueNodeMap.getValue( key );
+ PrimitiveValueNode node = this->getValue( key );
return node.getString();
}
@@ -226,14 +196,14 @@
PrimitiveValueNode node;
node.setString( value );
- valueNodeMap.setValue( key, node );
+ this->setValue( key, node );
}
////////////////////////////////////////////////////////////////////////////////
std::vector<unsigned char> PrimitiveMap::getByteArray( const std::string& key
) const
throw( decaf::lang::exceptions::NoSuchElementException ) {
- PrimitiveValueNode node = valueNodeMap.getValue( key );
+ PrimitiveValueNode node = this->getValue( key );
return node.getByteArray();
}
@@ -244,27 +214,5 @@
PrimitiveValueNode node;
node.setByteArray( value );
- valueNodeMap.setValue( key, node );
-}
-
-////////////////////////////////////////////////////////////////////////////////
-void PrimitiveMap::remove( const string& key ){
- valueNodeMap.remove( key );
-}
-
-////////////////////////////////////////////////////////////////////////////////
-vector<string> PrimitiveMap::getKeys() const{
- return valueNodeMap.getKeys();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-vector<PrimitiveValueNode> PrimitiveMap::getValues() const{
- return valueNodeMap.getValues();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-PrimitiveValueNode PrimitiveMap::getValue( const std::string& key ) const
- throw ( decaf::lang::exceptions::NoSuchElementException ) {
-
- return valueNodeMap.getValue( key );
+ this->setValue( key, node );
}
Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.h?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveMap.h Sat May
31 12:35:14 2008
@@ -20,9 +20,10 @@
#include <string>
#include <vector>
+#include <activemq/util/Config.h>
+#include <decaf/util/Config.h>
#include <decaf/util/Map.h>
#include <decaf/lang/exceptions/NoSuchElementException.h>
-#include <activemq/util/PrimitiveValueTypes.h>
#include <activemq/util/PrimitiveValueNode.h>
namespace activemq{
@@ -31,14 +32,14 @@
/**
* Map of named primitives.
*/
- class PrimitiveMap {
- private:
-
- decaf::util::Map<std::string, PrimitiveValueNode> valueNodeMap;
-
+ class AMQCPP_API PrimitiveMap : public decaf::util::Map<std::string,
PrimitiveValueNode> {
public:
+ /**
+ * Default Constructor, creates an empty map.
+ */
PrimitiveMap();
+
virtual ~PrimitiveMap() {}
/**
@@ -48,13 +49,6 @@
PrimitiveMap( const PrimitiveMap& src );
/**
- * Compares this PrimitiveMap to another
- * @param source - Map to compare to
- * @return true if the maps are equeal
- */
- bool equals( const PrimitiveMap& source ) const;
-
- /**
* Converts the contents into a formatted string that can be output
* in a Log File or other debugging tool.
* @returns formatted String of all elements in the map.
@@ -62,101 +56,215 @@
std::string toString() const;
/**
- * Comparison Operator
- * @param src - Map to compare to this one.
- * @returns true if Maps are equal.
+ * Gets the Boolean value at the given key, if the key is not
+ * in the map or cannot be returned as the requested value then
+ * an exception of type NoSuchElementException is thrown.
+ *
+ * @param key - the location to return the value from.
+ * @returns the value at key in the type requested.
+ * @throw NoSuchElementException if key is not in the map or cannot
+ * be returned as the requested type.
*/
- void copy( const PrimitiveMap& src );
+ virtual bool getBool( const std::string& key ) const
+ throw( decaf::lang::exceptions::NoSuchElementException );
/**
- * Removes all keys and values from all maps.
+ * Sets the value at key to the specified type. Overwrites any data
+ * that was previously at this key or inserts a new element at key.
+ * @param key - the map key to set or insert.
+ * @param value - the new value to set at the key location.
*/
- virtual void clear();
+ virtual void setBool( const std::string& key, bool value );
/**
- * Indicates whether or this map contains a value for the
- * given key.
- * @param key The key to look up.
- * @return true if this map contains the value, otherwise false.
+ * Gets the Byte value at the given key, if the key is not
+ * in the map or cannot be returned as the requested value then
+ * an exception of type NoSuchElementException is thrown.
+ *
+ * @param key - the location to return the value from.
+ * @returns the value at key in the type requested.
+ * @throw NoSuchElementException if key is not in the map or cannot
+ * be returned as the requested type.
*/
- virtual bool contains( const std::string& key ) const;
+ virtual unsigned char getByte( const std::string& key ) const
+ throw( decaf::lang::exceptions::NoSuchElementException );
/**
- * @return The number of elements (key/value pairs) in this map.
+ * Sets the value at key to the specified type. Overwrites any data
+ * that was previously at this key or inserts a new element at key.
+ * @param key - the map key to set or insert.
+ * @param value - the new value to set at the key location.
*/
- virtual std::size_t size() const;
+ virtual void setByte( const std::string& key, unsigned char value );
/**
- * @returns if there are any entries in the map.
+ * Gets the Character value at the given key, if the key is not
+ * in the map or cannot be returned as the requested value then
+ * an exception of type NoSuchElementException is thrown.
+ *
+ * @param key - the location to return the value from.
+ * @returns the value at key in the type requested.
+ * @throw NoSuchElementException if key is not in the map or cannot
+ * be returned as the requested type.
*/
- virtual bool isEmpty() const;
-
- virtual bool getBool( const std::string& key ) const
- throw( decaf::lang::exceptions::NoSuchElementException );
- virtual void setBool( const std::string& key, bool value );
-
- virtual unsigned char getByte( const std::string& key ) const
- throw( decaf::lang::exceptions::NoSuchElementException );
- virtual void setByte( const std::string& key, unsigned char value );
-
virtual char getChar( const std::string& key ) const
throw( decaf::lang::exceptions::NoSuchElementException );
+
+ /**
+ * Sets the value at key to the specified type. Overwrites any data
+ * that was previously at this key or inserts a new element at key.
+ * @param key - the map key to set or insert.
+ * @param value - the new value to set at the key location.
+ */
virtual void setChar( const std::string& key, char value );
+ /**
+ * Gets the Short value at the given key, if the key is not
+ * in the map or cannot be returned as the requested value then
+ * an exception of type NoSuchElementException is thrown.
+ *
+ * @param key - the location to return the value from.
+ * @returns the value at key in the type requested.
+ * @throw NoSuchElementException if key is not in the map or cannot
+ * be returned as the requested type.
+ */
virtual short getShort( const std::string& key ) const
throw( decaf::lang::exceptions::NoSuchElementException );
+
+ /**
+ * Sets the value at key to the specified type. Overwrites any data
+ * that was previously at this key or inserts a new element at key.
+ * @param key - the map key to set or insert.
+ * @param value - the new value to set at the key location.
+ */
virtual void setShort( const std::string& key, short value );
+ /**
+ * Gets the Integer value at the given key, if the key is not
+ * in the map or cannot be returned as the requested value then
+ * an exception of type NoSuchElementException is thrown.
+ *
+ * @param key - the location to return the value from.
+ * @returns the value at key in the type requested.
+ * @throw NoSuchElementException if key is not in the map or cannot
+ * be returned as the requested type.
+ */
virtual int getInt( const std::string& key ) const
throw( decaf::lang::exceptions::NoSuchElementException );
+
+ /**
+ * Sets the value at key to the specified type. Overwrites any data
+ * that was previously at this key or inserts a new element at key.
+ * @param key - the map key to set or insert.
+ * @param value - the new value to set at the key location.
+ */
virtual void setInt( const std::string& key, int value );
+ /**
+ * Gets the Long value at the given key, if the key is not
+ * in the map or cannot be returned as the requested value then
+ * an exception of type NoSuchElementException is thrown.
+ *
+ * @param key - the location to return the value from.
+ * @returns the value at key in the type requested.
+ * @throw NoSuchElementException if key is not in the map or cannot
+ * be returned as the requested type.
+ */
virtual long long getLong( const std::string& key ) const
throw( decaf::lang::exceptions::NoSuchElementException );
- virtual void setLong( const std::string& key, long long value );
- virtual double getDouble( const std::string& key ) const
- throw( decaf::lang::exceptions::NoSuchElementException );
- virtual void setDouble( const std::string& key, double value );
+ /**
+ * Sets the value at key to the specified type. Overwrites any data
+ * that was previously at this key or inserts a new element at key.
+ * @param key - the map key to set or insert.
+ * @param value - the new value to set at the key location.
+ */
+ virtual void setLong( const std::string& key, long long value );
+ /**
+ * Gets the Float value at the given key, if the key is not
+ * in the map or cannot be returned as the requested value then
+ * an exception of type NoSuchElementException is thrown.
+ *
+ * @param key - the location to return the value from.
+ * @returns the value at key in the type requested.
+ * @throw NoSuchElementException if key is not in the map or cannot
+ * be returned as the requested type.
+ */
virtual float getFloat( const std::string& key ) const
throw( decaf::lang::exceptions::NoSuchElementException );
- virtual void setFloat( const std::string& key, float value );
- virtual std::string getString( const std::string& key ) const
- throw( decaf::lang::exceptions::NoSuchElementException );
- virtual void setString( const std::string& key, const std::string&
value );
+ /**
+ * Sets the value at key to the specified type. Overwrites any data
+ * that was previously at this key or inserts a new element at key.
+ * @param key - the map key to set or insert.
+ * @param value - the new value to set at the key location.
+ */
+ virtual void setFloat( const std::string& key, float value );
- virtual std::vector<unsigned char> getByteArray( const std::string&
key ) const
+ /**
+ * Gets the Double value at the given key, if the key is not
+ * in the map or cannot be returned as the requested value then
+ * an exception of type NoSuchElementException is thrown.
+ *
+ * @param key - the location to return the value from.
+ * @returns the value at key in the type requested.
+ * @throw NoSuchElementException if key is not in the map or cannot
+ * be returned as the requested type.
+ */
+ virtual double getDouble( const std::string& key ) const
throw( decaf::lang::exceptions::NoSuchElementException );
- virtual void setByteArray( const std::string& key, const
std::vector<unsigned char>& value );
/**
- * Removes the value (key/value pair) for the specified key from
- * the map.
- * @param key The search key.
+ * Sets the value at key to the specified type. Overwrites any data
+ * that was previously at this key or inserts a new element at key.
+ * @param key - the map key to set or insert.
+ * @param value - the new value to set at the key location.
*/
- virtual void remove( const std::string& key );
+ virtual void setDouble( const std::string& key, double value );
/**
- * @return the entire set of keys in this map as a std::vector.
+ * Gets the String value at the given key, if the key is not
+ * in the map or cannot be returned as the requested value then
+ * an exception of type NoSuchElementException is thrown.
+ *
+ * @param key - the location to return the value from.
+ * @returns the value at key in the type requested.
+ * @throw NoSuchElementException if key is not in the map or cannot
+ * be returned as the requested type.
*/
- virtual std::vector<std::string> getKeys() const;
+ virtual std::string getString( const std::string& key ) const
+ throw( decaf::lang::exceptions::NoSuchElementException );
/**
- * @return the entire set of values in this map as a std::vector.
+ * Sets the value at key to the specified type. Overwrites any data
+ * that was previously at this key or inserts a new element at key.
+ * @param key - the map key to set or insert.
+ * @param value - the new value to set at the key location.
*/
- virtual std::vector<PrimitiveValueNode> getValues() const;
+ virtual void setString( const std::string& key, const std::string&
value );
/**
- * Get a Value from the Map, or throws a NoSuchElementException
- * @param key - string key to lookup
- * @return the concrete Value
- * @throws NoSuchElementException
+ * Gets the Byte Array value at the given key, if the key is not
+ * in the map or cannot be returned as the requested value then
+ * an exception of type NoSuchElementException is thrown.
+ *
+ * @param key - the location to return the value from.
+ * @returns the value at key in the type requested.
+ * @throw NoSuchElementException if key is not in the map or cannot
+ * be returned as the requested type.
*/
- PrimitiveValueNode getValue( const std::string& key ) const
+ virtual std::vector<unsigned char> getByteArray( const std::string&
key ) const
throw( decaf::lang::exceptions::NoSuchElementException );
+ /**
+ * Sets the value at key to the specified type. Overwrites any data
+ * that was previously at this key or inserts a new element at key.
+ * @param key - the map key to set or insert.
+ * @param value - the new value to set at the key location.
+ */
+ virtual void setByteArray( const std::string& key, const
std::vector<unsigned char>& value );
+
};
}}
Modified:
activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveValueNode.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveValueNode.h?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveValueNode.h
(original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/PrimitiveValueNode.h Sat
May 31 12:35:14 2008
@@ -18,7 +18,7 @@
#ifndef _ACTIVEMQ_UTIL_PRIMITIVEVALUENODE_H_
#define _ACTIVEMQ_UTIL_PRIMITIVEVALUENODE_H_
-#include <activemq/util/PrimitiveValueTypes.h>
+#include <activemq/util/Config.h>
#include <decaf/lang/exceptions/NoSuchElementException.h>
namespace activemq{
@@ -36,10 +36,30 @@
* we'll never extend this class, not having a virtual
* destructor isn't a concern.
*/
- class PrimitiveValueNode {
+ class AMQCPP_API PrimitiveValueNode {
public:
/**
+ * Enumeration for the various primitive types.
+ */
+ enum PrimitiveValueTypeEnum{
+ NULL_TYPE = 0,
+ BOOLEAN_TYPE = 1,
+ BYTE_TYPE = 2,
+ CHAR_TYPE = 3,
+ SHORT_TYPE = 4,
+ INTEGER_TYPE = 5,
+ LONG_TYPE = 6,
+ DOUBLE_TYPE = 7,
+ FLOAT_TYPE = 8,
+ STRING_TYPE = 9,
+ BYTE_ARRAY_TYPE = 10,
+ MAP_TYPE = 11,
+ LIST_TYPE = 12,
+ BIG_STRING_TYPE = 13
+ };
+
+ /**
* Define a union type comprised of the various types.
*/
union PrimitiveValue {
Modified: activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.h?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.h (original)
+++ activemq/activemq-cpp/trunk/src/main/activemq/util/URISupport.h Sat May 31
12:35:14 2008
@@ -18,13 +18,14 @@
#ifndef _ACTIVEMQ_UTIL_URISUPPORT_H_
#define _ACTIVEMQ_UTIL_URISUPPORT_H_
+#include <activemq/util/Config.h>
#include <decaf/util/Properties.h>
#include <decaf/lang/exceptions/IllegalArgumentException.h>
namespace activemq{
namespace util{
- class URISupport {
+ class AMQCPP_API URISupport {
public:
virtual ~URISupport();
Modified: activemq/activemq-cpp/trunk/src/main/decaf/util/Map.h
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/main/decaf/util/Map.h?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/main/decaf/util/Map.h (original)
+++ activemq/activemq-cpp/trunk/src/main/decaf/util/Map.h Sat May 31 12:35:14
2008
@@ -32,8 +32,7 @@
* a more user-friendly interface and to provide common
* functions that do not exist in std::map.
*/
- template <typename K, typename V> class Map : public
concurrent::Synchronizable
- {
+ template <typename K, typename V> class Map : public
concurrent::Synchronizable {
private:
std::map<K,V> valueMap;
Modified:
activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveListTest.cpp
Sat May 31 12:35:14 2008
@@ -154,16 +154,16 @@
plist.getInt( plist.size() ),
decaf::lang::exceptions::IndexOutOfBoundsException );
- CPPUNIT_ASSERT( plist.get(0).getValueType() == BOOLEAN_TYPE );
- CPPUNIT_ASSERT( plist.get(1).getValueType() == BYTE_TYPE );
- CPPUNIT_ASSERT( plist.get(2).getValueType() == CHAR_TYPE );
- CPPUNIT_ASSERT( plist.get(3).getValueType() == SHORT_TYPE );
- CPPUNIT_ASSERT( plist.get(4).getValueType() == INTEGER_TYPE );
- CPPUNIT_ASSERT( plist.get(5).getValueType() == LONG_TYPE );
- CPPUNIT_ASSERT( plist.get(6).getValueType() == FLOAT_TYPE );
- CPPUNIT_ASSERT( plist.get(7).getValueType() == DOUBLE_TYPE );
- CPPUNIT_ASSERT( plist.get(8).getValueType() == STRING_TYPE );
- CPPUNIT_ASSERT( plist.get(9).getValueType() == BYTE_ARRAY_TYPE );
+ CPPUNIT_ASSERT( plist.get(0).getValueType() ==
PrimitiveValueNode::BOOLEAN_TYPE );
+ CPPUNIT_ASSERT( plist.get(1).getValueType() ==
PrimitiveValueNode::BYTE_TYPE );
+ CPPUNIT_ASSERT( plist.get(2).getValueType() ==
PrimitiveValueNode::CHAR_TYPE );
+ CPPUNIT_ASSERT( plist.get(3).getValueType() ==
PrimitiveValueNode::SHORT_TYPE );
+ CPPUNIT_ASSERT( plist.get(4).getValueType() ==
PrimitiveValueNode::INTEGER_TYPE );
+ CPPUNIT_ASSERT( plist.get(5).getValueType() ==
PrimitiveValueNode::LONG_TYPE );
+ CPPUNIT_ASSERT( plist.get(6).getValueType() ==
PrimitiveValueNode::FLOAT_TYPE );
+ CPPUNIT_ASSERT( plist.get(7).getValueType() ==
PrimitiveValueNode::DOUBLE_TYPE );
+ CPPUNIT_ASSERT( plist.get(8).getValueType() ==
PrimitiveValueNode::STRING_TYPE );
+ CPPUNIT_ASSERT( plist.get(9).getValueType() ==
PrimitiveValueNode::BYTE_ARRAY_TYPE );
}
void PrimitiveListTest::testRemove(){
Modified:
activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveMapTest.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveMapTest.cpp?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
--- activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveMapTest.cpp
(original)
+++ activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveMapTest.cpp Sat
May 31 12:35:14 2008
@@ -27,42 +27,42 @@
PrimitiveValueNode node;
node.setBool( true );
- CPPUNIT_ASSERT( node.getValueType() == BOOLEAN_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::BOOLEAN_TYPE );
CPPUNIT_ASSERT( node.getBool() == true );
node.setBool( false );
- CPPUNIT_ASSERT( node.getValueType() == BOOLEAN_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::BOOLEAN_TYPE );
CPPUNIT_ASSERT( node.getBool() == false );
node.setByte( 5 );
- CPPUNIT_ASSERT( node.getValueType() == BYTE_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::BYTE_TYPE );
CPPUNIT_ASSERT( node.getByte() == 5 );
node.setChar( 'a' );
- CPPUNIT_ASSERT( node.getValueType() == CHAR_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::CHAR_TYPE );
CPPUNIT_ASSERT( node.getChar() == 'a' );
node.setShort( 10 );
- CPPUNIT_ASSERT( node.getValueType() == SHORT_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::SHORT_TYPE );
CPPUNIT_ASSERT( node.getShort() == 10 );
node.setInt( 10000 );
- CPPUNIT_ASSERT( node.getValueType() == INTEGER_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::INTEGER_TYPE );
CPPUNIT_ASSERT( node.getInt() == 10000 );
node.setLong( 100000L );
- CPPUNIT_ASSERT( node.getValueType() == LONG_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::LONG_TYPE );
CPPUNIT_ASSERT( node.getLong() == 100000L );
node.setDouble( 2.3 );
- CPPUNIT_ASSERT( node.getValueType() == DOUBLE_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::DOUBLE_TYPE );
CPPUNIT_ASSERT( node.getDouble() == 2.3 );
node.setFloat( 3.2f );
- CPPUNIT_ASSERT( node.getValueType() == FLOAT_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::FLOAT_TYPE );
CPPUNIT_ASSERT( node.getFloat() == 3.2f );
node.setString( "hello" );
- CPPUNIT_ASSERT( node.getValueType() == STRING_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::STRING_TYPE );
CPPUNIT_ASSERT( node.getString() == "hello" );
std::vector<unsigned char> byteArray;
@@ -72,7 +72,7 @@
byteArray.push_back( 'd' );
node.setByteArray( byteArray );
- CPPUNIT_ASSERT( node.getValueType() == BYTE_ARRAY_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::BYTE_ARRAY_TYPE
);
CPPUNIT_ASSERT( node.getByteArray() == byteArray );
try{
@@ -82,7 +82,7 @@
}
node.clear();
- CPPUNIT_ASSERT( node.getValueType() == NULL_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::NULL_TYPE );
}
void PrimitiveMapTest::testSetGet(){
@@ -243,19 +243,19 @@
PrimitiveMap pmap;
- CPPUNIT_ASSERT( pmap.contains("int") == false );
+ CPPUNIT_ASSERT( pmap.containsKey("int") == false );
pmap.setInt("int", 5 );
- CPPUNIT_ASSERT( pmap.contains("int") == true );
+ CPPUNIT_ASSERT( pmap.containsKey("int") == true );
pmap.setFloat( "float", 5.5f );
- CPPUNIT_ASSERT( pmap.contains("float") == true );
+ CPPUNIT_ASSERT( pmap.containsKey("float") == true );
pmap.setInt("int2", 6 );
- CPPUNIT_ASSERT( pmap.contains("int2") == true );
+ CPPUNIT_ASSERT( pmap.containsKey("int2") == true );
pmap.remove("int");
- CPPUNIT_ASSERT( pmap.contains("int") == false );
+ CPPUNIT_ASSERT( pmap.containsKey("int") == false );
}
void PrimitiveMapTest::testGetKeys(){
Modified:
activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveValueNodeTest.cpp
URL:
http://svn.apache.org/viewvc/activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveValueNodeTest.cpp?rev=662066&r1=662065&r2=662066&view=diff
==============================================================================
---
activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveValueNodeTest.cpp
(original)
+++
activemq/activemq-cpp/trunk/src/test/activemq/util/PrimitiveValueNodeTest.cpp
Sat May 31 12:35:14 2008
@@ -27,42 +27,42 @@
PrimitiveValueNode node;
node.setBool( true );
- CPPUNIT_ASSERT( node.getValueType() == BOOLEAN_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::BOOLEAN_TYPE );
CPPUNIT_ASSERT( node.getBool() == true );
node.setBool( false );
- CPPUNIT_ASSERT( node.getValueType() == BOOLEAN_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::BOOLEAN_TYPE );
CPPUNIT_ASSERT( node.getBool() == false );
node.setByte( 5 );
- CPPUNIT_ASSERT( node.getValueType() == BYTE_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::BYTE_TYPE );
CPPUNIT_ASSERT( node.getByte() == 5 );
node.setChar( 'a' );
- CPPUNIT_ASSERT( node.getValueType() == CHAR_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::CHAR_TYPE );
CPPUNIT_ASSERT( node.getChar() == 'a' );
node.setShort( 10 );
- CPPUNIT_ASSERT( node.getValueType() == SHORT_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::SHORT_TYPE );
CPPUNIT_ASSERT( node.getShort() == 10 );
node.setInt( 10000 );
- CPPUNIT_ASSERT( node.getValueType() == INTEGER_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::INTEGER_TYPE );
CPPUNIT_ASSERT( node.getInt() == 10000 );
node.setLong( 100000L );
- CPPUNIT_ASSERT( node.getValueType() == LONG_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::LONG_TYPE );
CPPUNIT_ASSERT( node.getLong() == 100000L );
node.setDouble( 2.3 );
- CPPUNIT_ASSERT( node.getValueType() == DOUBLE_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::DOUBLE_TYPE );
CPPUNIT_ASSERT( node.getDouble() == 2.3 );
node.setFloat( 3.2f );
- CPPUNIT_ASSERT( node.getValueType() == FLOAT_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::FLOAT_TYPE );
CPPUNIT_ASSERT( node.getFloat() == 3.2f );
node.setString( "hello" );
- CPPUNIT_ASSERT( node.getValueType() == STRING_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::STRING_TYPE );
CPPUNIT_ASSERT( node.getString() == "hello" );
std::vector<unsigned char> byteArray;
@@ -72,7 +72,7 @@
byteArray.push_back( 'd' );
node.setByteArray( byteArray );
- CPPUNIT_ASSERT( node.getValueType() == BYTE_ARRAY_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::BYTE_ARRAY_TYPE
);
CPPUNIT_ASSERT( node.getByteArray() == byteArray );
try{
@@ -82,7 +82,7 @@
}
node.clear();
- CPPUNIT_ASSERT( node.getValueType() == NULL_TYPE );
+ CPPUNIT_ASSERT( node.getValueType() == PrimitiveValueNode::NULL_TYPE );
}
void PrimitiveValueNodeTest::testValueNodeCtors(){
@@ -99,22 +99,22 @@
PrimitiveValueNode bArrayValue = std::vector<unsigned char>();
CPPUNIT_ASSERT( tfvalue.getBool() == true );
- CPPUNIT_ASSERT( tfvalue.getValueType() == BOOLEAN_TYPE );
+ CPPUNIT_ASSERT( tfvalue.getValueType() == PrimitiveValueNode::BOOLEAN_TYPE
);
CPPUNIT_ASSERT( bvalue.getByte() == 60 );
- CPPUNIT_ASSERT( bvalue.getValueType() == BYTE_TYPE );
+ CPPUNIT_ASSERT( bvalue.getValueType() == PrimitiveValueNode::BYTE_TYPE );
CPPUNIT_ASSERT( cvalue.getChar() == (char)60 );
- CPPUNIT_ASSERT( cvalue.getValueType() == CHAR_TYPE );
+ CPPUNIT_ASSERT( cvalue.getValueType() == PrimitiveValueNode::CHAR_TYPE );
CPPUNIT_ASSERT( svalue.getShort() == 32767 );
- CPPUNIT_ASSERT( svalue.getValueType() == SHORT_TYPE );
+ CPPUNIT_ASSERT( svalue.getValueType() == PrimitiveValueNode::SHORT_TYPE );
CPPUNIT_ASSERT( ivalue.getInt() == 4096 );
- CPPUNIT_ASSERT( ivalue.getValueType() == INTEGER_TYPE );
+ CPPUNIT_ASSERT( ivalue.getValueType() == PrimitiveValueNode::INTEGER_TYPE
);
CPPUNIT_ASSERT( lvalue.getLong() == 555666777888LL );
- CPPUNIT_ASSERT( lvalue.getValueType() == LONG_TYPE );
+ CPPUNIT_ASSERT( lvalue.getValueType() == PrimitiveValueNode::LONG_TYPE );
CPPUNIT_ASSERT( fvalue.getFloat() == 0.125f );
- CPPUNIT_ASSERT( fvalue.getValueType() == FLOAT_TYPE );
+ CPPUNIT_ASSERT( fvalue.getValueType() == PrimitiveValueNode::FLOAT_TYPE );
CPPUNIT_ASSERT( dvalue.getDouble() == 10.056 );
- CPPUNIT_ASSERT( dvalue.getValueType() == DOUBLE_TYPE );
+ CPPUNIT_ASSERT( dvalue.getValueType() == PrimitiveValueNode::DOUBLE_TYPE );
CPPUNIT_ASSERT( strValue.getString() == "TEST" );
- CPPUNIT_ASSERT( strValue.getValueType() == STRING_TYPE );
- CPPUNIT_ASSERT( bArrayValue.getValueType() == BYTE_ARRAY_TYPE );
+ CPPUNIT_ASSERT( strValue.getValueType() == PrimitiveValueNode::STRING_TYPE
);
+ CPPUNIT_ASSERT( bArrayValue.getValueType() ==
PrimitiveValueNode::BYTE_ARRAY_TYPE );
}