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 (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian) | |
| Parse constructor. | |
| virtual binary | serialize () const |
| Serialize the PDU. | |
Public Member Functions inherited from agentxcpp::PDU | |
| bool | get_new_index () |
| Get new_index flag. | |
| void | set_new_index (bool new_index) |
| Set new_index flag. | |
| bool | get_any_index () |
| Get any_index flag. | |
| void | set_any_index (bool any_index) |
| Set any_index flag. | |
| uint32_t | get_sessionID () |
| Get sessionID. | |
| void | set_sessionID (uint32_t id) |
| Set sessionID. | |
| uint32_t | get_transactionID () |
| Get transactionID. | |
| void | set_transactionID (uint32_t id) |
| Set transactionID. | |
| uint32_t | get_packetID () |
| Get packetID. | |
| void | set_packetID (uint32_t packetID) |
| Set packetID. | |
Private Attributes | |
| reason_t | reason |
| The reason why the session is being closed. | |
Additional Inherited Members | |
Static Public Member Functions inherited from agentxcpp::PDU | |
| static shared_ptr< PDU > | parse_pdu (binary buf) |
| Parse a PDU from a buffer. | |
Protected Types inherited from agentxcpp::PDU | |
| enum | type_t { agentxOpenPDU = 1, agentxClosePDU = 2, agentxRegisterPDU = 3, agentxUnregisterPDU = 4, agentxGetPDU = 5, agentxGetNextPDU = 6, agentxGetBulkPDU = 7, agentxTestSetPDU = 8, agentxCommitSetPDU = 9, agentxUndoSetPDU = 10, agentxCleanupSetPDU = 11, agentxNotifyPDU = 12, agentxPingPDU = 13, agentxIndexAllocatePDU = 14, agentxIndexDeallocatePDU = 15, agentxAddAgentCapsPDU = 16, agentxRemoveAgentCapsPDU = 17, agentxResponsePDU = 18 } |
| The PDU types. More... | |
Protected Member Functions inherited from agentxcpp::PDU | |
| PDU (binary::const_iterator &pos, const binary::const_iterator &end, bool big_endian) | |
| Parse constructor. | |
| void | add_header (type_t type, binary &payload) const |
| Construct the PDU header and add it to the payload. | |
| PDU () | |
| Default constructor. | |
| virtual | ~PDU () |
| Destructor. | |
Protected Attributes inherited from agentxcpp::PDU | |
| bool | instance_registration |
| the instance_registration flag | |
| bool | non_default_context |
| Whether the PDU has a non-default context. | |
| uint32_t | packetID |
| h.packetID field according to RFC 2741, 6.1. "AgentX PDU
Header". | |
This class represents a Close-PDU.
Definition at line 37 of file ClosePDU.hpp.
| reasonOther | |
| reasonParseError | |
| reasonProtocolError | |
| reasonTimeouts | |
| reasonShutdown | |
| reasonByManager |
Definition at line 41 of file ClosePDU.hpp.
| ClosePDU::ClosePDU | ( | ) |
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 | ( | binary::const_iterator & | pos, |
| const binary::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.
|
inline |
|
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.
|
inline |
|
private |
The reason why the session is being closed.
Definition at line 55 of file ClosePDU.hpp.
Referenced by ClosePDU(), get_reason(), serialize(), and set_reason().