Public Member Functions | Friends | Related Functions

HActionArguments Class Reference
[Device Model]

A storage class for HActionArgument instances. More...

#include <HActionArguments>

List of all members.

Public Member Functions

 HActionArguments ()
 HActionArguments (const QVector< HActionArgument * > &args)
 HActionArguments (const HActionArguments &)
 ~HActionArguments ()
HActionArgumentsoperator= (const HActionArguments &)
bool contains (const QString &argumentName) const
HActionArgumentget (const QString &argumentName)
const HActionArgumentget (const QString &argumentName) const
HActionArgumentget (qint32 index)
const HActionArgumentget (qint32 index) const
HActionArguments::const_iterator constBegin () const
HActionArguments::const_iterator constEnd () const
HActionArguments::iterator begin ()
HActionArguments::const_iterator begin () const
HActionArguments::iterator end ()
HActionArguments::const_iterator end () const
qint32 size () const
HActionArgumentoperator[] (qint32 index)
const HActionArgumentoperator[] (qint32 index) const
HActionArgumentoperator[] (const QString &argName)
const HActionArgumentoperator[] (const QString &argName) const
QList< QString > names () const
bool isEmpty () const
void clear ()
bool remove (const QString &name)
bool append (HActionArgument *arg)
QString toString () const

Friends

H_UPNP_CORE_EXPORT bool operator== (const HActionArguments &, const HActionArguments &)

Related Functions

(Note that these are not member functions.)



H_UPNP_CORE_EXPORT void swap (HActionArguments &, HActionArguments &)
H_UPNP_CORE_EXPORT bool operator!= (const HActionArguments &, const HActionArguments &)

Detailed Description

Instances of this class are used to contain the input and output arguments for an action invocation.

Note:
The class provides iterative and keyed access to the stored HActionArgument instances. The order of action arguments during iteration is the order in which the HActionArgument objects are provided to the instance. If the class is instantiated by HUPnP, the order of the contained arguments during iteration is the order in which they are defined in the service description document.
See also:
HActionArgument, HAction
Remarks:
this class is not thread-safe.

Constructor & Destructor Documentation

Creates a new, empty instance.

See also:
isEmpty()
HActionArguments ( const QVector< HActionArgument * > &  args  ) 

Creates a new instance from the specified input arguments and takes the ownership of the provided arguments.

Parameters:
args specifies the action argument objects this instance will manage.
See also:
isEmpty()
HActionArguments ( const HActionArguments other  ) 

Copy constructor.

Creates a copy of other.

~HActionArguments (  ) 

Destroys the instance.


Member Function Documentation

HActionArguments & operator= ( const HActionArguments other  ) 

Assignment operator.

Copies the contents of other to this.

Returns:
a reference to this object.
bool contains ( const QString &  argumentName  )  const

Indicates if the object contains an argument with the specified name.

Parameters:
argumentName specifies the name of the action argument.
Returns:
true in case the object contains an argument with the specified name.
Remarks:
this is a constant-time operation.
HActionArgument * get ( const QString &  argumentName  ) 

Retrieves an action argument.

Retrieves an action argument with the specified name.

Parameters:
argumentName specifies the name of the argument to be retrieved.
Returns:
a pointer to the action argument with the specified name or a null pointer in case no argument has the specified name.
Warning:
  • Do not delete the return value. The ownership of the object is not transferred.
  • The returned object is deleted when this container is being deleted.
Remarks:
this is a constant-time operation.
const HActionArgument * get ( const QString &  argumentName  )  const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
argumentName specifies the name of the argument to be retrieved.
Returns:
a pointer to the action argument with the specified name or a null pointer in case no argument has the specified name.
HActionArgument * get ( qint32  index  ) 

Retrieves an action argument.

Retrieves an action argument from the specified index.

Parameters:
index specifies the index of the action argument to return. The index has to be valid position in the container, i.e. it must be 0 <= i < size().
Returns:
a pointer to the action argument that can be found at the specified index.
Warning:
  • Do not delete the return value. The ownership of the object is not transferred.
  • The returned object is deleted when this container is being deleted.
