summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorBrett Stottlemyer <bstottle@ford.com>2015-03-19 18:25:18 -0400
committerBrett Stottlemyer <bstottle@ford.com>2015-03-20 17:47:01 +0000
commitfec9ebc2b40f7ae77ac8d8103b311308c0b65569 (patch)
treeb850ef1828845723f3e4da9dd98e2cc3a3c0bfe6 /examples
parent074e88bd8c28dc43e8f845fee82aa4c925073386 (diff)
Introduce documentation
Adding high-level documentation for Remote Objects Change-Id: I69a41476aa4290cf22214ab3079928a81a08b313 Reviewed-by: Björn Breitmeyer <bjoern.breitmeyer@kdab.com> Reviewed-by: Manpreet Bajwa <mbajwa3@ford.com> Reviewed-by: Brett Stottlemyer <bstottle@ford.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/RemoteObjects/RemoteObjects.pro3
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectClient/DirectConnectClient.pro21
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectClient/SimpleSwitch.rep7
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.cpp76
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.h69
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectClient/main.cpp60
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/DirectConnectDynamicClient.pro16
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.cpp76
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.h71
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/main.cpp60
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectServer/DirectConnectServer.pro19
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectServer/main.cpp55
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectServer/simpleswitch.cpp74
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectServer/simpleswitch.h60
-rw-r--r--examples/RemoteObjects/SimpleSwitch/DirectConnectServer/simpleswitch.rep7
-rw-r--r--examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/RegistryConnectedClient.pro22
-rw-r--r--examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.cpp76
-rw-r--r--examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.h71
-rw-r--r--examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/main.cpp58
-rw-r--r--examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/RegistryConnectedServer.pro25
-rw-r--r--examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/SimpleSwitch.rep8
-rw-r--r--examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/main.cpp61
-rw-r--r--examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/simpleswitch.cpp74
-rw-r--r--examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/simpleswitch.h60
-rw-r--r--examples/RemoteObjects/SimpleSwitch/SimpleSwitch.pro8
25 files changed, 1136 insertions, 1 deletions
diff --git a/examples/RemoteObjects/RemoteObjects.pro b/examples/RemoteObjects/RemoteObjects.pro
index 803048c..35dc2d7 100644
--- a/examples/RemoteObjects/RemoteObjects.pro
+++ b/examples/RemoteObjects/RemoteObjects.pro
@@ -4,7 +4,8 @@ SUBDIRS = \
server \
CppClient \
ModelViewClient \
- ModelViewServer
+ ModelViewServer \
+ SimpleSwitch
qtHaveModule(quick) {
SUBDIRS += \
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/DirectConnectClient.pro b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/DirectConnectClient.pro
new file mode 100644
index 0000000..9c8a805
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/DirectConnectClient.pro
@@ -0,0 +1,21 @@
+QT += remoteobjects core
+
+QT -= gui
+
+TARGET = DirectConnectClient
+CONFIG += console
+CONFIG -= app_bundle
+
+REPC_REPLICA = simpleswitch.rep
+
+TEMPLATE = app
+
+
+SOURCES += main.cpp \
+ client.cpp
+
+HEADERS += \
+ client.h
+
+DISTFILES += \
+ SimpleSwitch.rep
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/SimpleSwitch.rep b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/SimpleSwitch.rep
new file mode 100644
index 0000000..b2d7cd2
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/SimpleSwitch.rep
@@ -0,0 +1,7 @@
+#include <QtCore>
+
+class SimpleSwitch
+{
+ PROP(bool currState=false);
+ SLOT(void server_slot(bool clientState));
+};
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.cpp b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.cpp
new file mode 100644
index 0000000..971d4fa
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.cpp
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "client.h"
+
+// constructor
+Client::Client(QSharedPointer<SimpleSwitchReplica> ptr) :
+ QObject(Q_NULLPTR), reptr(ptr)
+{
+ //connect signal for replica initialized with initialization slot
+ initConnections();
+ // We can connect to SimpleSwitchReplica signals/slots
+ //directly because our Replica was generated by repc
+}
+
+//destructor
+Client::~Client()
+{
+
+}
+
+
+void Client::initConnections(void)
+{
+ // initialize connections between signals and slots
+
+ // connect source replica signal currStateChanged() with client's recSwitchState() slot to receive source's current state
+ QObject::connect(reptr.data(), SIGNAL(currStateChanged()), this, SLOT(recSwitchState_slot()));
+ // connect client's echoSwitchState(..) signal with replica's server_slot(..) to echo back received state
+ QObject::connect(this, SIGNAL(echoSwitchState(bool)),reptr.data(), SLOT(server_slot(bool)));
+}
+
+void Client::recSwitchState_slot()
+{
+ qDebug() << "Received source state "<<reptr.data()->currState();
+ clientSwitchState = reptr.data()->currState();
+ Q_EMIT echoSwitchState(clientSwitchState); // Emit signal to echo received state back to server
+}
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.h b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.h
new file mode 100644
index 0000000..0d81d95
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/client.h
@@ -0,0 +1,69 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef _CLIENT_H
+#define _CLIENT_H
+
+#include <QObject>
+#include <QSharedPointer>
+
+#include "rep_SimpleSwitch_replica.h"
+
+class Client : public QObject
+{
+ Q_OBJECT
+public:
+ Client(QSharedPointer<SimpleSwitchReplica> ptr);
+ ~Client();
+ void initConnections();// function connect signals and slots of source and client
+
+Q_SIGNALS:
+ void echoSwitchState(bool switchState);// this signal is connected with server_slot(..) on the source object and echoes back switch state received from source
+
+public Q_SLOTS:
+ void recSwitchState_slot(); // slot to receive source state
+private:
+ bool clientSwitchState; // holds received server switch state
+ QSharedPointer<SimpleSwitchReplica> reptr;// holds reference to replica
+
+ };
+
+#endif
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/main.cpp b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/main.cpp
new file mode 100644
index 0000000..e72ee1b
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectClient/main.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QCoreApplication>
+#include "client.h"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+
+
+ QSharedPointer<SimpleSwitchReplica> ptr;
+
+ QRemoteObjectNode repNode = QRemoteObjectNode(); // create remote object node
+ repNode.connect(); // connect with remote host node
+
+ ptr.reset(repNode.acquire<SimpleSwitchReplica>()); // acquire replica of source from host node
+
+ Client rswitch(ptr); // create client switch object and pass reference of replica to it
+
+ return a.exec();
+}
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/DirectConnectDynamicClient.pro b/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/DirectConnectDynamicClient.pro
new file mode 100644
index 0000000..0cffb94
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/DirectConnectDynamicClient.pro
@@ -0,0 +1,16 @@
+QT += remoteobjects core
+
+QT -= gui
+
+TARGET = DirectConnectDynamicClient
+CONFIG += console
+CONFIG -= app_bundle
+
+TEMPLATE = app
+
+
+SOURCES += main.cpp \
+ dynamicclient.cpp
+
+HEADERS += \
+ dynamicclient.h
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.cpp b/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.cpp
new file mode 100644
index 0000000..3bc6f30
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.cpp
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "dynamicclient.h"
+ #include <QMetaMethod>
+
+// constructor
+DynamicClient::DynamicClient(QSharedPointer<QRemoteObjectDynamicReplica> ptr) :
+ QObject(Q_NULLPTR), reptr(ptr)
+{
+ //connect signal for replica valid changed with signal slot initialization
+ QObject::connect(reptr.data(), SIGNAL(initialized()), this, SLOT(initConnection_slot()));
+}
+
+//destructor
+DynamicClient::~DynamicClient()
+{
+
+}
+
+// Function to initialize connections between slots and signals
+void DynamicClient::initConnection_slot()
+{
+
+ // connect source replica signal currStateChanged() with client's recSwitchState() slot to receive source's current state
+ QObject::connect(reptr.data(), SIGNAL(currStateChanged()), this, SLOT(recSwitchState_slot()));
+ // connect client's echoSwitchState(..) signal with replica's server_slot(..) to echo back received state
+ QObject::connect(this, SIGNAL(echoSwitchState(bool)),reptr.data(), SLOT(server_slot(bool)));
+}
+
+
+void DynamicClient::recSwitchState_slot()
+{
+ clientSwitchState = reptr->property("currState").toBool(); // use replica property to get "currState" from source
+ qDebug() << "Received source state " << clientSwitchState;
+ Q_EMIT echoSwitchState(clientSwitchState); // Emit signal to echo received state back to server
+}
+
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.h b/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.h
new file mode 100644
index 0000000..88f2d4d
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/dynamicclient.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef _DYNAMICCLIENT_H
+#define _DYNAMICCLIENT_H
+
+#include <QObject>
+#include <QSharedPointer>
+
+#include <QRemoteObjectNode>
+#include <qremoteobjectdynamicreplica.h>
+
+class DynamicClient : public QObject
+{
+ Q_OBJECT
+public:
+ DynamicClient(QSharedPointer<QRemoteObjectDynamicReplica> ptr);
+ ~DynamicClient();
+
+Q_SIGNALS:
+ void echoSwitchState(bool switchState);// this signal is connected with server_slot(..) slot of source object and echoes back switch state received from source
+
+public Q_SLOTS:
+ void recSwitchState_slot(); // slot to receive source state
+ void initConnection_slot();
+
+private:
+ bool clientSwitchState; // holds received server switch state
+ QSharedPointer<QRemoteObjectDynamicReplica> reptr;// holds reference to replica
+ };
+
+#endif
+
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/main.cpp b/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/main.cpp
new file mode 100644
index 0000000..9c1cf3a
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectDynamicClient/main.cpp
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QCoreApplication>
+
+#include "dynamicclient.h"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+
+ QSharedPointer<QRemoteObjectDynamicReplica> ptr; // shared pointer to hold replica
+
+ QRemoteObjectNode repNode = QRemoteObjectNode(); // create remote object node
+ repNode.connect(); // connect with remote host node
+
+ ptr.reset(repNode.acquire("SimpleSwitch")); // acquire replica of source from host node
+
+ DynamicClient rswitch(ptr); // create client switch object and pass replica reference to it
+
+ return a.exec();
+}
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/DirectConnectServer.pro b/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/DirectConnectServer.pro
new file mode 100644
index 0000000..8433600
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/DirectConnectServer.pro
@@ -0,0 +1,19 @@
+QT += remoteobjects core
+
+QT -= gui
+
+TARGET = DirectConnectServer
+CONFIG += console
+CONFIG -= app_bundle
+
+REPC_SOURCE = simpleswitch.rep
+
+TEMPLATE = app
+
+
+SOURCES += main.cpp \
+ simpleswitch.cpp
+
+
+HEADERS += \
+ simpleswitch.h
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/main.cpp b/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/main.cpp
new file mode 100644
index 0000000..a2de4b2
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/main.cpp
@@ -0,0 +1,55 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QCoreApplication>
+#include "simpleswitch.h"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+
+ SimpleSwitch srcSwitch; // create simple switch
+
+ QRemoteObjectNode srcNode = QRemoteObjectNode::createHostNode(); // create host node without Regsitry
+ srcNode.enableRemoting(&srcSwitch); // enable remoting/Sharing
+
+ return a.exec();
+}
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/simpleswitch.cpp b/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/simpleswitch.cpp
new file mode 100644
index 0000000..60eeae1
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/simpleswitch.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "simpleswitch.h"
+
+// constructor
+SimpleSwitch::SimpleSwitch(QObject *parent) : SimpleSwitchSimpleSource(parent)
+{
+ stateChangeTimer = new QTimer(this); // Initialize timer
+ QObject::connect(stateChangeTimer, SIGNAL(timeout()), this, SLOT(timeout_slot())); // connect timeout() signal from stateChangeTimer to timeout_slot() of simpleSwitch
+ stateChangeTimer->start(2000); // Start timer and set timout to 2 seconds
+ qDebug() << "Source Node Started";
+}
+
+//destructor
+SimpleSwitch::~SimpleSwitch()
+{
+ stateChangeTimer->stop();
+}
+
+void SimpleSwitch::server_slot(bool clientState)
+{
+ qDebug() << "Replica state is " << clientState; // print switch state echoed back by client
+}
+
+void SimpleSwitch::timeout_slot(void)
+{
+ // slot called on timer timeout
+ if (currState()) // check if current state is true, currState() is defined in repc generated rep_SimpleSwitch_source.h
+ setCurrState(false); // set state to false
+ else
+ setCurrState(true); // set state to true
+ qDebug() << "Source State is "<<currState();
+
+}
+
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/simpleswitch.h b/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/simpleswitch.h
new file mode 100644
index 0000000..40193da
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/simpleswitch.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SIMPLESWITCH_H
+#define SIMPLESWITCH_H
+
+#include "rep_simpleswitch_source.h"
+
+class SimpleSwitch : public SimpleSwitchSimpleSource
+{
+ Q_OBJECT
+public:
+ SimpleSwitch(QObject *parent=Q_NULLPTR);
+ ~SimpleSwitch();
+ virtual void server_slot(bool clientState);
+public Q_SLOTS:
+ void timeout_slot();
+private:
+ QTimer *stateChangeTimer;
+};
+
+#endif
diff --git a/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/simpleswitch.rep b/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/simpleswitch.rep
new file mode 100644
index 0000000..b2d7cd2
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/DirectConnectServer/simpleswitch.rep
@@ -0,0 +1,7 @@
+#include <QtCore>
+
+class SimpleSwitch
+{
+ PROP(bool currState=false);
+ SLOT(void server_slot(bool clientState));
+};
diff --git a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/RegistryConnectedClient.pro b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/RegistryConnectedClient.pro
new file mode 100644
index 0000000..fc719f5
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/RegistryConnectedClient.pro
@@ -0,0 +1,22 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2015-02-13T15:22:50
+#
+#-------------------------------------------------
+
+QT += remoteobjects core
+
+QT -= gui
+
+TARGET = RegistryConnectedClient
+CONFIG += console
+CONFIG -= app_bundle
+
+TEMPLATE = app
+
+
+SOURCES += main.cpp \
+ dynamicclient.cpp
+
+HEADERS += \
+ dynamicclient.h
diff --git a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.cpp b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.cpp
new file mode 100644
index 0000000..3bc6f30
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.cpp
@@ -0,0 +1,76 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "dynamicclient.h"
+ #include <QMetaMethod>
+
+// constructor
+DynamicClient::DynamicClient(QSharedPointer<QRemoteObjectDynamicReplica> ptr) :
+ QObject(Q_NULLPTR), reptr(ptr)
+{
+ //connect signal for replica valid changed with signal slot initialization
+ QObject::connect(reptr.data(), SIGNAL(initialized()), this, SLOT(initConnection_slot()));
+}
+
+//destructor
+DynamicClient::~DynamicClient()
+{
+
+}
+
+// Function to initialize connections between slots and signals
+void DynamicClient::initConnection_slot()
+{
+
+ // connect source replica signal currStateChanged() with client's recSwitchState() slot to receive source's current state
+ QObject::connect(reptr.data(), SIGNAL(currStateChanged()), this, SLOT(recSwitchState_slot()));
+ // connect client's echoSwitchState(..) signal with replica's server_slot(..) to echo back received state
+ QObject::connect(this, SIGNAL(echoSwitchState(bool)),reptr.data(), SLOT(server_slot(bool)));
+}
+
+
+void DynamicClient::recSwitchState_slot()
+{
+ clientSwitchState = reptr->property("currState").toBool(); // use replica property to get "currState" from source
+ qDebug() << "Received source state " << clientSwitchState;
+ Q_EMIT echoSwitchState(clientSwitchState); // Emit signal to echo received state back to server
+}
+
diff --git a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.h b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.h
new file mode 100644
index 0000000..88f2d4d
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/dynamicclient.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef _DYNAMICCLIENT_H
+#define _DYNAMICCLIENT_H
+
+#include <QObject>
+#include <QSharedPointer>
+
+#include <QRemoteObjectNode>
+#include <qremoteobjectdynamicreplica.h>
+
+class DynamicClient : public QObject
+{
+ Q_OBJECT
+public:
+ DynamicClient(QSharedPointer<QRemoteObjectDynamicReplica> ptr);
+ ~DynamicClient();
+
+Q_SIGNALS:
+ void echoSwitchState(bool switchState);// this signal is connected with server_slot(..) slot of source object and echoes back switch state received from source
+
+public Q_SLOTS:
+ void recSwitchState_slot(); // slot to receive source state
+ void initConnection_slot();
+
+private:
+ bool clientSwitchState; // holds received server switch state
+ QSharedPointer<QRemoteObjectDynamicReplica> reptr;// holds reference to replica
+ };
+
+#endif
+
diff --git a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/main.cpp b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/main.cpp
new file mode 100644
index 0000000..1f2fbe2
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedClient/main.cpp
@@ -0,0 +1,58 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QCoreApplication>
+#include "dynamicclient.h"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+
+ QSharedPointer<QRemoteObjectDynamicReplica> ptr; // shared pointer to hold replica
+
+ QRemoteObjectNode repNode = QRemoteObjectNode::createNodeConnectedToRegistry();
+
+ ptr.reset(repNode.acquire("SimpleSwitch")); // acquire replica of source from host node
+
+ DynamicClient rswitch(ptr); // create client switch object and pass replica reference to it
+
+ return a.exec();
+}
diff --git a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/RegistryConnectedServer.pro b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/RegistryConnectedServer.pro
new file mode 100644
index 0000000..a344f61
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/RegistryConnectedServer.pro
@@ -0,0 +1,25 @@
+#-------------------------------------------------
+#
+# Project created by QtCreator 2015-02-13T15:02:06
+#
+#-------------------------------------------------
+
+QT += remoteobjects core
+
+QT -= gui
+
+TARGET = RegistryConnectedServer
+CONFIG += console
+CONFIG -= app_bundle
+
+REPC_SOURCE = SimpleSwitch.rep
+
+
+TEMPLATE = app
+
+
+SOURCES += main.cpp \
+ simpleswitch.cpp
+
+HEADERS += \
+ simpleswitch.h
diff --git a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/SimpleSwitch.rep b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/SimpleSwitch.rep
new file mode 100644
index 0000000..4f7c9c7
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/SimpleSwitch.rep
@@ -0,0 +1,8 @@
+#include <QtCore>
+
+class SimpleSwitch
+{
+ PROP(bool currState=false);
+ SLOT(void server_slot(bool clientState));
+};
+
diff --git a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/main.cpp b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/main.cpp
new file mode 100644
index 0000000..03869de
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/main.cpp
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QCoreApplication>
+#include "simpleswitch.h"
+
+int main(int argc, char *argv[])
+{
+ QCoreApplication a(argc, argv);
+
+ SimpleSwitch srcSwitch; // create simple switch
+
+ QRemoteObjectNode regNode = QRemoteObjectNode::createRegistryHostNode(); // create node that hosts registy
+ QRemoteObjectNode srcNode = QRemoteObjectNode::createHostNodeConnectedToRegistry(); // create node that will host source and connect to registry
+
+ //Note, you can add srcSwitch directly to regNode if desired.
+ //We use two Nodes here, as the regNode could easily be in a third process.
+
+ srcNode.enableRemoting(&srcSwitch); // enable remoting of source object
+
+ return a.exec();
+}
+
diff --git a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/simpleswitch.cpp b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/simpleswitch.cpp
new file mode 100644
index 0000000..60eeae1
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/simpleswitch.cpp
@@ -0,0 +1,74 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "simpleswitch.h"
+
+// constructor
+SimpleSwitch::SimpleSwitch(QObject *parent) : SimpleSwitchSimpleSource(parent)
+{
+ stateChangeTimer = new QTimer(this); // Initialize timer
+ QObject::connect(stateChangeTimer, SIGNAL(timeout()), this, SLOT(timeout_slot())); // connect timeout() signal from stateChangeTimer to timeout_slot() of simpleSwitch
+ stateChangeTimer->start(2000); // Start timer and set timout to 2 seconds
+ qDebug() << "Source Node Started";
+}
+
+//destructor
+SimpleSwitch::~SimpleSwitch()
+{
+ stateChangeTimer->stop();
+}
+
+void SimpleSwitch::server_slot(bool clientState)
+{
+ qDebug() << "Replica state is " << clientState; // print switch state echoed back by client
+}
+
+void SimpleSwitch::timeout_slot(void)
+{
+ // slot called on timer timeout
+ if (currState()) // check if current state is true, currState() is defined in repc generated rep_SimpleSwitch_source.h
+ setCurrState(false); // set state to false
+ else
+ setCurrState(true); // set state to true
+ qDebug() << "Source State is "<<currState();
+
+}
+
diff --git a/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/simpleswitch.h b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/simpleswitch.h
new file mode 100644
index 0000000..73e6951
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/RegistryConnectedServer/simpleswitch.h
@@ -0,0 +1,60 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Ford Motor Company
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the examples of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef SIMPLESWITCH_H
+#define SIMPLESWITCH_H
+
+#include "rep_SimpleSwitch_source.h"
+
+class SimpleSwitch : public SimpleSwitchSimpleSource
+{
+ Q_OBJECT
+public:
+ SimpleSwitch(QObject *parent=Q_NULLPTR);
+ ~SimpleSwitch();
+ virtual void server_slot(bool clientState);
+public Q_SLOTS:
+ void timeout_slot();
+private:
+ QTimer *stateChangeTimer;
+};
+
+#endif
diff --git a/examples/RemoteObjects/SimpleSwitch/SimpleSwitch.pro b/examples/RemoteObjects/SimpleSwitch/SimpleSwitch.pro
new file mode 100644
index 0000000..80473cb
--- /dev/null
+++ b/examples/RemoteObjects/SimpleSwitch/SimpleSwitch.pro
@@ -0,0 +1,8 @@
+TEMPLATE = subdirs
+
+SUBDIRS += \
+ DirectConnectClient \
+ DirectConnectDynamicClient \
+ DirectConnectServer \
+ RegistryConnectedClient \
+ RegistryConnectedServer