Vidalia  0.3.1
ServiceList.cpp
Go to the documentation of this file.
1 /*
2 ** This file is part of Vidalia, and is subject to the license terms in the
3 ** LICENSE file, found in the top level directory of this distribution. If you
4 ** did not receive the LICENSE file with this file, you may obtain it from the
5 ** Vidalia source package distributed by the Vidalia Project at
6 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7 ** including this file, may be copied, modified, propagated, or distributed
8 ** except according to the terms described in the LICENSE file.
9 */
10 
11 #include "ServiceList.h"
12 
13 
14 /** Default constructor. */
16 {
17 }
18 
19 /** Constructor to create a new Servicelist with initial settings */
21 {
22  _services.append(service);
23 }
24 
25 /** Destructor */
27 {
28 }
29 
30 /* Sets the serviceList */
31 void ServiceList::setServices(QList<Service> services)
32 {
34 }
35 
36 /** Writes ServiceList class data from <b>myObj</b> to the QDataStream
37  * <b>out</b>. */
38 QDataStream&operator<<(QDataStream &out, const ServiceList &myObj)
39 {
40  out << myObj.services(); /* Write the services*/
41  return out;
42 }
43 
44 /** Reads ServiceList class data in from the QDataStream <b>in</b> and
45  populates * the <b>myObj</b> object accordingly. */
46 QDataStream&operator>>(QDataStream &in, ServiceList &myObj)
47 {
48  QList<Service> services;
49  /* Read in from the data stream */
50  in >> services;
51  /* Set the appropriate class member variables */
52  myObj.setServices(services);
53  /* Return the updated data stream */
54  return in;
55 }
56 
QList< Service > services() const
Definition: ServiceList.h:32
void addService(Service service)
Definition: ServiceList.cpp:20
friend QDataStream & operator<<(QDataStream &out, const ServiceList &myObj)
Definition: ServiceList.cpp:38
QList< Service > _services
Definition: ServiceList.h:45
void setServices(QList< Service > services)
Definition: ServiceList.cpp:31
friend QDataStream & operator>>(QDataStream &in, ServiceList &myObj)
Definition: ServiceList.cpp:46
virtual ~ServiceList()
Definition: ServiceList.cpp:26