Vidalia 0.2.15
|
00001 /* 00002 ** This file is part of Vidalia, and is subject to the license terms in the 00003 ** LICENSE file, found in the top level directory of this distribution. If you 00004 ** did not receive the LICENSE file with this file, you may obtain it from the 00005 ** Vidalia source package distributed by the Vidalia Project at 00006 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia, 00007 ** including this file, may be copied, modified, propagated, or distributed 00008 ** except according to the terms described in the LICENSE file. 00009 */ 00010 00011 #include "ServiceList.h" 00012 00013 00014 /** Default constructor. */ 00015 ServiceList::ServiceList() 00016 { 00017 } 00018 00019 /** Constructor to create a new Servicelist with initial settings */ 00020 void ServiceList::addService(Service service) 00021 { 00022 _services.append(service); 00023 } 00024 00025 /** Destructor */ 00026 ServiceList::~ServiceList() 00027 { 00028 } 00029 00030 /* Sets the serviceList */ 00031 void ServiceList::setServices(QList<Service> services) 00032 { 00033 _services = services; 00034 } 00035 00036 /** Writes ServiceList class data from <b>myObj</b> to the QDataStream 00037 * <b>out</b>. */ 00038 QDataStream&operator<<(QDataStream &out, const ServiceList &myObj) 00039 { 00040 out << myObj.services(); /* Write the services*/ 00041 return out; 00042 } 00043 00044 /** Reads ServiceList class data in from the QDataStream <b>in</b> and 00045 populates * the <b>myObj</b> object accordingly. */ 00046 QDataStream&operator>>(QDataStream &in, ServiceList &myObj) 00047 { 00048 QList<Service> services; 00049 /* Read in from the data stream */ 00050 in >> services; 00051 /* Set the appropriate class member variables */ 00052 myObj.setServices(services); 00053 /* Return the updated data stream */ 00054 return in; 00055 } 00056