CLAM-Development
1.4.0
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
Processing
Transformations
SMS
SMSTransformationChainConfig.hxx
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2004 MUSIC TECHNOLOGY GROUP (MTG)
3
* UNIVERSITAT POMPEU FABRA
4
*
5
*
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
10
*
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
15
*
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
*
20
*/
21
22
#ifndef _SMSTransformationChainConfig_
23
#define _SMSTransformationChainConfig_
24
25
#include "
ProcessingComposite.hxx
"
26
#include "
ProcessingData.hxx
"
27
#include "
InPort.hxx
"
28
#include "
OutPort.hxx
"
29
#include "
InControlArray.hxx
"
30
#include "
Array.hxx
"
31
32
#include "
Frame.hxx
"
//TODO provisional
33
#include "
SegmentTransformation.hxx
"
//TODO provisional
34
35
namespace
CLAM{
36
37
43
class
SMSTransformationChaineeConfig
:
public
ProcessingConfig
44
{
45
public
:
46
DYNAMIC_TYPE_USING_INTERFACE
(
SMSTransformationChaineeConfig
, 1,
ProcessingConfig
);
48
DYN_ATTRIBUTE
(0,
public
, std::string, ConcreteClassName);
49
public
:
53
void
DefaultInit
();
57
void
CopyInit
(
const
SMSTransformationChaineeConfig
& originalConfig);
61
void
StoreOn
(
Storage
& s)
const
;
65
void
LoadFrom
(
Storage
& s);
67
ProcessingConfig
&
GetConcreteConfig
()
const
{
return
*
mpConcreteConfig
;}
72
void
SetConcreteConfig
(
const
ProcessingConfig
& cfg)
73
{
74
AddConcreteConfig
();
75
*
mpConcreteConfig
=cfg;
76
}
77
79
virtual
~SMSTransformationChaineeConfig
();
80
85
void
AddConcreteConfig
()
86
{
87
if
(
mpConcreteConfig
)
88
delete
mpConcreteConfig
;
89
mpConcreteConfig
=
InstantiateConcreteConfig
();
90
}
91
92
93
protected
:
95
ProcessingConfig
*
InstantiateConcreteConfig
(
const
std::string& type);
96
100
ProcessingConfig
*
InstantiateConcreteConfig
()
101
{
102
return
InstantiateConcreteConfig
(GetConcreteClassName());
103
}
104
108
ProcessingConfig
*
mpConcreteConfig
;
109
110
};
111
112
118
class
SMSTransformationChainConfig
:
public
ProcessingConfig
119
{
120
public
:
121
typedef
std::list<SMSTransformationChaineeConfig>::iterator
iterator
;
122
typedef
std::list<SMSTransformationChaineeConfig>::const_iterator
const_iterator
;
123
124
DYNAMIC_TYPE_USING_INTERFACE
(
SMSTransformationChainConfig
, 2,
ProcessingConfig
);
126
DYN_CONTAINER_ATTRIBUTE
(0,
public
, std::list<SMSTransformationChaineeConfig>, Configurations, Config);
128
DYN_ATTRIBUTE
(1,
public
,
Array<bool>
, OnArray);
129
130
132
void
DefaultInit
();
134
iterator
ConfigList_begin
() {
return
GetConfigurations().begin();}
136
iterator
ConfigList_end
() {
return
GetConfigurations().end();}
137
139
const_iterator
ConfigList_begin_const
()
const
{
return
GetConfigurations().begin();}
141
const_iterator
ConfigList_end_const
()
const
{
return
GetConfigurations().end();}
142
143
bool
AddSMSConfiguration
(
const
SegmentTransformationConfig
& cfg,std::string type)
144
{
145
AddConfiguration
(cfg,type);
146
return
true
;
147
}
148
150
std::size_t
ConfigList_size
()
const
{
return
GetConfigurations().size();}
151
152
//TODO: maybe a method for deleting a configuration is also necessary
153
155
bool
IsEmpty
(){
return
GetnConfigurations
()<=0;}
157
TSize
GetnConfigurations
(){
return
ConfigList_size
();}
158
160
virtual
~SMSTransformationChainConfig
(){}
161
protected
:
163
virtual
void
AddConfiguration
(
const
ProcessingConfig
& newConcreteConfig,
const
std::string& className);
164
165
};
166
167
}
//namespace
168
169
#endif
170
Generated by
1.8.1