# PSNMP_Message Class Reference

`#include <snmp.h>`

Inheritance diagram for PSNMP_Message:

List of all members.

## Public Member Functions

| PSNMP_Message (unsigned tag=UniversalSequence, TagClass tagClass=UniversalTagClass)
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_Integer | m_version
PASN_OctetString | m_community
PSNMP_PDUs | m_pdu
PASN_OctetString | m_data

## Constructor & Destructor Documentation

PSNMP_Message::PSNMP_Message | ( | unsigned | tag = `UniversalSequence`,
|  | TagClass | tagClass = `UniversalTagClass` |
| ) |  |  |

## Member Function Documentation

PObject* PSNMP_Message::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_Message::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_Message::Decode | ( | PASN_Stream & | strm | ) | `[virtual]`

Reimplemented from PASN_Sequence.

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

Reimplemented from PASN_Sequence.

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

Reimplemented from PASN_Sequence.

void PSNMP_Message::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

PASN_OctetString PSNMP_Message::m_community

PASN_OctetString PSNMP_Message::m_data

PSNMP_PDUs PSNMP_Message::m_pdu

PASN_Integer PSNMP_Message::m_version

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

- snmp.h