QxOrm  1.4.1
C++ Object Relational Mapping library
IxParameter.h
Go to the documentation of this file.
00001 /****************************************************************************
00002 **
00003 ** http://www.qxorm.com/
00004 ** Copyright (C) 2013 Lionel Marty (contact@qxorm.com)
00005 **
00006 ** This file is part of the QxOrm library
00007 **
00008 ** This software is provided 'as-is', without any express or implied
00009 ** warranty. In no event will the authors be held liable for any
00010 ** damages arising from the use of this software
00011 **
00012 ** Commercial Usage
00013 ** Licensees holding valid commercial QxOrm licenses may use this file in
00014 ** accordance with the commercial license agreement provided with the
00015 ** Software or, alternatively, in accordance with the terms contained in
00016 ** a written agreement between you and Lionel Marty
00017 **
00018 ** GNU General Public License Usage
00019 ** Alternatively, this file may be used under the terms of the GNU
00020 ** General Public License version 3.0 as published by the Free Software
00021 ** Foundation and appearing in the file 'license.gpl3.txt' included in the
00022 ** packaging of this file. Please review the following information to
00023 ** ensure the GNU General Public License version 3.0 requirements will be
00024 ** met : http://www.gnu.org/copyleft/gpl.html
00025 **
00026 ** If you are unsure which license is appropriate for your use, or
00027 ** if you have questions regarding the use of this file, please contact :
00028 ** contact@qxorm.com
00029 **
00030 ****************************************************************************/
00031 
00032 #ifdef _QX_ENABLE_QT_NETWORK
00033 #ifndef _IX_SERVICE_PARAMETER_H_
00034 #define _IX_SERVICE_PARAMETER_H_
00035 
00036 #ifdef _MSC_VER
00037 #pragma once
00038 #endif
00039 
00047 #include <QtCore/qdatastream.h>
00048 
00049 #include <QxRegister/QxRegisterInternalHelper.h>
00050 
00051 namespace qx {
00052 namespace service {
00053 class IxParameter;
00054 } // namespace service
00055 } // namespace qx
00056 
00057 QX_DLL_EXPORT QDataStream & operator<< (QDataStream & stream, const qx::service::IxParameter & t) BOOST_USED;
00058 QX_DLL_EXPORT QDataStream & operator>> (QDataStream & stream, qx::service::IxParameter & t) BOOST_USED;
00059 
00060 namespace qx {
00061 namespace service {
00062 
00069 class QX_DLL_EXPORT IxParameter
00070 {
00071 
00072    friend QDataStream & ::operator<< (QDataStream & stream, const qx::service::IxParameter & t);
00073    friend QDataStream & ::operator>> (QDataStream & stream, qx::service::IxParameter & t);
00074 
00075 public:
00076 
00077    IxParameter();
00078    virtual ~IxParameter();
00079 
00080    // Need to override these methods only if you are using 'qx::service::QxConnect::serialization_qt' type (based on QDataStream)
00081    // You can use QX_SERVICE_IX_PARAMETER_QDATASTREAM_HPP and QX_SERVICE_IX_PARAMETER_QDATASTREAM_CPP macro to override
00082    virtual void registerClass() const;
00083    virtual QString getClassName() const;
00084    virtual void save(QDataStream & stream) const;
00085    virtual void load(QDataStream & stream);
00086 
00087 };
00088 
00089 typedef qx_shared_ptr<IxParameter> IxParameter_ptr;
00090 
00091 } // namespace service
00092 } // namespace qx
00093 
00094 QX_REGISTER_INTERNAL_HELPER_HPP(QX_DLL_EXPORT, qx::service::IxParameter, 0)
00095 
00096 #define QX_SERVICE_IX_PARAMETER_QDATASTREAM_HPP(className) \
00097 public: \
00098 virtual void registerClass() const; \
00099 virtual QString getClassName() const; \
00100 virtual void save(QDataStream & stream) const; \
00101 virtual void load(QDataStream & stream);
00102 
00103 #define QX_SERVICE_IX_PARAMETER_QDATASTREAM_CPP(className) \
00104 void className::registerClass() const { qx::QxClass< className >::getSingleton(); } \
00105 QString className::getClassName() const { return #className; } \
00106 void className::save(QDataStream & stream) const { qx::QxSerializeRegistered< className >::save(stream, (* this)); } \
00107 void className::load(QDataStream & stream) { qx::QxSerializeRegistered< className >::load(stream, (* this)); }
00108 
00109 #endif // _IX_SERVICE_PARAMETER_H_
00110 #endif // _QX_ENABLE_QT_NETWORK