PASN_Object Class Referenceabstract

Base class for ASN encoding/decoding. More...

`#include <asner.h>`

Inheritance diagram for PASN_Object:

## Public Types

enum | TagClass { UniversalTagClass, ApplicationTagClass, ContextSpecificTagClass, PrivateTagClass, DefaultTagClass }

enum

UniversalTags {
InvalidUniversalTag, UniversalBoolean, UniversalInteger, UniversalBitString,
UniversalOctetString, UniversalNull, UniversalObjectId, UniversalObjectDescriptor,
UniversalExternalType, UniversalReal, UniversalEnumeration, UniversalEmbeddedPDV,
UniversalSequence = 16, UniversalSet, UniversalNumericString, UniversalPrintableString,
UniversalTeletexString, UniversalVideotexString, UniversalIA5String, UniversalUTCTime,
UniversalGeneralisedTime, UniversalGeneralizedTime = UniversalGeneralisedTime, UniversalGraphicString, UniversalVisibleString,
UniversalGeneralString, UniversalUniversalString, UniversalBMPString = 30
}

enum | ConstraintType { Unconstrained, PartiallyConstrained, FixedConstraint, ExtendableConstraint }
enum | MinimumValueTag { MinimumValue = INT_MIN }
enum | MaximumValueTag { MaximumValue = INT_MAX }
Public Types inherited from PObject
enum | Comparison { LessThan = -1, EqualTo = 0, GreaterThan = 1 }
| Result of the comparison operation performed by the `Compare()` function. More...

## Public Member Functions

virtual PString | GetTypeAsString () const =0
| Return a string giving the type of the object. More...
PINDEX | GetObjectLength () const
virtual PINDEX | GetDataLength () const =0
virtual PBoolean | IsPrimitive () const
virtual PBoolean | Decode (PASN_Stream &)=0
virtual void | Encode (PASN_Stream &) const =0
PBoolean | IsExtendable () const
void | SetExtendable (PBoolean ext=true)
TagClass | GetTagClass () const
unsigned | GetTag () const
virtual void | SetTag (unsigned newTag, TagClass tagClass=DefaultTagClass)
void | SetConstraints (ConstraintType type, int value)
void | SetConstraints (ConstraintType, int lower, MaximumValueTag)
void | SetConstraints (ConstraintType, MinimumValueTag lower, unsigned upper)
void | SetConstraints (ConstraintType, MinimumValueTag lower, MaximumValueTag upper)
void | SetConstraints (ConstraintType type, int lower, unsigned upper)
virtual void | SetConstraintBounds (ConstraintType type, int lower, unsigned upper)
virtual void | SetCharacterSet (ConstraintType ctype, const char *charSet)
virtual void | SetCharacterSet (ConstraintType ctype, unsigned firstChar, unsigned lastChar)
Public Member Functions inherited from PObject
virtual | ~PObject ()
virtual PObject * | Clone () const
| Create a copy of the class on the heap. More...
virtual PINDEX | HashFunction () const
| This function yields a hash value required by the `PDictionary` class. More...
virtual Comparison | Compare (const PObject &obj) const
| Compare the two objects and return their relative rank. More...
virtual Comparison | CompareObjectMemoryDirect (const PObject &obj) const
| Determine the byte wise comparison of two objects. More...
bool | operator== (const PObject &obj) const
| Compare the two objects. More...
bool | operator!= (const PObject &obj) const
| Compare the two objects. More...
bool | operator< (const PObject &obj) const
| Compare the two objects. More...
bool | operator> (const PObject &obj) const
| Compare the two objects. More...
bool | operator<= (const PObject &obj) const
| Compare the two objects. More...
bool | operator>= (const PObject &obj) const
| Compare the two objects. More...
virtual const char * | GetClass (unsigned ancestor=0) const
| Get the current dynamic type of the object instance. More...
PBoolean | IsClass (const char *cls) const
virtual PBoolean | InternalIsDescendant (const char *clsName) const
| Determine if the dynamic type of the current instance is a descendent of the specified class. More...
virtual void | PrintOn (ostream &strm) const
| Output the contents of the object to the stream. More...
virtual void | ReadFrom (istream &strm)
| Input the contents of the object from the stream. More...

