defuze.me  Client
servicerequest.cpp
00001 /**************************************************************************
00002 ** defuze.me Epitech Innovative Project
00003 **
00004 ** Copyright 2010-2011
00005 **   Athena Calmettes - Jocelyn De La Rosa - Francois Gaillard
00006 **   Adrien Jarthon - Alexandre Moore - Luc Peres - Arnaud Sellier
00007 **
00008 ** All rights reserved.
00009 **************************************************************************/
00010 
00011 #include "servicerequest.hpp"
00012 
00013 using namespace WebService;
00014 
00015 ServiceRequest::ServiceRequest(ServiceSync  *ss, const QString& url) :
00016     serviceSync(ss), url(url)
00017 {
00018 
00019 }
00020 
00021 void            ServiceRequest::setData(const QVariantMap& data)
00022 {
00023     this->data = data;
00024 }
00025 
00026 QVariant&       ServiceRequest::operator[](const QString& key)
00027 {
00028     return data[key];
00029 }
00030 
00031 QVariant        ServiceRequest::operator[](const QString& key) const
00032 {
00033     return data[key];
00034 }
00035 
00036 void    ServiceRequest::enqueue()
00037 {
00038     serviceSync->requests.push_back(this);
00039     serviceSync->sendNextRequest();
00040 }