arcscontrollercomponent.h
1 /*
2  name: include/arcs/arcscontrollercomponent.h
3 
4  This file is part of ARCS - Augmented Reality Component System
5  (version 2-current), written by Jean-Yves Didier
6  for IBISC Laboratory (http://www.ibisc.univ-evry.fr)
7 
8  Copyright (C) 2013 Université d'Evry-Val d'Essonne
9 
10  This program is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 2 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program. If not, see <http://www.gnu.org/licenses/>.
22 
23 
24  Please send bugreports with examples or suggestions to
25  jean-yves.didier__at__ibisc.univ-evry.fr
26 */
27 
28 
29 #ifndef __ARCSCONTROLLERCOMPONENT_H__
30 #define __ARCSCONTROLLERCOMPONENT_H__
31 
32 #include <arcs/arcsabstractcomponent.h>
33 #include <arcs/arcsstatemachine.h>
34 #include <QMetaMethod>
35 
37 
46 {
47 public:
50 
51  virtual QStringList getSlots() { return ARCS::getMethodList(statemachine->metaObject(),QMetaMethod::Slot); }
52  virtual QStringList getSignals() { return ARCS::getMethodList(statemachine->metaObject(),QMetaMethod::Signal); }
53  virtual QString toString();
54  virtual bool parseString(QString s);
55 
57  ARCSStateMachine* getStateMachine() { return statemachine ; }
58 
59 
60 protected:
61 
62  virtual void getProxySlot(QString slot, ObjectList& obj, QStringList &proxySlot)
63  {
64  obj << statemachine ; proxySlot << slot;
65  }
66  virtual void getProxySignal(QString signal, ObjectList& obj, QStringList &proxySignal)
67  {
68  obj << statemachine ; proxySignal << signal;
69  }
70 
71  virtual bool genuineInstanciate();
72  virtual void genuineDestroy();
73 
74 private:
75  ARCSStateMachine* statemachine;
76 };
77 
78 
79 
80 #endif //__ARCSCONTROLLERCOMPONENT_H__
virtual void genuineDestroy()
This method should implement the destruction of the actual component.
virtual bool genuineInstanciate()
This method should implement the instanciation of the actual component.
Defines a controller component.
Class handling the generic description of a component.
ARCSStateMachine * getStateMachine()
QStringList getMethodList(const QMetaObject *object, QMetaMethod::MethodType type)
Helper method for components.
virtual QStringList getSignals()
Returns the names of the availables signals.
Class describing a state machine in order to control an application.
virtual bool parseString(QString s)
Defines a basic seralization mechanism.
virtual QStringList getSlots()
Returns the names of the available slots.
virtual QString toString()
Defines a basic seralization mechanism.
virtual void getProxySignal(QString signal, ObjectList &obj, QStringList &proxySignal)
Creates a proxy signal to interface a component to native ARCS components.
virtual void getProxySlot(QString slot, ObjectList &obj, QStringList &proxySlot)
Creates a proxy slot to interface a component to native ARCS components.