## Static Public Member Functions

static PINDEX | GetMaximumArraySize ()
static void | SetMaximumArraySize (PINDEX sz)
static PINDEX | GetMaximumStringSize ()
static void | SetMaximumStringSize (PINDEX sz)
Static Public Member Functions inherited from PObject
static Comparison | InternalCompareObjectMemoryDirect (const PObject *obj1, const PObject *obj2, PINDEX size)
| Internal function caled from CompareObjectMemoryDirect() More...
static const char * | Class ()
| Get the name of the class as a C string. More...

## Protected Member Functions

| PASN_Object (unsigned tag, TagClass tagClass, PBoolean extend=false)
Protected Member Functions inherited from PObject
| PObject ()
| Constructor for PObject, made protected so cannot ever create one on its own. More...

## Protected Attributes

PBoolean | extendable
| PER extension capability. More...
TagClass | tagClass
| BER tag class. More...
unsigned | tag
| ASN object tag. More...

## Detailed Description

Base class for ASN encoding/decoding.

## Member Enumeration Documentation

enum PASN_Object::ConstraintType

Enumerator
Unconstrained |
PartiallyConstrained |
FixedConstraint |
ExtendableConstraint |

enum PASN_Object::MaximumValueTag

Enumerator
MaximumValue |

enum PASN_Object::MinimumValueTag

Enumerator
MinimumValue |

enum PASN_Object::TagClass

Enumerator
UniversalTagClass |
ApplicationTagClass |
ContextSpecificTagClass |
PrivateTagClass |
DefaultTagClass |

enum PASN_Object::UniversalTags

Enumerator
InvalidUniversalTag |
UniversalBoolean |
UniversalInteger |
UniversalBitString |
UniversalOctetString |
UniversalNull |
UniversalObjectId |
UniversalObjectDescriptor |
UniversalExternalType |
UniversalReal |
UniversalEnumeration |
UniversalEmbeddedPDV |
UniversalSequence |
UniversalSet |
UniversalNumericString |
UniversalPrintableString |
UniversalTeletexString |
UniversalVideotexString |
UniversalIA5String |
UniversalUTCTime |
UniversalGeneralisedTime |
UniversalGeneralizedTime |
UniversalGraphicString |
UniversalVisibleString |
UniversalGeneralString |
UniversalUniversalString |
UniversalBMPString |

## Constructor & Destructor Documentation

PASN_Object::PASN_Object | ( | unsigned | tag,
|  | TagClass | tagClass,
|  | PBoolean | extend = `false`
| ) |  |

protected

## Member Function Documentation

virtual PBoolean PASN_Object::Decode | ( | PASN_Stream & |  | ) |

pure virtual

Implemented in PASN_Array, PASN_Sequence, PASN_Choice, PASN_BMPString, PASN_ConstrainedString, PASN_OctetString, PASN_BitString, PASN_ObjectId, PASN_Real, PASN_Enumeration, PSNMP_Message, PASN_Integer, PASN_Boolean, PASN_Null, PSNMP_Trap_PDU, PSNMP_PDU, PSNMP_VarBind, and PSNMP_PDUs.

virtual void PASN_Object::Encode | ( | PASN_Stream & |  | ) | const

pure virtual

Implemented in PASN_Array, PASN_Sequence, PASN_Choice, PASN_BMPString, PASN_ConstrainedString, PASN_OctetString, PASN_BitString, PASN_ObjectId, PASN_Real, PASN_Enumeration, PSNMP_Message, PASN_Integer, PASN_Boolean, PASN_Null, PSNMP_Trap_PDU, PSNMP_PDU, PSNMP_VarBind, and PSNMP_PDUs.

virtual PINDEX PASN_Object::GetDataLength | ( |  | ) | const

pure virtual

