AgentXcpp  Revision:0.2
Internals Documentation
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Pages
agentxcpp::IntegerValue Class Reference

Represents an Integer as described in RFC 2741. More...

#include <IntegerValue.hpp>

Inheritance diagram for agentxcpp::IntegerValue:
Collaboration diagram for agentxcpp::IntegerValue:

Public Member Functions

 IntegerValue (int32_t _value=0)
 Create an IntegerValue object.
virtual binary serialize () const
 Encode the object as described in RFC 2741, section 5.4.
 IntegerValue (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian=true)
 Parse Constructor.
- Public Member Functions inherited from agentxcpp::AbstractValue
virtual ~AbstractValue ()
 Destructor.

Public Attributes

int32_t value
 The Integer value.

Detailed Description

Represents an Integer as described in RFC 2741.

Definition at line 35 of file IntegerValue.hpp.

Constructor & Destructor Documentation

agentxcpp::IntegerValue::IntegerValue ( int32_t  _value = 0)
inline

Create an IntegerValue object.

The default value of the new object is 0.

Exceptions
None.

Definition at line 54 of file IntegerValue.hpp.

IntegerValue::IntegerValue ( binary::const_iterator &  pos,
const binary::const_iterator &  end,
bool  big_endian = true 
)

Parse Constructor.

This constructor parses the serialized form of the object. It takes an iterator, starts parsing at the position of the iterator and advances the iterator to the position right behind the object.

The constructor expects valid data from the stream; if parsing fails, parse_error is thrown. In this case, the iterator position is undefined.

Parameters
posIterator pointing to the current stream position. The iterator is advanced while reading the header.
endIterator pointing one element past the end of the current stream. This is needed to mark the end of the buffer.
big_endianWhether the input stream is in big endian format

Definition at line 36 of file IntegerValue.cpp.

References agentxcpp::read32(), and value.

Member Function Documentation

binary IntegerValue::serialize ( ) const
virtual

Encode the object as described in RFC 2741, section 5.4.

This function uses big endian.

Implements agentxcpp::AbstractValue.

Definition at line 25 of file IntegerValue.cpp.

References value, and agentxcpp::write32().

Member Data Documentation

int32_t agentxcpp::IntegerValue::value

The Integer value.

According to RFC 2578, INTEGER is a signed 32-bit number.

Definition at line 43 of file IntegerValue.hpp.

Referenced by IntegerValue(), and serialize().


The documentation for this class was generated from the following files: