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

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

#include <Octet_String.hpp>

Inheritance diagram for agentxcpp::Octet_String:
Collaboration diagram for agentxcpp::Octet_String:

List of all members.

Public Member Functions

binary serialize () const
 Encode the object as described in RFC 2741, section 5.3.
 Octet_String (binary initial_value)
 FIXME.
 Octet_String (std::string initial_value)
 FIXME.
 Octet_String ()
 FIXME.
 Octet_String (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian=true)
 Construct the object from input stream.
void set_value (binary new_value)
 Set the current value.
binary get_value ()
 get the current value
virtual void update ()
 Update the internal state of the object.
virtual binary get ()
 Obtain the current value for the object.
- Public Member Functions inherited from agentxcpp::variable
virtual ~variable ()
 Destructor.

Private Attributes

binary value
 The string.

Detailed Description

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

Definition at line 31 of file Octet_String.hpp.


Constructor & Destructor Documentation

agentxcpp::Octet_String::Octet_String ( binary  initial_value)
inline

FIXME.

Definition at line 58 of file Octet_String.hpp.

Octet_String::Octet_String ( std::string  initial_value)

FIXME.

Definition at line 27 of file Octet_String.cpp.

References value.

agentxcpp::Octet_String::Octet_String ( )
inline

FIXME.

Definition at line 72 of file Octet_String.hpp.

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

Construct the object from input stream.

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 69 of file Octet_String.cpp.

References agentxcpp::read32(), and value.


Member Function Documentation

virtual binary agentxcpp::Octet_String::get ( )
inlinevirtual

Obtain the current value for the object.

This member function is derived by classes representing SNMP variables and shall return the current value of the object.

The default implementation throws generic_error.

Returns:
The current value of the object.
Exceptions:
generic_errorIf obtaining the current value fails. No other exception shall be thrown.

Definition at line 147 of file Octet_String.hpp.

binary agentxcpp::Octet_String::get_value ( )
inline

get the current value

Definition at line 114 of file Octet_String.hpp.

References value.

binary Octet_String::serialize ( ) const
virtual

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

Note: We always use big endian.

Implements agentxcpp::variable.

Definition at line 47 of file Octet_String.cpp.

References value, and agentxcpp::write32().

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

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

Set the current value.

Definition at line 107 of file Octet_String.hpp.

References value.

virtual void agentxcpp::Octet_String::update ( )
inlinevirtual

Update the internal state of the object.

This function calls get() to obtain a new value and writes that value to the 'value' member.

Exceptions:
generic_errorIf obtaining the new value failed.

Implements agentxcpp::variable.

Definition at line 129 of file Octet_String.hpp.

References value.


Member Data Documentation

binary agentxcpp::Octet_String::value
private

The string.

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

Definition at line 40 of file Octet_String.hpp.

Referenced by get_value(), Octet_String(), serialize(), set_value(), and update().


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