OSXSDGlobalElement Class Reference

XSD global element base class. More...

#include <rtXmlCppXSDElement.h>

List of all members.

Public Member Functions

 OSXSDGlobalElement (OSRTMessageBufferIF &msgBuf)
 This constructor sets the internal message buffer pointer to point at the given message buffer or stream object.
 OSXSDGlobalElement (const OSXSDGlobalElement &o)
 The copy constructor sets the internal message buffer pointer and context to point at the message buffer and context from the original OSCType object.
virtual ~OSXSDGlobalElement ()
 The virtual destructor does nothing.
int decode ()
 The decode method decodes the message described by the encapsulated message buffer object.
virtual int decodeFrom (OSRTMessageBufferIF &)
 The decodeFrom method decodes a message from the given message buffer or stream argument.
int encode ()
 The encode method encodes a message using the encoding rules specified by the derived message buffer object.
virtual int encodeTo (OSRTMessageBufferIF &)
 The encodeTo method encodes a message into the given message buffer or stream argument.
OSCTXT * getCtxtPtr ()
 The getCtxtPtr method returns the underlying C runtime context.
void * memAlloc (size_t numocts)
 The memAlloc method allocates memory using the C runtime memory management functions.
void memFreePtr (void *ptr)
 The memFreePtr method frees the memory at a specific location.
void setDefaultNamespace (const OSUTF8CHAR *uri)
 The setDefaultNamespace method sets the default namespace for the element to the given value.
void setDiag (OSBOOL value=TRUE)
 The setDiag method turns diagnostic tracing on or off.
void setEncXSINamespace (OSBOOL value=TRUE)
 The setEncXSINamespace method sets a flag in the internal context that indicates the xsi namespace attribute must be encoded.
void setNamespace (const OSUTF8CHAR *prefix, const OSUTF8CHAR *uri)
 The setNamespace method adds or modifies the namespace with the given URI in the namespace list to contain the given prefix.
void setNoNSSchemaLocation (const OSUTF8CHAR *uri)
 The setNoNSSchemaLocation method adds an xsi:noNamespaceSchemaLocation attribute to the document.
void setSchemaLocation (const OSUTF8CHAR *uri)
 The setSchemaLocation method adds an xsi:schemaLocation attribute to the document.
void setXSIType (const OSUTF8CHAR *typeName)
 The setXSIType method sets a type name to be used in the xsi:type attribute in the top-level module element declaration.
int validate ()
 The validate method validates the message described by the encapsulated message buffer object.
virtual int validateFrom (OSRTMessageBufferIF &)
 The validateFrom method validates a message from the given message buffer or stream argument.

Protected Member Functions

 OSXSDGlobalElement ()
 The default constructor sets the message pointer member variable to NULL and creates a new context object.
 OSXSDGlobalElement (OSRTContext &ctxt)
 This constructor sets the message pointer member variable to NULL and initializes the context object to point at the given context value.
void setMsgBuf (OSRTMessageBufferIF &msgBuf)
 The setMsgBuf method is used to set the internal message buffer pointer to point at the given message buffer or stream object.

Protected Attributes

OSRTCtxtPtr mpContext
 The mpContext member variable holds a reference-counted C runtime variable.
OSRTMessageBufferIF * mpMsgBuf
 The mpMsgBuf member variable is a pointer to a derived message buffer or stream class that will manage the message being encoded or decoded.

Detailed Description

XSD global element base class.

This is the main base class for all generated global element 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.

Definition at line 57 of file rtXmlCppXSDElement.h.


Constructor & Destructor Documentation

OSXSDGlobalElement::OSXSDGlobalElement ( OSRTContext &  ctxt  )  [inline, protected]

This constructor sets the message pointer member variable to NULL and initializes the context object to point at the given context value.

Parameters:
ctxt - Reference to a context object.

Definition at line 85 of file rtXmlCppXSDElement.h.

OSXSDGlobalElement::OSXSDGlobalElement ( OSRTMessageBufferIF &  msgBuf  )  [inline]

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.

Parameters:
msgBuf - Reference to a message buffer or stream object.

Definition at line 105 of file rtXmlCppXSDElement.h.

OSXSDGlobalElement::OSXSDGlobalElement ( const OSXSDGlobalElement o  )  [inline]

The copy constructor sets the internal message buffer pointer and context to point at the message buffer and context from the original OSCType object.

Parameters:
o - Reference to a global element object.

Definition at line 116 of file rtXmlCppXSDElement.h.

virtual OSXSDGlobalElement::~OSXSDGlobalElement (  )  [inline, virtual]

The virtual destructor does nothing.

It is overridden by derived versions of this class.

Definition at line 123 of file rtXmlCppXSDElement.h.


Member Function Documentation