Remarks:
this is a constant-time operation.
const HActionArgument * get ( qint32  index  )  const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
index specifies the index of the action argument to return. The index has to be valid position in the container, i.e. it must be 0 <= i < size().
Returns:
a pointer to the action argument that can be found at the specified index.
HActionArguments::const_iterator constBegin (  )  const

Returns a const STL-style iterator pointing to the first item.

Returns:
a const STL-style iterator pointing to the first item.
HActionArguments::const_iterator constEnd (  )  const

Returns a const STL-style iterator pointing to the imaginary item after the last item.

Returns:
a const STL-style iterator pointing to the imaginary item after the last item.

Returns an STL-style iterator pointing to the first item.

Returns:
an STL-style iterator pointing to the first item.
HActionArguments::const_iterator begin (  )  const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns:
an STL-style iterator pointing to the first item.

Returns an STL-style iterator pointing to the imaginary item after the last item.

Returns:
an STL-style iterator pointing to the imaginary item after the last item.
HActionArguments::const_iterator end (  )  const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Returns:
an STL-style iterator pointing to the imaginary item after the last item.
qint32 size (  )  const

Returns the number of arguments.

Returns:
the number of arguments.
HActionArgument * operator[] ( qint32  index  ) 

Returns the action argument matching the specified index.

This is the same as calling get() with the specified index. This method is provided for convenience.

Parameters:
index specifies the index of the action argument to return. The index has to be valid position in the container, i.e. it must be 0 <= i < size().
Returns:
the action argument matching the specified index.
const HActionArgument * operator[] ( qint32  index  )  const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
index specifies the index of the action argument to return. The index has to be valid position in the container, i.e. it must be 0 <= i < size().
Returns:
the action argument matching the specified index.
HActionArgument * operator[] ( const QString &  argName  ) 

Returns the action argument matching the specified name, if any.

This is the same as calling get() with the specified argument name. This method is provided for convenience.

Parameters:
argName specifies the name of the argument to be retrieved.
Returns:
the action argument matching the specified name, if any.
const HActionArgument * operator[] ( const QString &  argName  )  const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Parameters:
argName specifies the name of the argument to be retrieved.
Returns:
the action argument matching the specified name, if any.
QList< QString > names (  )  const

The names of all the arguments.

Returns:
names of all the arguments.
bool isEmpty (  )  const

Indicates if the object is empty, i.e.

it has no arguments.

Returns:
true when the object has no arguments.
void clear (  ) 

Removes every contained HActionArgument from this instance.

Warning:
Calling this function will make any active iterators invalid.
bool remove ( const QString &  name  ) 

Removes an HActionArgument with the specified name.

Parameters:
name specifies the name of the HActionArgument to be removed.
Returns:
true if an HActionArgument was found and removed.
Warning:
Calling this function will make any active iterators invalid.
bool append ( HActionArgument arg  ) 

Inserts a new HActionArgument to this instance.

Parameters:
arg specifies the HActionArgument to be added.
Returns:
true if the specified argument was added. The action argument will not be added if the instance already contains an action argument instance with the same name or the provided pointer is null.
Remarks:
  • This instance takes the ownership of the provided HActionArgument object.
Warning:
Calling this function will make any active iterators invalid.
QString toString (  )  const

Returns a string representation of the object.

Returns:
a string representation of the object. The returned string contains all the arguments represented as strings and separated from each other by a new-line. The string representation of an argument is retrieved using HActionArgument::toString().

Friends And Related Function Documentation

H_UPNP_CORE_EXPORT bool operator== ( const HActionArguments ,
const HActionArguments  
) [friend]

Compares the two objects for equality.

Returns:
true in case the object are logically equivalent.
H_UPNP_CORE_EXPORT void swap ( HActionArguments a,
HActionArguments b 
) [friend]

Swaps the contents of the two containers.

H_UPNP_CORE_EXPORT bool operator!= ( const HActionArguments ,
const HActionArguments  
) [related]

Compares the two objects for inequality.

Returns:
true in case the object are not logically equivalent.