ActionRequest Class Reference

This class represents the Upnp_Action_Request type from the SDK. More...

#include <action_request.h>

Inheritance diagram for ActionRequest:
zmm::Object

Public Member Functions

 ActionRequest (Upnp_Action_Request *upnp_request)
 The Constructor takes the values from the upnp_request and fills in internal variables.
zmm::String getActionName ()
 Returns the name of the action.
zmm::String getUDN ()
 Returns the UDN of the recepient device (should be ours).
zmm::String getServiceID ()
 Returns the ID of the service (the action is for this service id).
zmm::Ref< mxml::ElementgetRequest ()
 Returns the XML representation of the request.
void setResponse (zmm::Ref< mxml::Element > response)
 Sets the response (XML created outside as the answer to the request).
void setErrorCode (int errCode)
 Set the error code for the SDK.
void update ()
 Updates the upnp_request structure.
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static void * operator new (size_t size)
static void operator delete (void *ptr)

Protected Attributes

Upnp_Action_Requestupnp_request
 Upnp_Action_Request that comes from the SDK.
int errCode
 Error code that is returned to the SDK.
zmm::String actionName
 Name of the action.
zmm::String UDN
 UDN of the recepient device (it should be our UDN).
zmm::String serviceID
 ID of the service.
zmm::Ref< mxml::Elementrequest
 XML holding the request that comes to us.
zmm::Ref< mxml::Elementresponse
 XML holding the response, we fill it in.
mt_atomic_t _ref_count
pthread_mutex_t mutex

Detailed Description

This class represents the Upnp_Action_Request type from the SDK.

When we get a Upnp_Action_Request from the SDK we convert it to our structure. The idea is to get the XML of the request, process it outside of the class, create a response XML and put it back in. Before pasing upnp_request back to the SDK the update() function MUST be called.

Definition at line 46 of file action_request.h.


Constructor & Destructor Documentation

ActionRequest::ActionRequest ( Upnp_Action_Request upnp_request  ) 

The Constructor takes the values from the upnp_request and fills in internal variables.

Parameters:
*upnp_request Pointer to the Upnp_Action_Request structure.

Definition at line 41 of file action_request.cc.

References Upnp_Action_Request::ActionName, actionName, Upnp_Action_Request::ActionRequest, Upnp_Action_Request::DevUDN, DOMString, errCode, ixmlFreeDOMString(), ixmlPrintDocument(), request, Upnp_Action_Request::ServiceID, serviceID, UDN, and UPNP_E_SUCCESS.


Member Function Documentation

String ActionRequest::getActionName (  ) 

Returns the name of the action.

Definition at line 59 of file action_request.cc.

References actionName.

int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

References zmm::Object::_ref_count, and atomic_get().

Ref< Element > ActionRequest::getRequest (  ) 

Returns the XML representation of the request.

Definition at line 71 of file action_request.cc.

References request.

String ActionRequest::getServiceID (  ) 

Returns the ID of the service (the action is for this service id).

Definition at line 67 of file action_request.cc.

References serviceID.

String ActionRequest::getUDN (  ) 

Returns the UDN of the recepient device (should be ours).

Definition at line 63 of file action_request.cc.

References UDN.

void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file object.cc.

References MALLOC.

void Object::release (  )  [inherited]
void Object::retain (  )  [inherited]
void ActionRequest::setErrorCode ( int  errCode  ) 

Set the error code for the SDK.

Parameters:
errCode UPnP error code.

In case there was an error processing the request, we can return the appropriate error code to the SDK.

Definition at line 80 of file action_request.cc.

void ActionRequest::setResponse ( zmm::Ref< mxml::Element response  ) 

Sets the response (XML created outside as the answer to the request).

Parameters:
response XML holding the action response.

Definition at line 76 of file action_request.cc.

void ActionRequest::update (  ) 

Updates the upnp_request structure.

This function writes all changed values into the upnp_request structure, and must be called at the very end before giving *upnp_request back to the SDK.

Definition at line 85 of file action_request.cc.

References Upnp_Action_Request::ActionResult, zmm::String::c_str(), errCode, Upnp_Action_Request::ErrCode, IXML_SUCCESS, ixmlParseBufferEx(), log_debug, log_error, nil, response, UPNP_E_ACTION_FAILED, UPNP_E_SUCCESS, and upnp_request.


Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]

Name of the action.

Returned by getActionName()

Definition at line 58 of file action_request.h.

Referenced by ActionRequest(), and getActionName().

int ActionRequest::errCode [protected]

Error code that is returned to the SDK.

Definition at line 53 of file action_request.h.

Referenced by ActionRequest(), and update().

pthread_mutex_t zmm::Object::mutex [protected, inherited]

XML holding the request that comes to us.

Returned by getRequest()

Definition at line 73 of file action_request.h.

Referenced by ActionRequest(), and getRequest().

XML holding the response, we fill it in.

Set by setResponse()

Definition at line 78 of file action_request.h.

Referenced by update().

ID of the service.

Returned by getServiceID()

Definition at line 68 of file action_request.h.

Referenced by ActionRequest(), and getServiceID().

UDN of the recepient device (it should be our UDN).

Returned by getUDN()

Definition at line 63 of file action_request.h.

Referenced by ActionRequest(), and getUDN().

Upnp_Action_Request that comes from the SDK.

Definition at line 50 of file action_request.h.

Referenced by update().


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

Generated on Fri Mar 26 20:16:55 2010 for MediaTomb by  doxygen 1.6.1