Represents an Opaque obejct as descibed in RFC 2741, section 5.4. More...
#include <Opaque.hpp>
Public Member Functions | |
| data_t | serialize () const |
| Encode the object as described in RFC 2741, section 5.4 / 5.3. | |
| Opaque (data_t::const_iterator &pos, const data_t::const_iterator &end, bool big_endian=true) | |
| Construct the object from input stream. | |
| Opaque (data_t initial_value) | |
| Constructor for initializing with data. | |
| virtual void | update () |
| Update the internal state of the object. | |
| virtual data_t | get () |
| Obtain the current value for the object. | |
Private Attributes | |
| data_t | value |
| The string. | |
Represents an Opaque obejct as descibed in RFC 2741, section 5.4.
Definition at line 32 of file Opaque.hpp.
| Opaque::Opaque | ( | data_t::const_iterator & | pos, |
| const data_t::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.
| pos | Iterator pointing to the current stream position. The iterator is advanced while reading the header. |
| end | Iterator pointing one element past the end of the current stream. This is needed to mark the end of the buffer. |
| big_endian | Whether the input stream is in big endian format |
Definition at line 49 of file Opaque.cpp.
References value.
| agentxcpp::Opaque::Opaque | ( | data_t | initial_value | ) | [inline] |
Constructor for initializing with data.
Definition at line 87 of file Opaque.hpp.
| virtual data_t agentxcpp::Opaque::get | ( | ) | [inline, virtual] |
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.
| generic_error | If obtaining the current value fails. No other exception shall be thrown. |
Definition at line 117 of file Opaque.hpp.
| data_t Opaque::serialize | ( | ) | const [virtual] |
Encode the object as described in RFC 2741, section 5.4 / 5.3.
Note: We always use big endian.
Implements agentxcpp::variable.
Definition at line 24 of file Opaque.cpp.
References value.
| virtual void agentxcpp::Opaque::update | ( | ) | [inline, virtual] |
Update the internal state of the object.
This function calls get() to obtain a new value and writes that value to the 'value' member.
| generic_error | If obtaining the new value failed. |
Implements agentxcpp::variable.
Definition at line 99 of file Opaque.hpp.
References value.
data_t agentxcpp::Opaque::value [private] |
The string.
According to RFC 2578, Opaque is used to wrap any ASN.1-type.
Definition at line 40 of file Opaque.hpp.
Referenced by Opaque(), serialize(), and update().