| 1 | /**************************************************************************** | 
| 2 | ** | 
| 3 | ** Copyright (C) 2015 The Qt Company Ltd and/or its subsidiary(-ies). | 
| 4 | ** Contact: http://www.qt-project.org/legal | 
| 5 | ** | 
| 6 | ** This file is part of the QtSystems module of the Qt Toolkit. | 
| 7 | ** | 
| 8 | ** $QT_BEGIN_LICENSE:LGPL21$ | 
| 9 | ** Commercial License Usage | 
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | 
| 11 | ** accordance with the commercial license agreement provided with the | 
| 12 | ** Software or, alternatively, in accordance with the terms contained in | 
| 13 | ** a written agreement between you and The Qt Company. For licensing terms | 
| 14 | ** and conditions see http://www.qt.io/terms-conditions. For further | 
| 15 | ** information use the contact form at http://www.qt.io/contact-us. | 
| 16 | ** | 
| 17 | ** GNU Lesser General Public License Usage | 
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | 
| 19 | ** General Public License version 2.1 or version 3 as published by the Free | 
| 20 | ** Software Foundation and appearing in the file LICENSE.LGPLv21 and | 
| 21 | ** LICENSE.LGPLv3 included in the packaging of this file. Please review the | 
| 22 | ** following information to ensure the GNU Lesser General Public License | 
| 23 | ** requirements will be met: https://www.gnu.org/licenses/lgpl.html and | 
| 24 | ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | 
| 25 | ** | 
| 26 | ** As a special exception, The Qt Company gives you certain additional | 
| 27 | ** rights. These rights are described in The Qt Company LGPL Exception | 
| 28 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | 
| 29 | ** | 
| 30 | ** $QT_END_LICENSE$ | 
| 31 | ** | 
| 32 | ****************************************************************************/ | 
| 33 |  | 
| 34 | #include "qservicerequest_p.h" | 
| 35 |  | 
| 36 | // Default constructor - required by meta-type system - note that we could just | 
| 37 | // fall back on the one automatically created by the compiler but let's be | 
| 38 | // explicit so no mistakes are made - eg, does m_reply get set to zero? | 
| 39 | QServiceRequest::QServiceRequest() | 
| 40 |     : m_reply(0), m_scope(QService::UserScope), m_type(DefaultInterfaceRequest) | 
| 41 | { | 
| 42 |     // nothing to do here | 
| 43 | } | 
| 44 |  | 
| 45 | QServiceRequest::QServiceRequest(const QString &interfaceName) | 
| 46 |     : m_interfaceName(interfaceName), | 
| 47 |       m_reply(0), | 
| 48 |       m_scope(QService::UserScope), | 
| 49 |       m_type(DefaultInterfaceRequest) | 
| 50 | { | 
| 51 |     // nothing to do here | 
| 52 | } | 
| 53 |  | 
| 54 | QServiceRequest::QServiceRequest(const QServiceInterfaceDescriptor &descriptor) | 
| 55 |     : m_descriptor(descriptor), | 
| 56 |       m_reply(0), | 
| 57 |       m_scope(QService::UserScope), | 
| 58 |       m_type(DescriptorRequest) | 
| 59 | { | 
| 60 |     // nothing to do here | 
| 61 | } | 
| 62 |  | 
| 63 | // copy constructor - required by meta-type system - again let's be explicit | 
| 64 | QServiceRequest::QServiceRequest(const QServiceRequest &other) | 
| 65 |     : m_interfaceName(other.m_interfaceName), | 
| 66 |       m_descriptor(other.m_descriptor), | 
| 67 |       m_reply(other.m_reply), | 
| 68 |       m_scope(other.m_scope), | 
| 69 |       m_type(other.m_type) | 
| 70 | { | 
| 71 | } | 
| 72 |  | 
| 73 | // public destructor - required by meta-type system | 
| 74 | QServiceRequest::~QServiceRequest() | 
| 75 | { | 
| 76 |     // nothing to do here | 
| 77 | } | 
| 78 |  | 
| 79 | // assignment operator - not needed by meta-type but handy anyway | 
| 80 | QServiceRequest & QServiceRequest::operator=(const QServiceRequest &rhs) | 
| 81 | { | 
| 82 |     if (&rhs == this) | 
| 83 |         return *this; | 
| 84 |  | 
| 85 |     m_interfaceName = rhs.m_interfaceName; | 
| 86 |     m_descriptor = rhs.m_descriptor; | 
| 87 |     m_reply = rhs.m_reply; | 
| 88 |     m_type = rhs.m_type; | 
| 89 |     m_scope = rhs.m_scope; | 
| 90 |     return *this; | 
| 91 | } | 
| 92 |  | 
| 93 | QServiceInterfaceDescriptor QServiceRequest::descriptor() const | 
| 94 | { | 
| 95 |     return m_descriptor; | 
| 96 | } | 
| 97 |  | 
| 98 | void QServiceRequest::setDescriptor(const QServiceInterfaceDescriptor &descriptor) | 
| 99 | { | 
| 100 |     m_type = DescriptorRequest; | 
| 101 |     m_descriptor = descriptor; | 
| 102 | } | 
| 103 |  | 
| 104 | void QServiceRequest::setInterfaceName(const QString &interfaceName) | 
| 105 | { | 
| 106 |     m_type = DefaultInterfaceRequest; | 
| 107 |     m_interfaceName = interfaceName; | 
| 108 | } | 
| 109 |  | 
| 110 | QString QServiceRequest::interfaceName() const | 
| 111 | { | 
| 112 |     return m_interfaceName; | 
| 113 | } | 
| 114 |  | 
| 115 | QServiceReply *QServiceRequest::reply() const | 
| 116 | { | 
| 117 |     return m_reply; | 
| 118 | } | 
| 119 |  | 
| 120 | void QServiceRequest::setReply(QServiceReply *reply) | 
| 121 | { | 
| 122 |     m_reply = reply; | 
| 123 | } | 
| 124 |  | 
| 125 | QService::Scope QServiceRequest::scope() const | 
| 126 | { | 
| 127 |     return m_scope; | 
| 128 | } | 
| 129 |  | 
| 130 | void QServiceRequest::setScope(QService::Scope scope) | 
| 131 | { | 
| 132 |     m_scope = scope; | 
| 133 | } | 
| 134 |  | 
| 135 | QServiceRequest::Request QServiceRequest::requestType() const | 
| 136 | { | 
| 137 |     return m_type; | 
| 138 | } | 
| 139 |  |