QxOrm 1.4.9
C++ Object Relational Mapping library
Loading...
Searching...
No Matches
QxService.h
Go to the documentation of this file.
1/****************************************************************************
2**
3** https://www.qxorm.com/
4** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)
5**
6** This file is part of the QxOrm library
7**
8** This software is provided 'as-is', without any express or implied
9** warranty. In no event will the authors be held liable for any
10** damages arising from the use of this software
11**
12** Commercial Usage
13** Licensees holding valid commercial QxOrm licenses may use this file in
14** accordance with the commercial license agreement provided with the
15** Software or, alternatively, in accordance with the terms contained in
16** a written agreement between you and Lionel Marty
17**
18** GNU General Public License Usage
19** Alternatively, this file may be used under the terms of the GNU
20** General Public License version 3.0 as published by the Free Software
21** Foundation and appearing in the file 'license.gpl3.txt' included in the
22** packaging of this file. Please review the following information to
23** ensure the GNU General Public License version 3.0 requirements will be
24** met : http://www.gnu.org/copyleft/gpl.html
25**
26** If you are unsure which license is appropriate for your use, or
27** if you have questions regarding the use of this file, please contact :
28** contact@qxorm.com
29**
30****************************************************************************/
31
32#ifdef _QX_ENABLE_QT_NETWORK
33#ifndef _QX_SERVICE_H_
34#define _QX_SERVICE_H_
35
36#ifdef _MSC_VER
37#pragma once
38#endif
39
47#include <QxRegister/QxClass.h>
48
49#include <QxService/IxService.h>
50
51namespace qx {
52namespace service {
53
60template <class INPUT, class OUTPUT>
61class QxService : public IxService
62{
63
64protected:
65
66 enum { is_input_parameter = std::is_base_of<IxParameter, INPUT>::value };
67 enum { is_output_parameter = std::is_base_of<IxParameter, OUTPUT>::value };
71
72 typedef std::shared_ptr<INPUT> INPUT_ptr;
73 typedef std::shared_ptr<OUTPUT> OUTPUT_ptr;
74
75public:
76
77 QxService(const QString & sServiceName) : IxService(sServiceName) { static_assert(is_valid_parameter, "is_valid_parameter"); }
78 virtual ~QxService() { ; }
79
80 INPUT_ptr getInputParameter() const { return std::static_pointer_cast<INPUT>(m_pInputParameter); }
81 OUTPUT_ptr getOutputParameter() const { return std::static_pointer_cast<OUTPUT>(m_pOutputParameter); }
82
84
85};
86
87} // namespace service
88} // namespace qx
89
90#endif // _QX_SERVICE_H_
91#endif // _QX_ENABLE_QT_NETWORK
Common interface for all services defined with QxService module of QxOrm library.
Concrete class registered into QxOrm context.
qx::service::IxService : common interface for all services defined with QxService module of QxOrm lib...
Definition IxService.h:94
IxParameter_ptr m_pInputParameter
List of input parameters (request)
Definition IxService.h:110
IxParameter_ptr m_pOutputParameter
List of output parameters (reply)
Definition IxService.h:111
qx::service::QxService<INPUT, OUTPUT> : concrete service class with INPUT parameters and OUTPUT param...
Definition QxService.h:62
OUTPUT_ptr getOutputParameter() const
Definition QxService.h:81
virtual void registerClass() const
Definition QxService.h:83
std::shared_ptr< OUTPUT > OUTPUT_ptr
Definition QxService.h:73
INPUT_ptr getInputParameter() const
Definition QxService.h:80
std::shared_ptr< INPUT > INPUT_ptr
Definition QxService.h:72
QxService(const QString &sServiceName)
Definition QxService.h:77
Root namespace for all QxOrm library features.
qx::trait::is_qx_registered<T>::value : return true if T is registered into QxOrm context to provide ...