This class represents the Upnp_Action_Request type from the SDK. More...
#include <action_request.h>
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::Element > | getRequest () |
| 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_Request * | upnp_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::Element > | request |
| XML holding the request that comes to us. | |
| zmm::Ref< mxml::Element > | response |
| XML holding the response, we fill it in. | |
| mt_atomic_t | _ref_count |
| pthread_mutex_t | mutex |
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.
| ActionRequest::ActionRequest | ( | Upnp_Action_Request * | upnp_request | ) |
The Constructor takes the values from the upnp_request and fills in internal variables.
| *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.
| 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().
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] |
| void * Object::operator new | ( | size_t | size | ) | [static, inherited] |
| void Object::release | ( | ) | [inherited] |
Definition at line 66 of file object.cc.
References zmm::Object::_ref_count, atomic_dec(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::clear(), zmm::String::operator=(), DSOHash< zmm::Array< CacheObject > >::releaseData(), DSBHash< VT >::releaseData(), DSOHash< zmm::Array< CacheObject > >::remove(), zmm::ArrayBase::remove(), zmm::ArrayBase::removeUnordered(), zmm::ArrayBase::set(), zmm::ArrayBase::~ArrayBase(), DSOHash< zmm::Array< CacheObject > >::~DSOHash(), zmm::ObjectQueue< AutoscanDirectory >::~ObjectQueue(), zmm::ObjectStack< Element >::~ObjectStack(), and zmm::String::~String().
| void Object::retain | ( | ) | [inherited] |
Definition at line 58 of file object.cc.
References zmm::Object::_ref_count, atomic_inc(), and zmm::Object::mutex.
Referenced by zmm::ArrayBase::append(), zmm::ObjectQueue< AutoscanDirectory >::enqueue(), zmm::ArrayBase::insert(), zmm::String::operator=(), zmm::ObjectStack< Element >::push(), DSOHash< zmm::Array< CacheObject > >::put(), DSBHash< VT >::put(), zmm::ArrayBase::set(), and zmm::String::String().
| void ActionRequest::setErrorCode | ( | int | errCode | ) |
Set the error code for the SDK.
| 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).
| 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.
mt_atomic_t zmm::Object::_ref_count [protected, inherited] |
Definition at line 54 of file object.h.
Referenced by zmm::Object::getRefCount(), zmm::Object::Object(), zmm::Object::release(), and zmm::Object::retain().
zmm::String ActionRequest::actionName [protected] |
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] |
Reimplemented in AutoscanList, AutoscanInotify, CachedURL, Dictionary_r, DVDNavReader, IOHandlerBufferHelper, ReentrantArray< T >, SingletonManager, Singleton< T >, StorageCache, MutexAutolock, Cond, ThreadExecutor, Singleton< UpdateManager >, Singleton< Timer >, Singleton< ContentDirectoryService >, Singleton< ConfigManager >, Singleton< Server >, Singleton< Runtime >, Singleton< ContentManager >, Singleton< ConnectionManagerService >, Singleton< PlayHook >, Singleton< Storage >, and Singleton< SessionManager >.
Definition at line 56 of file object.h.
Referenced by zmm::Object::Object(), zmm::Object::release(), zmm::Object::retain(), and zmm::Object::~Object().
zmm::Ref<mxml::Element> ActionRequest::request [protected] |
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().
zmm::Ref<mxml::Element> ActionRequest::response [protected] |
XML holding the response, we fill it in.
Set by setResponse()
Definition at line 78 of file action_request.h.
Referenced by update().
zmm::String ActionRequest::serviceID [protected] |
ID of the service.
Returned by getServiceID()
Definition at line 68 of file action_request.h.
Referenced by ActionRequest(), and getServiceID().
zmm::String ActionRequest::UDN [protected] |
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* ActionRequest::upnp_request [protected] |
Upnp_Action_Request that comes from the SDK.
Definition at line 50 of file action_request.h.
Referenced by update().
1.6.1