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

Represents an Octet String as described in RFC 2741, section 5.3. More...

#include <OctetStringValue.hpp>

Inheritance diagram for agentxcpp::OctetStringValue:
Collaboration diagram for agentxcpp::OctetStringValue:

Public Member Functions

binary serialize () const
 Encode the object as described in RFC 2741, section 5.3.
 OctetStringValue (binary initial_value)
 Construct object from binary data.
 OctetStringValue (std::string initial_value)
 Construct object from a string.
 OctetStringValue ()
 Create empty OctetStringValue object.
 OctetStringValue (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian=true)
 Parse Constructor.
void set_value (binary new_value)
 Set the current value.
void set_value (std::string new_value)
 Set the current value.
binary get_value () const
 Get the current value.
std::string str () const
 Get the current value as string.
- Public Member Functions inherited from agentxcpp::AbstractValue
virtual ~AbstractValue ()
 Destructor.

Private Attributes

binary value
 The string.

Detailed Description

Represents an Octet String as described in RFC 2741, section 5.3.

Definition at line 31 of file OctetStringValue.hpp.

Constructor & Destructor Documentation

agentxcpp::OctetStringValue::OctetStringValue ( binary  initial_value)
inline

Construct object from binary data.

Definition at line 55 of file OctetStringValue.hpp.

OctetStringValue::OctetStringValue ( std::string  initial_value)

Construct object from a string.

Definition at line 27 of file OctetStringValue.cpp.

References set_value().

agentxcpp::OctetStringValue::OctetStringValue ( )
inline

Create empty OctetStringValue object.

Definition at line 65 of file OctetStringValue.hpp.

OctetStringValue::OctetStringValue ( 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 97 of file OctetStringValue.cpp.

References agentxcpp::read32(), and value.

Member Function Documentation

binary agentxcpp::OctetStringValue::get_value ( ) const
inline

Get the current value.

Definition at line 108 of file OctetStringValue.hpp.

References value.

binary OctetStringValue::serialize ( ) const
virtual

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

Note
We always use big endian.

Implements agentxcpp::AbstractValue.

Definition at line 75 of file OctetStringValue.cpp.

References value, and agentxcpp::write32().

Referenced by agentxcpp::PDUwithContext::add_header(), agentxcpp::OpenPDU::serialize(), and agentxcpp::AddAgentCapsPDU::serialize().

void agentxcpp::OctetStringValue::set_value ( binary  new_value)
inline

Set the current value.

Definition at line 98 of file OctetStringValue.hpp.

References value.

Referenced by OctetStringValue().

void OctetStringValue::set_value ( std::string  new_value)

Set the current value.

Definition at line 33 of file OctetStringValue.cpp.

References value.

std::string OctetStringValue::str ( ) const

Get the current value as string.

Definition at line 53 of file OctetStringValue.cpp.

References value.

Member Data Documentation

binary agentxcpp::OctetStringValue::value
private

The string.

According to RFC 2578, Octet_String represents arbitrary binary or textual data.

Definition at line 40 of file OctetStringValue.hpp.

Referenced by get_value(), OctetStringValue(), serialize(), set_value(), and str().


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