virtual int OSXSDGlobalElement::decodeFrom ( OSRTMessageBufferIF &   )  [inline, virtual]

The decodeFrom method decodes a message from the given message buffer or stream argument.

Parameters:
- Message buffer or stream containing message to decode.

Definition at line 138 of file rtXmlCppXSDElement.h.

virtual int OSXSDGlobalElement::encodeTo ( OSRTMessageBufferIF &   )  [inline, virtual]

The encodeTo method encodes a message into the given message buffer or stream argument.

Parameters:
- Message buffer or stream to which the message is to be encoded.

Definition at line 153 of file rtXmlCppXSDElement.h.

OSCTXT* OSXSDGlobalElement::getCtxtPtr (  )  [inline]

The getCtxtPtr method returns the underlying C runtime context.

This context can be used in calls to C runtime functions.

Definition at line 159 of file rtXmlCppXSDElement.h.

void* OSXSDGlobalElement::memAlloc ( size_t  numocts  )  [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 OSXSDGlobalElement derived control class object and the message buffer object are destroyed, this memory will be freed.

Parameters:
numocts - Number of bytes of memory to allocate

Definition at line 172 of file rtXmlCppXSDElement.h.

void OSXSDGlobalElement::memFreePtr ( void *  ptr  )  [inline]

The memFreePtr method frees the memory at a specific location.

This memory must have been allocated using the memAlloc method described earlier.

Parameters:
ptr - Pointer to a block of memory allocated with memAlloc

Definition at line 200 of file rtXmlCppXSDElement.h.

void OSXSDGlobalElement::setDefaultNamespace ( const OSUTF8CHAR *  uri  )  [inline]

The setDefaultNamespace method sets the default namespace for the element to the given value.

Parameters:
uri - Default namespace URI

Definition at line 210 of file rtXmlCppXSDElement.h.

void OSXSDGlobalElement::setDiag ( OSBOOL  value = TRUE  )  [inline]

The setDiag method turns diagnostic tracing on or off.

Parameters:
value - Boolean on/off value (default = on)

Definition at line 219 of file rtXmlCppXSDElement.h.

void OSXSDGlobalElement::setEncXSINamespace ( OSBOOL  value = TRUE  )  [inline]

The setEncXSINamespace method sets a flag in the internal context that indicates the xsi namespace attribute must be encoded.

Parameters:
value - Boolean on/off value (default = on)

Definition at line 229 of file rtXmlCppXSDElement.h.

References rtXmlSetEncXSINamespace().

void OSXSDGlobalElement::setMsgBuf ( OSRTMessageBufferIF &  msgBuf  )  [protected]

The setMsgBuf method is used to set the internal message buffer pointer to point at the given message buffer or stream object.

Parameters:
msgBuf - Reference to a message buffer or stream object.
void OSXSDGlobalElement::setNamespace ( const OSUTF8CHAR *  prefix,
const OSUTF8CHAR *  uri 
) [inline]

The setNamespace method adds or modifies the namespace with the given URI in the namespace list to contain the given prefix.

Parameters:
prefix - Namespace prefix
uri - Namespace URI

Definition at line 240 of file rtXmlCppXSDElement.h.

void OSXSDGlobalElement::setNoNSSchemaLocation ( const OSUTF8CHAR *  uri  )  [inline]

The setNoNSSchemaLocation method adds an xsi:noNamespaceSchemaLocation attribute to the document.

Parameters:
uri - URI for noNamespaceSchemaLocation.

Definition at line 250 of file rtXmlCppXSDElement.h.

References rtXmlSetNoNSSchemaLocation().

void OSXSDGlobalElement::setSchemaLocation ( const OSUTF8CHAR *  uri  )  [inline]

The setSchemaLocation method adds an xsi:schemaLocation attribute to the document.

Parameters:
uri - URI for schemaLocation.

Definition at line 260 of file rtXmlCppXSDElement.h.

References rtXmlSetSchemaLocation().

void OSXSDGlobalElement::setXSIType ( const OSUTF8CHAR *  typeName  )  [inline]

The setXSIType method sets a type name to be used in the xsi:type attribute in the top-level module element declaration.

Parameters:
typeName - XSI type name

Definition at line 270 of file rtXmlCppXSDElement.h.

References rtXmlSetXSITypeAttr().

virtual int OSXSDGlobalElement::validateFrom ( OSRTMessageBufferIF &   )  [inline, virtual]

The validateFrom method validates a message from the given message buffer or stream argument.

Parameters:
- Message buffer or stream containing message to validate.

Definition at line 287 of file rtXmlCppXSDElement.h.


Member Data Documentation

OSRTCtxtPtr OSXSDGlobalElement::mpContext [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.

Definition at line 65 of file rtXmlCppXSDElement.h.


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