ASN1C C/C++ Common Runtime
ASN1C v7.2.x
|
#include <asn1CppTypes.h>
Public Member Functions | |
EXTRTMETHOD | ASN1CType (OSRTMessageBufferIF &msgBuf) |
EXTRTMETHOD | ASN1CType (const ASN1CType &orig) |
virtual | ~ASN1CType () |
void | append (OSRTDList &llist, void *pdata) |
OSRTCtxtPtr | getContext () |
OSCTXT * | getCtxtPtr () |
char * | getErrorText (char *textbuf=(char *) 0, OSSIZE bufsize=0) |
int | getStatus () const |
void * | memAlloc (OSSIZE numocts) |
void * | memAllocZ (OSSIZE numocts) |
void | memFreeAll () |
void * | memRealloc (void *ptr, OSSIZE numocts) |
void | memReset () |
void | memFreePtr (void *ptr) |
void | printErrorInfo () |
void | resetError () |
OSBOOL | setDiag (OSBOOL value) |
virtual EXTRTMETHOD int | Encode () |
virtual EXTRTMETHOD int | Decode (OSBOOL free=FALSE) |
virtual int | EncodeTo (OSRTMessageBufferIF &) |
virtual int | DecodeFrom (OSRTMessageBufferIF &, OSBOOL free=TRUE) |
Protected Member Functions | |
EXTRTMETHOD | ASN1CType () |
EXTRTMETHOD | ASN1CType (OSRTContext &ctxt) |
EXTRTMETHOD int | setMsgBuf (OSRTMessageBufferIF &msgBuf, OSBOOL initBuf=FALSE) |
EXTRTMETHOD int | setRunTimeKey (const OSOCTET *key, OSSIZE keylen) |
Protected Attributes | |
OSRTCtxtPtr | mpContext |
OSRTMessageBufferIF * | mpMsgBuf |
ASN1C control class base class. This is the main base class for all generated ASN1C_<name> control classes. It holds a variable of a generated data type as well as the associated message buffer or stream class to which a message will be encoded or from which a message will be decoded.
|
protected |
The default constructor sets the message pointer member variable to NULL and creates a new context object.
|
protected |
This constructor sets the message pointer member variable to NULL and initializes the context object to point at the given context value.
ctxt | - Reference to a context object. |
EXTRTMETHOD ASN1CType::ASN1CType | ( | OSRTMessageBufferIF & | msgBuf | ) |
This constructor sets the internal message buffer pointer to point at the given message buffer or stream object. The context is set to point at the context contained within the message buffer object. Thus, the message buffer and control class object share the context. It will not be released until both objects are destroyed.
msgBuf | - Reference to a message buffer or stream object. |
EXTRTMETHOD ASN1CType::ASN1CType | ( | const ASN1CType & | orig | ) |
The copy constructor sets the internal message buffer pointer and context to point at the message buffer and context from the original ASN1CType object.
orig | - Reference to a message buffer or stream object. |
|
inlinevirtual |
The virtual destructor does nothing. It is overridden by derived versions of this class.
|
inline |
The append method can be used to append an element to any linked list structure contained within the generated type.
llist | Linked list structure. |
pdata | Data record to be appended. Note that the pointer value is appended. The data is not copied. |
References LOG_RTERR, RTERR_NOMEM, and rtxDListAppend().
|
virtual |
The Decode
method decodes the ASN.1 message described by the encapsulated message buffer object by invoking DecodeFrom.
free | Indicates whether memory for existing objects should be freed prior to decoding as part of object (re)initialization. |
|
inlinevirtual |
The DecodeFrom
method decodes an ASN.1 message from the given message buffer or stream argument.
msgBuf | Message buffer or stream containing message to decode. |
free | Indicates whether memory for existing objects should be freed prior to decoding as part of object (re)initialization. |
References ASN_E_NOTPDU, and OS_UNUSED_ARG.
|
virtual |
The Encode
method encodes an ASN.1 message using the encoding rules specified by the derived message buffer object.
|
inlinevirtual |
The EncodeTo
method encodes an ASN.1 message into the given message buffer or stream argument.
msgBuf | Message buffer or stream to which the message is to be encoded. |
References ASN_E_NOTPDU.
|
inline |
The getContext method returns the underlying context smart-pointer object.
|
inline |
The getCtxtPtr method returns the underlying C runtime context. This context can be used in calls to C runtime functions.
References OSRTContext::getPtr(), and OSRTCtxtPtr::isNull().
char* ASN1CType::getErrorText | ( | char * | textbuf = (char *) 0 , |
OSSIZE | bufsize = 0 |
||
) |
This method returns the error text associated with the last run-time error. If buffer pointer and buffer size are specified in parameters (not NULL) then error text will be copied in the passed buffer. Otherwise, this function allocates memory using the 'new' operator. It is the user's responsibility to free this memory using 'delete'.
textbuf | A pointer to a destination buffer to hold the error text. If NULL, a dynamic buffer will be allocated. |
bufsize | The size of the output buffer size. |
|
inline |
This method returns the completion status of previous operation. It can be used to check completion status of constructors or methods, which do not return completion status. If error occurs, use printErrorInfo method to print out the error's description and stack trace. Method resetError can be used to reset error to continue operations after recovering from the error.
References OSRTContext::getStatus(), and OSRTCtxtPtr::isNull().
|
inline |
The memAlloc method allocates memory using the C runtime memory management functions. The memory is tracked in the underlying context structure. When both this ASN1CType derived control class object and the message buffer object are destroyed, this memory will be freed.
numocts | Number of bytes of memory to allocate |
References OSRTCtxtPtr::isNull(), and OSRTContext::memAlloc().
|
inline |
The memAllocZ method allocates memory using the C runtime memory management functions. The memory is tracked in the underlying context structure. When both this ASN1CType derived control class object and the message buffer object are destroyed, this memory will be freed. This memory will be zeroed out upon allocation.
numocts | Number of bytes of memory to allocate |
References OSRTCtxtPtr::isNull(), and OSRTContext::memAllocZ().
|
inline |
The memFreeAll
method will free all memory currently tracked within the context. This includes all memory allocated with the memAlloc method as well as any memory allocated using the C rtxMemAlloc
function with the context returned by the getCtxtPtr
method.
References OSRTCtxtPtr::isNull(), and OSRTContext::memFreeAll().
|
inline |
The memFreePtr method frees the memory at a specific location. This memory must have been allocated using the memAlloc method described earlier.
ptr | - Pointer to a block of memory allocated with memAlloc |
References OSRTCtxtPtr::isNull(), and OSRTContext::memFreePtr().
|
inline |
The memRealloc method reallocates memory using the C runtime memory management functions.
ptr | Original pointer containing dynamic memory to be resized. |
numocts | Number of bytes of memory to allocate |
References OSRTCtxtPtr::isNull(), and OSRTContext::memRealloc().
|
inline |
The memReset method resets dynamic memory using the C runtime memory management functions.
References OSRTCtxtPtr::isNull(), and OSRTContext::memReset().
|
inline |
The PrintErrorInfo method prints information on errors contained within the context.
References OSRTCtxtPtr::isNull(), and OSRTContext::printErrorInfo().
|
inline |
This method resets error status and stack trace. This method should be used to continue operations after recovering from the error.
References OSRTCtxtPtr::isNull(), and OSRTContext::resetErrorInfo().
|
inline |
This method turns diagnostic tracing on or off.
value | Boolean value; TRUE = turn tracing on. |
|
protected |
This method sets run-time key to the context. This method does nothing for unlimited redistribution libraries.
key | - array of octets with the key |
keylen | - number of octets in key array. |
|
protected |
The mpContext member variable holds a reference-counted C runtime variable. This context is used in calls to all C run-time functions. The context pointed at by this smart-pointer object is shared with the message buffer object contained within this class.
|
protected |
The mpMsgBuf member variable is a pointer to a derived message buffer or stream class that will manage the ASN.1 message being encoded or decoded.