This class represents a Close-PDU. More...
#include <ClosePDU.hpp>
Public Types | |
| enum | reason_t { reasonOther = 1, reasonParseError = 2, reasonProtocolError = 3, reasonTimeouts = 4, reasonShutdown = 5, reasonByManager = 6 } |
Public Member Functions | |
| ClosePDU () | |
| Default constructor. | |
| ClosePDU (uint32_t sessionID, reason_t reason) | |
| Constructor. | |
| reason_t | get_reason () |
| Get the reason. | |
| void | set_reason (reason_t reason) |
| Set the reason. | |
| ClosePDU (data_t::const_iterator &pos, const data_t::const_iterator &end, bool big_endian) | |
| Parse constructor. | |
| virtual data_t | serialize () const |
| Serialize the PDU. | |
Private Attributes | |
| reason_t | reason |
| The reason why the session is being closed. | |
This class represents a Close-PDU.
Definition at line 34 of file ClosePDU.hpp.
| reasonOther | |
| reasonParseError | |
| reasonProtocolError | |
| reasonTimeouts | |
| reasonShutdown | |
| reasonByManager |
Definition at line 38 of file ClosePDU.hpp.
Default constructor.
Sets the state of the object to the defaults as set by the PDU::PDU() constructor, plus the following:
Definition at line 25 of file ClosePDU.cpp.
| ClosePDU::ClosePDU | ( | uint32_t | sessionID, |
| reason_t | reason | ||
| ) |
Constructor.
| reason | The reason to session closure. Must be a valid reason. |
| sessionID | The session ID of the PDU |
| inval_param | If the reason value is invalid. |
Definition at line 30 of file ClosePDU.cpp.
References reason, and agentxcpp::PDU::set_sessionID().
| ClosePDU::ClosePDU | ( | data_t::const_iterator & | pos, |
| const data_t::const_iterator & | end, | ||
| bool | big_endian | ||
| ) |
Parse constructor.
Construct the object by parsing a stream. See Parsing incoming PDUs for details about PDU parsing.
| 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 serialized form of the PDU is in big_endian format. |
| parse_error | If parsing fails, for example because reading the stream fails or the PDU is malformed. |
Definition at line 47 of file ClosePDU.cpp.
References reason.
| reason_t agentxcpp::ClosePDU::get_reason | ( | ) | [inline] |
| data_t ClosePDU::serialize | ( | ) | const [virtual] |
Serialize the PDU.
Implements agentxcpp::PDU.
Definition at line 70 of file ClosePDU.cpp.
References agentxcpp::PDU::add_header(), agentxcpp::PDU::agentxClosePDU, and reason.
| void agentxcpp::ClosePDU::set_reason | ( | reason_t | reason | ) | [inline] |
reason_t agentxcpp::ClosePDU::reason [private] |
The reason why the session is being closed.
Definition at line 52 of file ClosePDU.hpp.
Referenced by ClosePDU(), get_reason(), serialize(), and set_reason().