# PSNMP_Trap_PDU Class Reference

`#include <snmp.h>`

Inheritance diagram for PSNMP_Trap_PDU:

List of all members.

## Public Member Functions

| PSNMP_Trap_PDU (unsigned tag=4, TagClass tagClass=ContextSpecificTagClass)
PINDEX | GetDataLength () const
PBoolean | Decode (PASN_Stream &strm)
void | Encode (PASN_Stream &strm) const
void | PrintOn (ostream &strm) const
| Output the contents of the object to the stream.
Comparison | Compare (const PObject &obj) const
| Compare the two objects and return their relative rank.
PObject * | Clone () const
| Create a copy of the class on the heap.

## Public Attributes

PASN_ObjectId | m_enterprise
PRFC1155_NetworkAddress | m_agent_addr
PASN_Integer | m_generic_trap
PASN_Integer | m_specific_trap
PRFC1155_TimeTicks | m_time_stamp
PSNMP_VarBindList | m_variable_bindings

## Constructor & Destructor Documentation

PSNMP_Trap_PDU::PSNMP_Trap_PDU | ( | unsigned | tag = `4`,
|  | TagClass | tagClass = `ContextSpecificTagClass` |
| ) |  |  |

## Member Function Documentation

PObject* PSNMP_Trap_PDU::Clone | ( |  | ) | const`[virtual]`

Create a copy of the class on the heap.

The exact semantics of the descendent class determine what is required to make a duplicate of the instance. Not all classes can even do a clone operation.

The main user of the clone function is the `PDictionary` class as it requires copies of the dictionary keys.

The default behaviour is for this function to assert.

Returns:
  pointer to new copy of the class instance.

Reimplemented from PASN_Sequence.

Comparison PSNMP_Trap_PDU::Compare | ( | const PObject & | obj | ) | const`[virtual]`

Compare the two objects and return their relative rank.

This function is usually overridden by descendent classes to yield the ranking according to the semantics of the object.

The default function is to use the `CompareObjectMemoryDirect()` function to do a byte wise memory comparison of the two objects.

Returns:
  `LessThan`, `EqualTo` or `GreaterThan` according to the relative rank of the objects.

Reimplemented from PASN_Sequence.

PBoolean PSNMP_Trap_PDU::Decode | ( | PASN_Stream & | strm | ) | `[virtual]`

Reimplemented from PASN_Sequence.

void PSNMP_Trap_PDU::Encode | ( | PASN_Stream & | strm | ) | const`[virtual]`

Reimplemented from PASN_Sequence.

PINDEX PSNMP_Trap_PDU::GetDataLength | ( |  | ) | const`[virtual]`

Reimplemented from PASN_Sequence.

void PSNMP_Trap_PDU::PrintOn | ( | ostream & | strm | ) | const`[virtual]`

Output the contents of the object to the stream.

The exact output is dependent on the exact semantics of the descendent class. This is primarily used by the standard `operator<<` function.

The default behaviour is to print the class name.

Reimplemented from PASN_Sequence.

## Member Data Documentation

PRFC1155_NetworkAddress PSNMP_Trap_PDU::m_agent_addr

PASN_ObjectId PSNMP_Trap_PDU::m_enterprise

PASN_Integer PSNMP_Trap_PDU::m_generic_trap

PASN_Integer PSNMP_Trap_PDU::m_specific_trap

PRFC1155_TimeTicks PSNMP_Trap_PDU::m_time_stamp

PSNMP_VarBindList PSNMP_Trap_PDU::m_variable_bindings

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

- snmp.h