Asn1Real Class Reference
Public Member Functions | |
Asn1Real (double value) | |
Asn1Real () | |
virtual void | Decode (Asn1JsonDecodeBuffer buffer) |
override void | Decode (Asn1OerDecodeBuffer buffer) |
override void | Decode (Asn1PerDecodeBuffer buffer) |
override void | Decode (Asn1BerDecodeBuffer buffer, bool explicitTagging, int implicitLength) |
void | DecodeDouble (Asn1OerDecodeBuffer buffer) |
void | DecodeSingle (Asn1OerDecodeBuffer buffer) |
virtual void | DecodeXER (System.String buffer, System.String attrs, bool decodingElemName, bool modifiedEncodings) |
override void | DecodeXML (System.String buffer, System.String attrs) |
override void | Encode (Asn1PerOutputStream outs) |
override void | Encode (Asn1BerOutputStream outs, bool explicitTagging) |
virtual void | Encode (Asn1JsonOutputStream outstream) |
void | Encode (Asn1XmlEncoder buffer, String elemName, String nsPrefix, bool asText) |
override void | Encode (Asn1XmlEncoder buffer, System.String elemName, System.String nsPrefix) |
override void | Encode (Asn1XerEncoder buffer, System.String elemName) |
override void | Encode (Asn1OerEncodeBuffer buffer) |
override void | Encode (Asn1PerEncodeBuffer buffer) |
override int | Encode (Asn1BerEncodeBuffer buffer, bool explicitTagging) |
override void | EncodeAttribute (Asn1XmlEncoder buffer, System.String attrName) |
void | EncodeDouble (Asn1OerEncodeBuffer buffer) |
void | EncodeSingle (Asn1OerEncodeBuffer buffer) |
virtual void | EncodeValue (Asn1XmlEncoder buffer) |
override bool | Equals (System.Object value) |
virtual bool | Equals (double value) |
override int | GetHashCode () |
override System.String | ToString () |
Static Public Member Functions | |
static System.String | NormalizedRealValueToString (double value) |
Public Attributes | |
double | mValue |
Static Public Attributes | |
static new readonly Asn1Tag | _TAG |
Protected Member Functions | |
void | Decode (Asn1DecodeBuffer buffer, int length) |
Detailed Description
This class represents the ASN.1 REAL built-in type.
Constructor & Destructor Documentation
Asn1Real | ( | ) |
The default constructor sets the double value to zero.
Asn1Real | ( | double | value | ) |
This constructor creates an REAL object from a double value.
- Parameters:
-
value double value
Member Function Documentation
virtual void Decode | ( | Asn1JsonDecodeBuffer | buffer | ) | [virtual] |
Decode ASN.1 REAL from JSON.
override void Decode | ( | Asn1OerDecodeBuffer | buffer | ) | [virtual] |
Decode a REAL value, encoded according to OER, into this object.
This method applies to unconstrained REAL values and REAL values that are constrained but not meeting the requirements for encoding using IEEE 754 single or double precision format.
- Parameters:
-
buffer
- Exceptions:
-
IOException
Reimplemented from Asn1Type.
override void Decode | ( | Asn1PerDecodeBuffer | buffer | ) | [virtual] |
This method decodes ASN.1 REAL value using the Packed Encoding Rules (PER). The length and contents components of the message are decoded. The decoded result is stored in the public member 'mValue' in this object.
- Parameters:
-
buffer PER Decode message buffer object
Reimplemented from Asn1Type.
override void Decode | ( | Asn1BerDecodeBuffer | buffer, | |
bool | explicitTagging, | |||
int | implicitLength | |||
) | [virtual] |
This method decodes an ASN.1 REAL value including the UNIVERSAL tag value and length if explicit tagging is specified. This overloaded version uses the Basic Encoding Rules (BER).
- Parameters:
-
buffer Decode message buffer object explicitTagging Flag indicating element is explicitly tagged implicitLength Length of contents if implicit
Reimplemented from Asn1Type.
void Decode | ( | Asn1DecodeBuffer | buffer, | |
int | length | |||
) | [protected] |
This method decodes the content octets of an ASN.1 REAL value into this object, where the REAL was encoded as for BER and the length is taken to be as given.
Note that this method is used for OER also, since OER uses the same content octets as BER, at least in certain cases.
- Parameters:
-
buffer Decode message buffer object length Length of contents
void DecodeDouble | ( | Asn1OerDecodeBuffer | buffer | ) |
Decode a REAL value, encoded according to OER in double precision format.
- Parameters:
-
buffer
- Exceptions:
-
IOException
void DecodeSingle | ( | Asn1OerDecodeBuffer | buffer | ) |
Decode a REAL value, encoded according to OER in single precision format.
- Parameters:
-
buffer
- Exceptions:
-
IOException
virtual void DecodeXER | ( | System.String | buffer, | |
System.String | attrs, | |||
bool | decodingElemName, | |||
bool | modifiedEncodings | |||
) | [virtual] |
This method decodes an ASN.1 real value using XER.
- Parameters:
-
buffer String containing data to be decoded attrs Attributes string from element tag decodingElemName Pass true if you the ASN.1 value being decoded was encoded as an empty element and buffer is the element name. Such an encoding occurs for the special real values under basic-XER, canonical-XER, and extended-XER without GLOBAL-DEFAULTS MODIFIED-ENCODINGS present. modifiedEncodings Pass TRUE if decoding under extended-XER with GLOBAL-DEFAULTS MODIFIED-ENCODINGS present.
override void DecodeXML | ( | System.String | buffer, | |
System.String | attrs | |||
) |
This method decodes an ASN.1 real value using the XML schema encoding rules(asn2xsd).
- Parameters:
-
buffer String containing data to be decoded attrs Attributes string from element tag
override void Encode | ( | Asn1PerOutputStream | outs | ) | [virtual] |
This method encodes ASN.1 REAL value using the Packed Encoding Rules (PER). The length and contents components of the message are encoded.
Also throws any exception thrown by the Asn1PerOutputStream.
- Parameters:
-
outs PER Output Stream object
- Exceptions:
-
Asn1Exception Thrown, if operation is failed.
Reimplemented from Asn1Type.
override void Encode | ( | Asn1BerOutputStream | outs, | |
bool | explicitTagging | |||
) | [virtual] |
This method encodes and writes to the stream an ASN.1 real value including the UNIVERSAL tag value and length if explicit tagging is specified. This overloaded version uses the Basic Encoding Rules (BER).
Throws, Exception thrown by C# System.IO.Stream for I/O error
- Parameters:
-
outs BER Output Stream object explicitTagging Flag indicating explicit tagging should be done
- Exceptions:
-
Asn1Exception Thrown, if operation is failed.
Reimplemented from Asn1Type.
virtual void Encode | ( | Asn1JsonOutputStream | outstream | ) | [virtual] |
Encode this ASN.1 real value to JSON.
- Parameters:
-
outstream
void Encode | ( | Asn1XmlEncoder | buffer, | |
String | elemName, | |||
String | nsPrefix, | |||
bool | asText | |||
) |
This method encodes an ASN.1 real value according to XER encoding rules. It is for use with extended-XER.
- Parameters:
-
buffer Encode message buffer object elemName Element name asText If TRUE, encode special values as text. Otherwise, special values are encoded as empty elements.
override void Encode | ( | Asn1XmlEncoder | buffer, | |
System.String | elemName, | |||
System.String | nsPrefix | |||
) | [virtual] |
This method encodes an ASN.1 real value according to Obj-Sys encoding rules. The value is encoded as text.
- Parameters:
-
buffer Encode message buffer object elemName Element name nsPrefix Element namespace value
Reimplemented from Asn1Type.
override void Encode | ( | Asn1XerEncoder | buffer, | |
System.String | elemName | |||
) | [virtual] |
This method encodes an ASN.1 real value using the XML encoding rules (XER).
- Parameters:
-
buffer Encode message buffer object elemName Element name
Reimplemented from Asn1Type.
override void Encode | ( | Asn1OerEncodeBuffer | buffer | ) | [virtual] |
Encode this REAL value, according to OER, into the buffer. This method applies to unconstrained REAL values and REAL values that are constrained but not meeting the requirements for encoding using IEEE 754 single or double precision format.
Reimplemented from Asn1Type.
override void Encode | ( | Asn1PerEncodeBuffer | buffer | ) | [virtual] |
This method encodes ASN.1 REAL value using the Packed Encoding Rules (PER). The length and contents components of the message are encoded.
- Parameters:
-
buffer PER Encode message buffer object
Reimplemented from Asn1Type.
override int Encode | ( | Asn1BerEncodeBuffer | buffer, | |
bool | explicitTagging | |||
) | [virtual] |
This method encodes an ASN.1 REAL value including the UNIVERSAL tag value and length if explicit tagging is specified. This overloaded version uses the Basic Encoding Rules (BER).
- Parameters:
-
buffer Encode message buffer object explicitTagging Flag indicating explicit tagging should be done
- Returns:
- Length of component or negative status value
Reimplemented from Asn1Type.
override void EncodeAttribute | ( | Asn1XmlEncoder | buffer, | |
System.String | attrName | |||
) | [virtual] |
This method encodes an ASN.1 real value using the XML Encoding as specified in the W3C XML schema standard(asn2xsd).
- Parameters:
-
buffer Encode message buffer object attrName Attribute name
Reimplemented from Asn1Type.
void EncodeDouble | ( | Asn1OerEncodeBuffer | buffer | ) |
Encode this REAL value, according to OER, in double precision format, into the buffer.
- Parameters:
-
buffer
- Exceptions:
-
IOException
void EncodeSingle | ( | Asn1OerEncodeBuffer | buffer | ) |
Encode this REAL value, according to OER, in single precision format, into the buffer.
virtual void EncodeValue | ( | Asn1XmlEncoder | buffer | ) | [virtual] |
This method encodes an ASN.1 real value using the XML encoding (non-XER).
- Parameters:
-
buffer Encode message buffer object
override bool Equals | ( | System.Object | value | ) |
Determines whether the specified Object is equal to the current Object.
- Parameters:
-
value The Object to compare with the current Object. Object should be instance of Asn1Real.
- Returns:
true
if the specified Object is equal to the current Object; otherwise,false
.
virtual bool Equals | ( | double | value | ) | [virtual] |
This method compares this REAL value to the given value for equality.
- Parameters:
-
value The double value to compare with the current Object.
- Returns:
true
if the specified double value is equal to the current Object; otherwise,false
.
override int GetHashCode | ( | ) |
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
- Returns:
- A hash code for the current Object.
static System.String NormalizedRealValueToString | ( | double | value | ) | [static] |
This method will return a string representation of the normalized REAL value.
The output format is value format [-]X.XXXXE[-]XXX.
The format is the ASN.1 value format for this type. This means it is a "NumericRealValue" as defined in X.680. Additionally, if there is a leading minus sign, there will be no whitespace between it and the first digit of the integer part, making it also an "XMLNumericRealValue".
- Parameters:
-
value value to be normalized and stringified.
- Returns:
- the string as described above
override System.String ToString | ( | ) |
This method will return a string representation of the REAL value. The format is the ASN.1 value format for this type..
- Returns:
- Stringified representation of the value
Member Data Documentation
The _TAG
constant describes the universal tag for this data type (UNIVERSAL 9).
Reimplemented from Asn1Type.
double mValue |
This public member variable is where the double value is stored. This is the value that is encoded when one of the encode methods is called. It is also where the decoded result is stored when a Decode method is called.