Logo Search packages:      
Sourcecode: pwlib version File versions

PASNObject Class Reference

#include <pasn.h>

Inheritance diagram for PASNObject:

PObject PASNInteger PASNNull PASNObjectID PASNSequence PASNString PASNUnsignedInteger PASNIPAddress PASNCounter PASNGauge PASNTimeTicks

List of all members.

Detailed Description

This class defines the common behviour of all ASN objects. It also contains several functions which are used for encoding common ASN primitives.

This class will never be instantiated directly. See the PASNInteger, PASNSequence, PASNString and PASNObjectID classes for examples of ASN objects that can be created.

Only descendants of this class can be put into the ASNSequence class.

Definition at line 102 of file pasn.h.

Comparison functions

enum  Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
virtual Comparison Compare (const PObject &obj) const
virtual Comparison CompareObjectMemoryDirect (const PObject &obj) const
bool operator!= (const PObject &obj) const
bool operator< (const PObject &obj) const
bool operator<= (const PObject &obj) const
bool operator== (const PObject &obj) const
bool operator> (const PObject &obj) const
bool operator>= (const PObject &obj) const

Run Time Type functions

virtual const char * GetClass (unsigned=0) const
virtual BOOL InternalIsDescendant (const char *clsName) const
BOOL IsClass (const char *cls) const
static const char * Class ()

I/O functions

virtual void ReadFrom (istream &strm)
ostream & operator<< (ostream &strm, const PObject &obj)
istream & operator>> (istream &strm, PObject &obj)

Public Types

enum  ASNType {
  Integer, String, ObjectID, Sequence,
  Choice, IPAddress, Counter, Gauge,
  TimeTicks, Opaque, NsapAddress, Counter64,
  UInteger32, Null, Unknown, ASNTypeMax

Public Member Functions

virtual PObjectClone () const
virtual void Encode (PBYTEArray &buffer)
int GetChoice () const
virtual WORD GetEncodedLength ()
virtual PASNInt GetInteger () const
virtual PIPSocket::Address GetIPAddress () const
virtual const PASNSequenceGetSequence () const
virtual PString GetString () const
virtual ASNType GetType () const
virtual PString GetTypeAsString () const
virtual PASNUnsigned GetUnsigned () const
virtual void PrintOn (ostream &strm) const
Miscellaneous functions
virtual PINDEX HashFunction () const

Static Public Member Functions

static BOOL DecodeASNInteger (const PBYTEArray &buffer, PINDEX &ptr, PASNInt &value, ASNType type=Integer)
static BOOL DecodeASNLength (const PBYTEArray &buffer, PINDEX &ptr, WORD &len)
static BOOL DecodeASNUnsigned (const PBYTEArray &buffer, PINDEX &ptr, PASNUnsigned &value, ASNType type=TimeTicks)
static void EncodeASNHeader (PBYTEArray &buffer, PASNObject::ASNType type, WORD length)
static void EncodeASNInteger (PBYTEArray &buffer, PASNInt data, PASNObject::ASNType type)
static void EncodeASNLength (PBYTEArray &buffer, WORD length)
static void EncodeASNSequenceStart (PBYTEArray &buffer, BYTE type, WORD length)
static void EncodeASNUnsigned (PBYTEArray &buffer, PASNUnsigned data, PASNObject::ASNType type)
static WORD GetASNHeaderLength (WORD length)
static WORD GetASNIntegerLength (PASNInt data)
static WORD GetASNLengthLength (WORD length)
static WORD GetASNSequenceStartLength (WORD length)
static WORD GetASNUnsignedLength (PASNUnsigned data)

Protected Member Functions

 PASNObject ()

Static Protected Attributes

static BYTE ASNTypeToType [ASNTypeMax]

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

Generated by  Doxygen 1.6.0   Back to index