arcsnativecomponent.cpp
1 /*
2  name: lib/arcsnativecomponent.cpp
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 #include <arcs/arcsnativecomponent.h>
30 
31 #include <QStringList>
32 
33 
34 QObject* ARCSNativeComponent::father = new QObject();
35 
36 ARCSNativeComponent::ARCSNativeComponent(): ARCSAbstractComponent()
37 {
38  realObject = 0;
39  //setType(getName());
40 }
41 
42 ARCSNativeComponent::~ARCSNativeComponent()
43 {
44  if (realObject != 0)
45  destroy();
46 }
47 
48 
50 {
51  realObject = createObject(father);
52  return (realObject != NULL) ;
53 }
54 
55 
57 {
58  destroyObject(realObject);
59  realObject = 0;
60 }
61 
62 
64 {
65  return QString::null ;
66 }
67 
69 {
70  return true;
71 }
72 
74 {
75  QMetaObject mo = getDescription();
76  return ARCS::getMethodList(&mo,QMetaMethod::Slot);
77 }
78 
80 {
81  QMetaObject mo = getDescription();
82  return ARCS::getMethodList(&mo,QMetaMethod::Signal);
83 }
84 
void destroy()
Destroys the real component.
virtual QString toString()
Defines a basic seralization mechanism.
Class handling the generic description of a component.
QStringList getMethodList(const QMetaObject *object, QMetaMethod::MethodType type)
Helper method for components.
virtual QStringList getSignals()
Returns the names of the availables signals.
virtual bool genuineInstanciate()
This method should implement the instanciation of the actual component.
virtual void genuineDestroy()
This method should implement the destruction of the actual component.
virtual bool parseString(QString)
Defines a basic seralization mechanism.
virtual QStringList getSlots()
Returns the names of the available slots.