AgentXcpp  Revision:4ac4848
Internals Documentation
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends
agentxcpp::ClosePDU Class Reference

This class represents a Close-PDU. More...

#include <ClosePDU.hpp>

Inheritance diagram for agentxcpp::ClosePDU:
[legend]
Collaboration diagram for agentxcpp::ClosePDU:
[legend]

List of all members.

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.

Detailed Description

This class represents a Close-PDU.

Definition at line 34 of file ClosePDU.hpp.


Member Enumeration Documentation

Enumerator:
reasonOther 
reasonParseError 
reasonProtocolError 
reasonTimeouts 
reasonShutdown 
reasonByManager 

Definition at line 38 of file ClosePDU.hpp.


Constructor & Destructor Documentation

Default constructor.

Sets the state of the object to the defaults as set by the PDU::PDU() constructor, plus the following:

  • reason = reasonOther

Definition at line 25 of file ClosePDU.cpp.

ClosePDU::ClosePDU ( uint32_t  sessionID,
reason_t  reason 
)

Constructor.

Parameters:
reasonThe reason to session closure. Must be a valid reason.
sessionIDThe session ID of the PDU
Exceptions:
inval_paramIf 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.

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 serialized form of the PDU is in big_endian format.
Exceptions:
parse_errorIf parsing fails, for example because reading the stream fails or the PDU is malformed.

Definition at line 47 of file ClosePDU.cpp.

References reason.


Member Function Documentation

Get the reason.

Definition at line 80 of file ClosePDU.hpp.

References reason.

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]

Set the reason.

Definition at line 87 of file ClosePDU.hpp.

References reason.


Member Data Documentation

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().


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