Implemented in PASN_Array, PASN_Sequence, PASN_Choice, PASN_BMPString, PASN_ConstrainedString, PASN_OctetString, PASN_BitString, PASN_ObjectId, PASN_Real, PASN_Enumeration, PSNMP_Message, PASN_Integer, PASN_Boolean, PASN_Null, PSNMP_Trap_PDU, PSNMP_PDU, and PSNMP_VarBind.

static PINDEX PASN_Object::GetMaximumArraySize | ( |  | ) |

static

static PINDEX PASN_Object::GetMaximumStringSize | ( |  | ) |

static

PINDEX PASN_Object::GetObjectLength | ( |  | ) | const

unsigned PASN_Object::GetTag | ( |  | ) | const

inline

References tag.

TagClass PASN_Object::GetTagClass | ( |  | ) | const

inline

References tagClass.

virtual PString PASN_Object::GetTypeAsString | ( |  | ) | const

pure virtual

Return a string giving the type of the object.

Implemented in PASN_Array, PASN_Set, PASN_Sequence, PASN_Choice, PASN_BMPString, PASN_OctetString, PASN_BitString, PASN_ObjectId, PASN_Real, PASN_Enumeration, PASN_Integer, PASN_Boolean, and PASN_Null.

PBoolean PASN_Object::IsExtendable | ( |  | ) | const

inline

References extendable.

virtual PBoolean PASN_Object::IsPrimitive | ( |  | ) | const

inline virtual

Reimplemented in PASN_Array, PASN_Sequence, and PASN_Choice.

virtual void PASN_Object::SetCharacterSet | ( | ConstraintType | ctype,
|  | const char * | charSet
| ) |  |

virtual

Reimplemented in PASN_BMPString, and PASN_ConstrainedString.

virtual void PASN_Object::SetCharacterSet | ( | ConstraintType | ctype,
|  | unsigned | firstChar,
|  | unsigned | lastChar
| ) |  |

virtual

Reimplemented in PASN_BMPString, and PASN_ConstrainedString.

virtual void PASN_Object::SetConstraintBounds | ( | ConstraintType | type,
|  | int | lower,
|  | unsigned | upper
| ) |  |

virtual

Reimplemented in PASN_Array, PASN_ConstrainedString, PASN_OctetString, PASN_BitString, PASN_Integer, and PASN_ConstrainedObject.

Referenced by SetConstraints().

void PASN_Object::SetConstraints | ( | ConstraintType | type,
|  | int | value
| ) |  |

inline

References SetConstraintBounds().

void PASN_Object::SetConstraints | ( | ConstraintType | ,
|  | int | lower,
|  | MaximumValueTag |
| ) |  |

inline

References PartiallyConstrained, and SetConstraintBounds().

void PASN_Object::SetConstraints | ( | ConstraintType | ,
|  | MinimumValueTag | lower,
|  | unsigned | upper
| ) |  |

inline

References PartiallyConstrained, and SetConstraintBounds().

void PASN_Object::SetConstraints | ( | ConstraintType | ,
|  | MinimumValueTag | lower,
|  | MaximumValueTag | upper
| ) |  |

inline

References PartiallyConstrained, and SetConstraintBounds().

void PASN_Object::SetConstraints | ( | ConstraintType | type,
|  | int | lower,
|  | unsigned | upper
| ) |  |

inline

References SetConstraintBounds().

void PASN_Object::SetExtendable | ( | PBoolean | ext = `true` | ) |

inline

References extendable.

static void PASN_Object::SetMaximumArraySize | ( | PINDEX | sz | ) |

static

static void PASN_Object::SetMaximumStringSize | ( | PINDEX | sz | ) |

static

virtual void PASN_Object::SetTag | ( | unsigned | newTag,
|  | TagClass | tagClass = `DefaultTagClass`
| ) |  |

virtual

Reimplemented in PASN_Choice.

## Member Data Documentation

PBoolean PASN_Object::extendable

protected

PER extension capability.

Referenced by IsExtendable(), and SetExtendable().

unsigned PASN_Object::tag

protected

ASN object tag.

Referenced by GetTag().

TagClass PASN_Object::tagClass

protected

BER tag class.

Referenced by GetTagClass().

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

- asner.h