Yate
XmlElementOut Class Reference

An outgoing XML element. More...

#include <xmpputils.h>

Inheritance diagram for XmlElementOut:
RefObject GenObject

Public Member Functions

 XmlElementOut (XmlElement *element, const char *senderID=0, bool unclose=false)
 
virtual ~XmlElementOut ()
 
XmlElement * element () const
 
bool sent () const
 
const Stringbuffer ()
 
const Stringid () const
 
unsigned int dataCount ()
 
const char * getData (unsigned int &nCount)
 
void dataSent (unsigned int nCount)
 
XmlElement * release ()
 
void toBuffer (String &buffer)
 
void prepareToSend ()
 
- Public Member Functions inherited from RefObject
 RefObject ()
 
virtual ~RefObject ()
 
virtual void * getObject (const String &name) const
 
virtual bool alive () const
 
bool ref ()
 
bool deref ()
 
int refcount () const
 
virtual void destruct ()
 
- Public Member Functions inherited from GenObject
 GenObject ()
 
virtual ~GenObject ()
 
virtual const StringtoString () const
 
virtual const StringtraceId () const
 
NamedCountergetObjCounter () const
 
NamedCountersetObjCounter (NamedCounter *counter)
 

Additional Inherited Members

- Static Public Member Functions inherited from RefObject
static bool alive (const RefObject *obj)
 
static bool efficientIncDec ()
 
- Static Public Member Functions inherited from GenObject
static void * getObject (const String &name, const GenObject *obj)
 
static bool getObjCounting ()
 
static void setObjCounting (bool enable)
 
static NamedCountergetObjCounter (const String &name, bool create=true)
 
static ObjListgetObjCounters ()
 
- Protected Member Functions inherited from RefObject
virtual void zeroRefs ()
 
bool resurrect ()
 
virtual void destroyed ()
 

Detailed Description

An outgoing XML element.

This class holds an XML element to be sent through a stream

Constructor & Destructor Documentation

◆ XmlElementOut()

XmlElementOut ( XmlElement * element,
const char * senderID = 0,
bool unclose = false )
inline

Constructor

Parameters
elementThe XML element
senderIDOptional sender id
uncloseTrue to not close the tag when building the buffer

References element().

◆ ~XmlElementOut()

virtual ~XmlElementOut ( )
inlinevirtual

Destructor Delete m_element if not 0

Member Function Documentation

◆ buffer()

const String & buffer ( )
inline

Get the data buffer

Returns
The data buffer

Referenced by toBuffer().

◆ dataCount()

unsigned int dataCount ( )
inline

Get the remainig byte count to send

Returns
The unsent number of bytes

Referenced by getData().

◆ dataSent()

void dataSent ( unsigned int nCount)
inline

Increase the offset with nCount bytes. Set the sent flag

Parameters
nCountThe number of bytes sent

◆ element()

XmlElement * element ( ) const
inline

Get the underlying element

Returns
The underlying element

Referenced by XmlElementOut().

◆ getData()

const char * getData ( unsigned int & nCount)
inline

Get the remainig data to send. Set the buffer if not already set

Parameters
nCountThe number of unsent bytes
Returns
Pointer to the remaining data or 0

References dataCount(), and prepareToSend().

◆ id()

const String & id ( ) const
inline

Get the id member

Returns
The id member

◆ prepareToSend()

void prepareToSend ( )
inline

Fill the buffer with the XML element to send

References toBuffer().

Referenced by getData().

◆ release()

XmlElement * release ( )
inline

Release the ownership of m_element The caller is responsable of returned pointer

Returns
XmlElement pointer or 0

◆ sent()

bool sent ( ) const
inline

Check if this element was (partially) sent

Returns
True if an attempt to send this element was already done

◆ toBuffer()

void toBuffer ( String & buffer)
inline

Fill a buffer with the XML element to send

Parameters
bufferThe buffer to fill

References buffer(), and String::empty().

Referenced by prepareToSend().


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