Author: tabish Date: Tue Jan 30 06:32:38 2007 New Revision: 501402 URL: http://svn.apache.org/viewvc?view=rev&rev=501402 Log: http://issues.apache.org/activemq/browse/AMQCPP-30
Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MapMessage.h Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp?view=diff&rev=501402&r1=501401&r2=501402 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.cpp Tue Jan 30 06:32:38 2007 @@ -85,6 +85,261 @@ return *map; } + AMQ_CATCH_RETHROW( exceptions::NullPointerException ) + AMQ_CATCHALL_THROW( exceptions::NullPointerException ) +} + +//////////////////////////////////////////////////////////////////////////////// +const util::PrimitiveMap& ActiveMQMapMessage::getMap() const + throw ( exceptions::NullPointerException ) { + + try{ + this->getMap(); + } + AMQ_CATCH_RETHROW( exceptions::NullPointerException ) + AMQ_CATCHALL_THROW( exceptions::NullPointerException ) +} + +//////////////////////////////////////////////////////////////////////////////// +std::vector<std::string> ActiveMQMapMessage::getMapNames(void) const { + + try{ + getMap().getKeys(); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +bool ActiveMQMapMessage::itemExists( const std::string& name ) const { + + try{ + getMap().contains( name ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +bool ActiveMQMapMessage::getBoolean( const std::string& name ) const + throw( cms::CMSException ) { + + try{ + getMap().getBool( name ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQMapMessage::setBoolean( const std::string& name, bool value ) + throw( cms::CMSException ) { + + try{ + getMap().setBool( name, value ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +unsigned char ActiveMQMapMessage::getByte( const std::string& name ) const + throw( cms::CMSException ) { + + try{ + getMap().getByte( name ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQMapMessage::setByte( const std::string& name, + unsigned char value ) + throw( cms::CMSException ) { + + try{ + getMap().setByte( name, value ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +const unsigned char* ActiveMQMapMessage::getBytes( const std::string& name ) const + throw( cms::CMSException ) { + + try{ + getMap().getByteArray( name ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQMapMessage::setBytes( const std::string& name, + const std::vector<unsigned char>& value ) + throw( cms::CMSException ) { + + try{ + getMap().setByteArray( name, value ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +char ActiveMQMapMessage::getChar( const std::string& name ) const + throw( cms::CMSException ) { + + try{ + getMap().getChar( name ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQMapMessage::setChar( const std::string& name, char value ) + throw( cms::CMSException ) { + + try{ + getMap().setChar( name, value ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +double ActiveMQMapMessage::getDouble( const std::string& name ) const + throw( cms::CMSException ) { + + try{ + getMap().getDouble( name ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQMapMessage::setDouble( const std::string& name, + double value ) + throw( cms::CMSException ) { + + try{ + getMap().setDouble( name, value ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +float ActiveMQMapMessage::getFloat( const std::string& name ) const + throw( cms::CMSException ) { + + try{ + getMap().getFloat( name ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQMapMessage::setFloat( const std::string& name, float value ) + throw( cms::CMSException ) { + + try{ + getMap().setFloat( name, value ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +int ActiveMQMapMessage::getInt( const std::string& name ) const + throw( cms::CMSException ) { + + try{ + getMap().getInt( name ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQMapMessage::setInt( const std::string& name, int value ) + throw( cms::CMSException ) { + + try{ + getMap().setInt( name, value ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +long long ActiveMQMapMessage::getLong( const std::string& name ) const + throw( cms::CMSException ) { + + try{ + getMap().getLong( name ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQMapMessage::setLong( const std::string& name, long long value ) + throw( cms::CMSException ) { + + try{ + getMap().setLong( name, value ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +short ActiveMQMapMessage::getShort( const std::string& name ) const + throw( cms::CMSException ) { + + try{ + getMap().getShort( name ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQMapMessage::setShort( const std::string& name, short value ) + throw( cms::CMSException ) { + + try{ + getMap().setShort( name, value ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +std::string ActiveMQMapMessage::getString( const std::string& name ) const + throw( cms::CMSException ) { + + try{ + getMap().getString( name ); + } + AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) + AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) +} + +//////////////////////////////////////////////////////////////////////////////// +void ActiveMQMapMessage::setString( const std::string& name, + const std::string& value ) + throw( cms::CMSException ) { + + try{ + getMap().setString( name, value ); + } AMQ_CATCH_RETHROW( exceptions::ActiveMQException ) AMQ_CATCHALL_THROW( exceptions::ActiveMQException ) } Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h?view=diff&rev=501402&r1=501401&r2=501402 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/activemq/connector/openwire/commands/ActiveMQMapMessage.h Tue Jan 30 06:32:38 2007 @@ -105,7 +105,7 @@ * name of an item in the MapMessage * @throws CMSException */ - virtual std::vector< std::string > getMapNames(void) const; + virtual std::vector<std::string> getMapNames(void) const; /** * Indicates whether an item exists in this MapMessage object. @@ -119,7 +119,8 @@ * @param name of the value to fetch from the map * @throws CMSException */ - virtual bool getBoolean( const std::string& name ) const; + virtual bool getBoolean( const std::string& name ) const + throw( cms::CMSException ); /** * Sets a boolean value with the specified name into the Map. @@ -128,14 +129,15 @@ * @throws CMSException */ virtual void setBoolean( const std::string& name, - bool value ); + bool value ) throw( cms::CMSException ); /** * Returns the Byte value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual unsigned char getByte( const std::string& name ) const; + virtual unsigned char getByte( const std::string& name ) const + throw( cms::CMSException ); /** * Sets a Byte value with the specified name into the Map. @@ -144,14 +146,16 @@ * @throws CMSException */ virtual void setByte( const std::string& name, - unsigned char value ); + unsigned char value ) + throw( cms::CMSException ); /** * Returns the Bytes value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual const unsigned char* getBytes( const std::string& name ) const; + virtual const unsigned char* getBytes( const std::string& name ) const + throw( cms::CMSException ); /** * Sets a Bytes value with the specified name into the Map. @@ -160,14 +164,16 @@ * @throws CMSException */ virtual void setBytes( const std::string& name, - unsigned char* value ); + const std::vector<unsigned char>& value ) + throw( cms::CMSException ); /** * Returns the Char value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual char getChar( const std::string& name ) const; + virtual char getChar( const std::string& name ) const + throw( cms::CMSException ); /** * Sets a Char value with the specified name into the Map. @@ -175,14 +181,16 @@ * @param value - the Char value to set in the Map * @throws CMSException */ - virtual void setChar( const std::string& name, char value ); + virtual void setChar( const std::string& name, char value ) + throw( cms::CMSException ); /** * Returns the Double value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual double getDouble( const std::string& name ) const; + virtual double getDouble( const std::string& name ) const + throw( cms::CMSException ); /** * Sets a Double value with the specified name into the Map. @@ -191,14 +199,15 @@ * @throws CMSException */ virtual void setDouble( const std::string& name, - double value ); + double value ) throw( cms::CMSException ); /** * Returns the Float value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual float getFloat( const std::string& name ) const; + virtual float getFloat( const std::string& name ) const + throw( cms::CMSException ); /** * Sets a Float value with the specified name into the Map. @@ -206,14 +215,16 @@ * @param value - the Float value to set in the Map * @throws CMSException */ - virtual void setFloat( const std::string& name, float value ); + virtual void setFloat( const std::string& name, float value ) + throw( cms::CMSException ); /** * Returns the Int value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual int getInt( const std::string& name ) const; + virtual int getInt( const std::string& name ) const + throw( cms::CMSException ); /** * Sets a Int value with the specified name into the Map. @@ -221,14 +232,16 @@ * @param value - the Int value to set in the Map * @throws CMSException */ - virtual void setInt( const std::string& name, int value ); + virtual void setInt( const std::string& name, int value ) + throw( cms::CMSException ); /** * Returns the Long value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual long long getLong( const std::string& name ) const; + virtual long long getLong( const std::string& name ) const + throw( cms::CMSException ); /** * Sets a Long value with the specified name into the Map. @@ -236,14 +249,16 @@ * @param value - the Long value to set in the Map * @throws CMSException */ - virtual void setLong( const std::string& name, long long value ); + virtual void setLong( const std::string& name, long long value ) + throw( cms::CMSException ); /** * Returns the Short value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual short getShort( const std::string& name ) const; + virtual short getShort( const std::string& name ) const + throw( cms::CMSException ); /** * Sets a Short value with the specified name into the Map. @@ -251,14 +266,16 @@ * @param value - the Short value to set in the Map * @throws CMSException */ - virtual void setShort( const std::string& name, short value ); + virtual void setShort( const std::string& name, short value ) + throw( cms::CMSException ); /** * Returns the String value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual std::string getString( const std::string& name ) const; + virtual std::string getString( const std::string& name ) const + throw( cms::CMSException ); /** * Sets a String value with the specified name into the Map. @@ -267,7 +284,8 @@ * @throws CMSException */ virtual void setString( const std::string& name, - const std::string& value ); + const std::string& value ) + throw( cms::CMSException ); protected: @@ -277,11 +295,12 @@ * @returns reference to a PrimtiveMap. */ util::PrimitiveMap& getMap() throw ( exceptions::NullPointerException ); + const util::PrimitiveMap& getMap() const throw ( exceptions::NullPointerException ); private: // Map Structure to hold unmarshalled Map Data - util::PrimitiveMap* map; + mutable util::PrimitiveMap* map; }; Modified: incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MapMessage.h URL: http://svn.apache.org/viewvc/incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MapMessage.h?view=diff&rev=501402&r1=501401&r2=501402 ============================================================================== --- incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MapMessage.h (original) +++ incubator/activemq/activemq-cpp/trunk/activemq-cpp/src/main/cms/MapMessage.h Tue Jan 30 06:32:38 2007 @@ -63,7 +63,8 @@ * @param name of the value to fetch from the map * @throws CMSException */ - virtual bool getBoolean( const std::string& name ) const = 0; + virtual bool getBoolean( const std::string& name ) const + throw( CMSException ) = 0; /** * Sets a boolean value with the specified name into the Map. @@ -72,14 +73,15 @@ * @throws CMSException */ virtual void setBoolean( const std::string& name, - bool value ) = 0; + bool value ) throw( CMSException ) = 0; /** * Returns the Byte value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual unsigned char getByte( const std::string& name ) const = 0; + virtual unsigned char getByte( const std::string& name ) const + throw( CMSException ) = 0; /** * Sets a Byte value with the specified name into the Map. @@ -88,14 +90,15 @@ * @throws CMSException */ virtual void setByte( const std::string& name, - unsigned char value ) = 0; + unsigned char value ) throw( CMSException ) = 0; /** * Returns the Bytes value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual const unsigned char* getBytes( const std::string& name ) const = 0; + virtual const unsigned char* getBytes( const std::string& name ) const + throw( CMSException ) = 0; /** * Sets a Bytes value with the specified name into the Map. @@ -104,14 +107,16 @@ * @throws CMSException */ virtual void setBytes( const std::string& name, - unsigned char* value ) = 0; + const std::vector<unsigned char>& value ) + throw( CMSException ) = 0; /** * Returns the Char value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual char getChar( const std::string& name ) const = 0; + virtual char getChar( const std::string& name ) const + throw( CMSException ) = 0; /** * Sets a Char value with the specified name into the Map. @@ -119,14 +124,16 @@ * @param value - the Char value to set in the Map * @throws CMSException */ - virtual void setChar( const std::string& name, char value ) = 0; + virtual void setChar( const std::string& name, char value ) + throw( CMSException ) = 0; /** * Returns the Double value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual double getDouble( const std::string& name ) const = 0; + virtual double getDouble( const std::string& name ) const + throw( CMSException ) = 0; /** * Sets a Double value with the specified name into the Map. @@ -135,14 +142,15 @@ * @throws CMSException */ virtual void setDouble( const std::string& name, - double value ) = 0; + double value ) throw( CMSException ) = 0; /** * Returns the Float value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual float getFloat( const std::string& name ) const = 0; + virtual float getFloat( const std::string& name ) const + throw( CMSException ) = 0; /** * Sets a Float value with the specified name into the Map. @@ -150,14 +158,16 @@ * @param value - the Float value to set in the Map * @throws CMSException */ - virtual void setFloat( const std::string& name, float value ) = 0; + virtual void setFloat( const std::string& name, float value ) + throw( CMSException ) = 0; /** * Returns the Int value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual int getInt( const std::string& name ) const = 0; + virtual int getInt( const std::string& name ) const + throw( CMSException ) = 0; /** * Sets a Int value with the specified name into the Map. @@ -165,14 +175,16 @@ * @param value - the Int value to set in the Map * @throws CMSException */ - virtual void setInt( const std::string& name, int value ) = 0; + virtual void setInt( const std::string& name, int value ) + throw( CMSException ) = 0; /** * Returns the Long value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual long long getLong( const std::string& name ) const = 0; + virtual long long getLong( const std::string& name ) const + throw( CMSException ) = 0; /** * Sets a Long value with the specified name into the Map. @@ -180,14 +192,16 @@ * @param value - the Long value to set in the Map * @throws CMSException */ - virtual void setLong( const std::string& name, long long value ) = 0; + virtual void setLong( const std::string& name, long long value ) + throw( CMSException ) = 0; /** * Returns the Short value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual short getShort( const std::string& name ) const = 0; + virtual short getShort( const std::string& name ) const + throw( CMSException ) = 0; /** * Sets a Short value with the specified name into the Map. @@ -195,14 +209,16 @@ * @param value - the Short value to set in the Map * @throws CMSException */ - virtual void setShort( const std::string& name, short value ) = 0; + virtual void setShort( const std::string& name, short value ) + throw( CMSException ) = 0; /** * Returns the String value of the Specified name * @param name of the value to fetch from the map * @throws CMSException */ - virtual std::string getString( const std::string& name ) const = 0; + virtual std::string getString( const std::string& name ) const + throw( CMSException ) = 0; /** * Sets a String value with the specified name into the Map. @@ -211,7 +227,8 @@ * @throws CMSException */ virtual void setString( const std::string& name, - const std::string& value ) = 0; + const std::string& value ) + throw( CMSException ) = 0; };