41 #ifndef _RTXMLCPPXSDELEMENT_H_ 42 #define _RTXMLCPPXSDELEMENT_H_ 44 #include "rtxsrc/OSRTContext.h" 45 #include "rtxsrc/OSRTMsgBufIF.h" 46 #include "rtxsrc/rtxDiag.h" 47 #include "rtxsrc/rtxErrCodes.h" 93 void setMsgBuf (OSRTMessageBufferIF& msgBuf);
106 mpContext = msgBuf.getContext();
117 mpContext (o.mpContext), mpMsgBuf (o.mpMsgBuf) { }
129 inline int decode () {
return decodeFrom (*mpMsgBuf); }
144 inline int encode () {
return encodeTo (*mpMsgBuf); }
153 virtual int encodeTo (OSRTMessageBufferIF&) {
return 0; }
160 return (!mpContext.isNull ()) ? mpContext->getPtr() : 0;
173 return rtxMemAlloc (getCtxtPtr(), numocts);
187 inline void* memRealloc (
void* ptr,
size_t oldnumocts,
size_t numocts) {
188 return rtxMemRealloc (getCtxtPtr(), ptr, oldnumocts, numocts);
201 rtxMemFreePtr (getCtxtPtr(), ptr);
211 setNamespace (0, uri);
220 rtxSetDiag (getCtxtPtr(), value);
240 inline void setNamespace (
const OSUTF8CHAR* prefix,
const OSUTF8CHAR* uri) {
241 mpMsgBuf->setNamespace (prefix, uri);
278 inline int validate () {
return validateFrom (*mpMsgBuf); }
288 {
return RTERR_NOTSUPP; }
virtual ~OSXSDGlobalElement()
The virtual destructor does nothing.
EXTERNXML int rtXmlSetNoNSSchemaLocation(OSCTXT *pctxt, const OSUTF8CHAR *schemaLocation)
This function sets the XML Schema Instance (xsi) no namespace schema location attribute to be added t...
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 co...
virtual int decodeFrom(OSRTMessageBufferIF &)
The decodeFrom method decodes a message from the given message buffer or stream argument.
int validate()
The validate method validates the message described by the encapsulated message buffer object...
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 e...
OSRTCtxtPtr mpContext
The mpContext member variable holds a reference-counted C runtime variable.
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.
EXTERNXML int rtXmlSetEncXSINamespace(OSCTXT *pctxt, OSBOOL value)
This function sets a flag in the context that indicates the XSI namespace declaration (xmlns:xsi) sho...
virtual int encodeTo(OSRTMessageBufferIF &)
The encodeTo method encodes a message into the given message buffer or stream argument.
virtual int validateFrom(OSRTMessageBufferIF &)
The validateFrom method validates a message from the given message buffer or stream argument...
void setDefaultNamespace(const OSUTF8CHAR *uri)
The setDefaultNamespace method sets the default namespace for the element to the given value...
void setEncXSINamespace(OSBOOL value=TRUE)
The setEncXSINamespace method sets a flag in the internal context that indicates the xsi namespace at...
void setNoNSSchemaLocation(const OSUTF8CHAR *uri)
The setNoNSSchemaLocation method adds an xsi:noNamespaceSchemaLocation attribute to the document...
OSCTXT * getCtxtPtr()
The getCtxtPtr method returns the underlying C runtime context.
XML low-level C encode/decode functions.
OSXSDGlobalElement(OSRTContext &ctxt)
This constructor sets the message pointer member variable to NULL and initializes the context object ...
EXTERNXML int rtXmlSetSchemaLocation(OSCTXT *pctxt, const OSUTF8CHAR *schemaLocation)
This function sets the XML Schema Instance (xsi) schema location attribute to be added to an encoded ...
OSXSDGlobalElement()
The default constructor sets the message pointer member variable to NULL and creates a new context ob...
int encode()
The encode method encodes a message using the encoding rules specified by the derived message buffer ...
OSXSDGlobalElement(const OSXSDGlobalElement &o)
The copy constructor sets the internal message buffer pointer and context to point at the message buf...
EXTERNXML int rtXmlSetXSITypeAttr(OSCTXT *pctxt, const OSUTF8CHAR *xsiType)
This function sets the XML Schema Instance (xsi) type attribute value.
XSD global element base class.
void setDiag(OSBOOL value=TRUE)
The setDiag method turns diagnostic tracing on or off.
OSRTMessageBufferIF * mpMsgBuf
The mpMsgBuf member variable is a pointer to a derived message buffer or stream class that will manag...
OSXSDGlobalElement(OSRTMessageBufferIF &msgBuf)
This constructor sets the internal message buffer pointer to point at the given message buffer or str...
int decode()
The decode method decodes the message described by the encapsulated message buffer object...