ServiceList.cpp

Go to the documentation of this file.
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.vidalia-project.net/. No part of Vidalia, including this file,
00007 **  may be copied, modified, propagated, or distributed except according to the
00008 **  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 
Generated on Mon Aug 30 22:58:55 2010 for Vidalia by  doxygen 1.6.3