HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions | Protected Member Functions
rwsf::MessageInfo Class Reference

Provides basic accessors for storing and retrieving generic types associated with a message. More...

#include <rwsf/handlers/MessageInfo.h>

Inheritance diagram for rwsf::MessageInfo:
rwsf::HandleBase rwsf::AgentContext

Public Member Functions

 MessageInfo ()
 
 MessageInfo (const rwsf::MessageInfo &second)
 
virtual void clear ()
 
void clear (const std::string &name)
 
bool contains (const std::string &name) const
 
template<typename T >
const T & get (const std::string &name) const
 
rwsf::Attribute getAttribute (const std::string &name) const
 
MessageInfooperator= (const rwsf::MessageInfo &second)
 
template<typename T >
void set (const std::string &name, const T &value)
 
void setAttribute (const std::string &name, const rwsf::Attribute &attr)
 
template<typename T >
T & value (const std::string &name)
 
- Public Member Functions inherited from rwsf::HandleBase
bool isValid (void) const
 
bool operator!= (const HandleBase &second) const
 
bool operator== (const HandleBase &second) const
 

Protected Member Functions

const MessageInfoImp & body () const
 
MessageInfoImp & body ()
 
- Protected Member Functions inherited from rwsf::HandleBase
 HandleBase (void)
 
 HandleBase (StaticCtor)
 
 HandleBase (BodyBase *body)
 
 HandleBase (const HandleBase &second)
 
virtual ~HandleBase (void)
 
BodyBase & body (void) const
 
HandleBaseoperator= (const HandleBase &second)
 

Detailed Description

rwsf::MessageInfo is a generic data container that is used for communicating state information about a request throughout the Agent. For more information see the chapter on connectors and the chapter on runtime handlers in the User Guide.

Constructor & Destructor Documentation

rwsf::MessageInfo::MessageInfo ( )

Constructs a new rwsf::MessageInfo object.

rwsf::MessageInfo::MessageInfo ( const rwsf::MessageInfo second)

Copy constructor.

Member Function Documentation

const MessageInfoImp& rwsf::MessageInfo::body ( ) const
protected

Returns the implementation for this rwsf::MessageInfo object. This is a const reference to the implementation object.

MessageInfoImp& rwsf::MessageInfo::body ( )
protected

Returns the implementation for this rwsf::MessageInfo object. This is a mutable reference to the implementation object.

virtual void rwsf::MessageInfo::clear ( )
virtual

Removes all parts in this rwsf::MessageInfo instance.

void rwsf::MessageInfo::clear ( const std::string &  name)

Removes an item name from the map, if it exists.

bool rwsf::MessageInfo::contains ( const std::string &  name) const

Determines if this item contains the specified item of type T with the given name. Returns true if this object contains the specified item of type T, otherwise returns false.

template<typename T >
const T& rwsf::MessageInfo::get ( const std::string &  name) const

Retrieves the item of type T stored with given name name. Type T must be of a convertible type of the original type T used to store the item.

Exceptions
MessageInfoKeyNotFoundExceptionif the item of type T cannot be converted to type T.
rwsf::Attribute rwsf::MessageInfo::getAttribute ( const std::string &  name) const

Retrieves the rwsf::Attribute associated with the given name. If the rwsf::Attribute is not found, the isValid() method of the returned rwsf::Attribute returns false.

MessageInfo& rwsf::MessageInfo::operator= ( const rwsf::MessageInfo second)

Assignment operator.

template<typename T >
void rwsf::MessageInfo::set ( const std::string &  name,
const T &  value 
)

Sets the item of type T associated with the given name to the given value.

void rwsf::MessageInfo::setAttribute ( const std::string &  name,
const rwsf::Attribute attr 
)

Sets the rwsf::Attribute associated with the given name to the given parameter, attr.

template<typename T >
T& rwsf::MessageInfo::value ( const std::string &  name)

Returns a reference to the item associated with the given name. If an item does not exist a new one is created using the default constructor of the type T, inserted into rwsf::MessageInfo and returned.

Copyright © 2020 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.