IOData Class Reference

`#include <iodata.h>`

Inheritance diagram for IOData:
[legend]

## Public Types

enum | Type { }

## Public Member Functions

| IOData (Type type)
| IOData (const Tag *tag)
virtual | ~IOData ()
Type | type () const
const Tag * | in () const
void | setIn (Tag *in)
const Tag * | out () const
void | setOut (Tag *out)
const Tag * | error () const
void | setError (Tag *error)
void | setDesc (const std::string &desc)
const std::string & | desc () const
void | setStatus (Status status)
Status | status () const
virtual Tag * | tag () const
virtual IOData * | clone () const
virtual const std::string & | filterString () const
virtual StanzaExtension * | newInstance (const Tag *) const
| operator bool () const
Public Member Functions inherited from AdhocPlugin
| AdhocPlugin (int type)
virtual | ~AdhocPlugin ()
Public Member Functions inherited from StanzaExtension
| StanzaExtension (int type)
virtual | ~StanzaExtension ()
virtual Stanza * | embeddedStanza () const
virtual Tag * | embeddedTag () const
int | extensionType () const

## Detailed Description

This is an abstraction of the IO Data specification XEP-0244.

This abstraction can be used to implement IO Data on top of Data Forms.

XEP version: 0.1

Author
  Jakob Schröter js@ca.nosp@m.maya.nosp@m..net

Since
  1.0.13

Definition at line 36 of file iodata.h.

## Member Enumeration Documentation

## Type

enum Type

The IO Data transaction types.

Enumerator
TypeInput | To request the schemata of input and output.
TypeGetStatus | To submit the input.
TypeGetOutput | To request the status of the procedure.
TypeIoSchemataResult | To request the output.
TypeOutput | To return the schemata of input and output.
TypeError | To submit the output.
TypeStatus | To submit additional error information.
TypeInvalid | To indicate the current status of the procedure. Invalid type.

Definition at line 42 of file iodata.h.

## Constructor & Destructor Documentation

## IOData() [1/2]

IOData | ( | Type | type | ) |

Constructs a new IO Data object of the given type.

Parameters

  type | The transaction type.

Definition at line 37 of file iodata.cpp.

## IOData() [2/2]

IOData | ( | const Tag * | tag | ) |

Constructs a new IO Data object by parsing the given Tag.

Parameters

  tag | The Tag to parse. This should be a <iodata> tag with the correct namespace and child elements.

Definition at line 47 of file iodata.cpp.

## ~IOData()

~IOData | ( |  | ) |

virtual

Virtual destructor.

Definition at line 121 of file iodata.cpp.

## Member Function Documentation

## clone()

IOData * clone | ( |  | ) | const

virtual

Returns an identical copy of the current StanzaExtension.

Returns
  An identical copy of the current StanzaExtension.

Implements StanzaExtension.

Definition at line 175 of file iodata.cpp.

## desc()

const std::string & desc | ( |  | ) | const

inline

Returns the schema description, if any. Usually only valid if transaction type is `io-schema-result`.

Returns
  The schema description.

Definition at line 146 of file iodata.h.

## error()

const Tag * error | ( |  | ) | const

inline

Returns the 'error' tag, if the transaction type is either `error` or `io-schemata-result`.

Returns
  The 'error' tag, including the encapsulating <error>.

Note
  The IOData instance will still own the tag and delete it. Clone it if you need it later.

Definition at line 125 of file iodata.h.

## filterString()

virtual const std::string & filterString | ( |  | ) | const

inline virtual

Returns an XPath expression that describes a path to child elements of a stanza that an extension handles.

Returns
  The extension's filter string.

Implements StanzaExtension.

Definition at line 167 of file iodata.h.

## in()

const Tag * in | ( |  | ) | const

inline

Returns the 'input' tag, if the transaction type is either `input` or `io-schemata-result`.

Returns
  The 'input' tag, including the encapsulating <in>.

Note
  The IOData instance will still own the tag and delete it. Clone it if you need it later.

Definition at line 93 of file iodata.h.

## newInstance()

virtual StanzaExtension * newInstance | ( | const Tag * | tag | ) | const

inline virtual

Returns a new Instance of the derived type. Usually, for a derived class FooExtension, the implementation of this function looks like:

StanzaExtension* FooExtension::newInstance( const Tag* tag ) const
{
return new FooExtension( tag );
}
gloox::IOData::tag
virtual Tag * tag() const
Definition iodata.cpp:128
gloox::StanzaExtension
This class abstracts a stanza extension, which is usually an XML child element in a specific namespac...
Definition stanzaextension.h:204
gloox::Tag
This is an abstraction of an XML element.
Definition tag.h:47

Returns
  The derived extension's new instance.

Implements StanzaExtension.

Definition at line 170 of file iodata.h.

## operator bool()

operator bool | ( |  | ) | const

inline virtual

Converts to true if the IOData is valid, false otherwise.

Implements AdhocPlugin.

Definition at line 175 of file iodata.h.

## out()

const Tag * out | ( |  | ) | const

inline

Returns the 'output' tag, if the transaction type is either `output` or `io-schemata-result`.

Returns
  The 'output' tag, including the encapsulating <out>.

Note
  The IOData instance will still own the tag and delete it. Clone it if you need it later.

Definition at line 109 of file iodata.h.

## setDesc()

void setDesc | ( | const std::string & | desc | ) |

inline

Sets the Schema description. Only used/valid if type is `io-schemata-result`.

Parameters

  desc | The schema description.

Definition at line 140 of file iodata.h.

## setError()

void setError | ( | Tag * | error | ) |

Sets the 'error' tag. If an 'error' tag was previosuly set, it is deleted before the new one is set. Alternatively, if your error consists of more than one element, you can embed these into an <error> tag with no namespace.

Parameters

  error | The new 'error' tag.

Note
  The `error` tag will be owned by this IOData instance. Clone it if you need it somewhere else.

Definition at line 223 of file iodata.cpp.

## setIn()

void setIn | ( | Tag * | in | ) |

Sets the 'input' tag. If an 'input' tag was previosuly set, it is deleted before the new one is set. Alternatively, if your input consists of more than one element, you can embed these into an <in> tag with no namespace.

Parameters

  in | The new 'input' tag.

Note
  The `in` tag will be owned by this IOData instance. Clone it if you need it somewhere else.

Definition at line 191 of file iodata.cpp.

## setOut()

void setOut | ( | Tag * | out | ) |

Sets the 'output' tag. If an 'output' tag was previosuly set, it is deleted before the new one is set. Alternatively, if your output consists of more than one element, you can embed these into an <out> tag with no namespace.

Parameters

  out | The new 'output' tag.

Note
  The `out` tag will be owned by this IOData instance. Clone it if you need it somewhere else.

Definition at line 207 of file iodata.cpp.

## setStatus()

void setStatus | ( | Status | status | ) |

inline

Sets the status of the procedure. Only used/valid if transaction type is `status`.

Parameters

  status | The status of the procedure.

Definition at line 152 of file iodata.h.

## status()

Status status | ( |  | ) | const

inline

Returns the status of the procedure. Only used/valid if transaction type is `status`.

Returns
  The status of the procedure.

Definition at line 158 of file iodata.h.

## tag()

Tag * tag | ( |  | ) | const

virtual

Returns a Tag representation of the extension.

Returns
  A Tag representation of the extension.

Implements StanzaExtension.

Definition at line 128 of file iodata.cpp.

## type()

Type type | ( |  | ) | const

inline

Returns the IO Data object's type.

Returns
  The IO Data object's type.

Definition at line 86 of file iodata.h.

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

- iodata.h
- iodata.cpp