libmoldeo (Moldeo 1.0 Core)
1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
moPreConfig.cpp
Go to the documentation of this file.
1
/*******************************************************************************
2
3
moPreConfig.cpp
4
5
****************************************************************************
6
* *
7
* This source is free software; you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation; either version 2 of the License, or *
10
* (at your option) any later version. *
11
* *
12
* This code is distributed in the hope that it will be useful, but *
13
* WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15
* General Public License for more details. *
16
* *
17
* A copy of the GNU General Public License is available on the World *
18
* Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19
* obtain it by writing to the Free Software Foundation, *
20
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21
* *
22
****************************************************************************
23
24
Copyright(C) 2006 Fabricio Costa
25
26
Authors:
27
Fabricio Costa
28
29
30
*******************************************************************************/
31
32
#include "
moPreConfig.h
"
33
34
#include "
moArray.h
"
35
moDefineDynamicArray
( moPreConfigs )
36
moDefineDynamicArray
( moPreconfigIndexes )
37
38
/*
39
moPreconfigParamIndex::moPreconfigParamIndex() {
40
m_ParamName = "";
41
m_ParamIndex = -1;
42
m_ValueIndex = -1;
43
}
44
*/
45
/*
46
moPreconfigParamIndex::~moPreconfigParamIndex() {
47
//nothing
48
m_ParamName = "";
49
m_ParamIndex = -1;
50
m_ValueIndex = -1;
51
}
52
*/
53
58
moPreConfig
::
moPreConfig
() {
59
}
60
61
moPreConfig::~moPreConfig
()
62
{
63
Finish
();
64
}
65
66
67
68
moPreConfig
&
69
moPreConfig::operator =
(
const
moPreConfig
& preconf) {
70
71
//m_ValueIndexes = preconf.m_ValueIndexes;
72
m_PreconfIndexes
= preconf.
m_PreconfIndexes
;
73
m_Name
= preconf.
m_Name
;
74
return
(*
this
);
75
}
76
77
moPreConfig::moPreConfig
( moPreconfigIndexes& preconfindexes ) {
78
m_PreconfIndexes
= preconfindexes;
79
/*
80
m_ValueIndexes.Empty();
81
for( MOuint i=0; i<m_PreconfIndexes.Count(); i++ ) {
82
83
moValueIndex PIndex;
84
PIndex.m_ParamIndex = m_PreconfIndexes[i].m_ParamIndex;
85
PIndex.m_ValueIndex = m_PreconfIndexes[i].m_ValueIndex;
86
87
m_ValueIndexes.Add( PIndex );
88
}
89
*/
90
}
91
/*
92
moPreConfig::moPreConfig( moValueIndexes& valueindexes ) {
93
m_ValueIndexes = valueindexes;
94
m_PreconfIndexes.Empty();
95
for( MOuint i=0; i<m_PreconfIndexes.Count(); i++ ) {
96
97
moPreconfigParamIndex PIndex;
98
PIndex.m_ParamIndex = m_ValueIndexes[i].m_ParamIndex;
99
PIndex.m_ValueIndex = m_ValueIndexes[i].m_ValueIndex;
100
101
m_PreconfIndexes.Add( PIndex );
102
}
103
}
104
*/
105
106
MOboolean
107
moPreConfig::Init
() {
108
109
return
true
;
110
}
111
112
113
MOboolean
114
moPreConfig::Finish
() {
115
//m_ValueIndexes.Empty();
116
m_PreconfIndexes
.Empty();
117
return
true
;
118
}
119
120
121
moPreconfigParamIndex
122
moPreConfig::operator []
(
MOint
paramindex) {
123
moPreconfigParamIndex
vindex;
124
if
( 0<=paramindex && paramindex< (
MOint
) this->
m_PreconfIndexes
.Count() ) {
125
vindex = this->
m_PreconfIndexes
[paramindex];
126
}
127
return
vindex;
128
}
129
130
const
moText
&
131
moPreConfig::ToJSON
() {
132
133
moText
fieldseparation =
","
;
134
m_FullJSON =
"{ 'name': '"
+
m_Name
+
"'"
;
135
m_FullJSON+= fieldseparation
136
+
"'vidx': {"
;
137
fieldseparation =
""
;
138
for
(
int
vi = 0; vi< (int)
m_PreconfIndexes
.Count(); vi++ ) {
139
140
moPreconfigParamIndex
vindex =
m_PreconfIndexes
[vi];
141
142
m_FullJSON+= fieldseparation
143
+
"'"
+ vindex.
m_ParamName
+
"': {"
;
144
fieldseparation =
","
;
145
146
m_FullJSON+=
"'pid': "
+
IntToStr
(vindex.
m_ParamIndex
);
147
m_FullJSON+= fieldseparation +
"'vid': "
+
IntToStr
(vindex.
m_ValueIndex
);
148
m_FullJSON+=
"}"
;
149
}
150
m_FullJSON+=
"}"
;
151
m_FullJSON+=
"}"
;
152
return
m_FullJSON;
153
}
154
155
moPreConfig::Finish
virtual MOboolean Finish()
Definition:
moPreConfig.cpp:114
moPreconfigParamIndex::m_ParamIndex
MOint m_ParamIndex
Definition:
moPreConfig.h:66
moArray.h
moPreconfigParamIndex::m_ValueIndex
MOint m_ValueIndex
Definition:
moPreConfig.h:67
MOboolean
#define MOboolean
Definition:
moTypes.h:385
moPreconfigParamIndex::m_ParamName
moText m_ParamName
Definition:
moPreConfig.h:65
moPreconfigParamIndex
Definition:
moPreConfig.h:38
moText0
clase de para manejar textos
Definition:
moText.h:75
moDefineDynamicArray
moDefineDynamicArray(moPreConfigs) moDefineDynamicArray(moPreconfigIndexes) moPreConfig
Definition:
moPreConfig.cpp:35
moPreConfig::~moPreConfig
virtual ~moPreConfig()
Definition:
moPreConfig.cpp:61
moPreConfig::operator=
moPreConfig & operator=(const moPreConfig &preconf)
Definition:
moPreConfig.cpp:69
MOint
#define MOint
Definition:
moTypes.h:388
moPreConfig::m_Name
moText m_Name
Definition:
moPreConfig.h:90
moPreConfig::Init
virtual MOboolean Init()
Definition:
moPreConfig.cpp:107
moPreConfig.h
moPreConfig
Definition:
moPreConfig.h:72
moPreConfig::moPreConfig
moPreConfig()
moPreConfig::ToJSON
const moText & ToJSON()
Definition:
moPreConfig.cpp:131
moPreConfig::m_PreconfIndexes
moPreconfigIndexes m_PreconfIndexes
Definition:
moPreConfig.h:92
IntToStr
LIBMOLDEO_API moText0 IntToStr(int a)
Definition:
moText.cpp:1070
moPreConfig::operator[]
moPreconfigParamIndex operator[](MOint paramindex)
Definition:
moPreConfig.cpp:122
libmoldeo
moPreConfig.cpp
Generated on Wed May 17 2017 14:09:19 for libmoldeo (Moldeo 1.0 Core) by
1.8.8