2 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
4 #include "bbstdVectorFilterString.h"
5 #include "bbstdPackage.h"
9 BBTK_ADD_BLACK_BOX_TO_PACKAGE(std,VectorFilterString)
10 BBTK_BLACK_BOX_IMPLEMENTATION(VectorFilterString,bbtk::AtomicBlackBox);
12 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
15 void VectorFilterString::ConnectionRepetitions( std::vector<std::string> vIn,std::vector<std::string> *vOut )
17 int i,size=vIn.size();
22 if (vIn[i].compare( vIn[itmp])==0)
27 vOut->push_back(std::to_string(acum));
31 vOut->push_back(std::to_string(acum));
34 void VectorFilterString::FilterByFindinIn0()
36 std::vector<std::string> vOut0;
37 std::vector<std::string> vOut1;
38 std::vector<std::string> vOut2;
39 std::vector<std::string> vOut3;
40 std::vector<std::string> vOut4;
41 std::vector<std::string> vOut5;
42 std::vector<std::string> vOut6;
43 std::vector<std::string> vOut7;
44 std::vector<std::string> vOut8;
45 std::vector<std::string> vOut9;
47 int i,size = bbGetInputIn0().size();
49 for (i=0; i<size; i++)
51 pos=bbGetInputIn0()[i].find( bbGetInputsk1());
54 vOut0.push_back( bbGetInputIn0()[i] );
55 if ( i < bbGetInputIn1().size() ) { vOut1.push_back( bbGetInputIn1()[i] ); }
56 if ( i < bbGetInputIn2().size() ) { vOut2.push_back( bbGetInputIn2()[i] ); }
57 if ( i < bbGetInputIn3().size() ) { vOut3.push_back( bbGetInputIn3()[i] ); }
58 if ( i < bbGetInputIn4().size() ) { vOut4.push_back( bbGetInputIn4()[i] ); }
59 if ( i < bbGetInputIn5().size() ) { vOut5.push_back( bbGetInputIn5()[i] ); }
60 if ( i < bbGetInputIn6().size() ) { vOut6.push_back( bbGetInputIn6()[i] ); }
61 if ( i < bbGetInputIn7().size() ) { vOut7.push_back( bbGetInputIn7()[i] ); }
62 if ( i < bbGetInputIn8().size() ) { vOut8.push_back( bbGetInputIn8()[i] ); }
63 if ( i < bbGetInputIn9().size() ) { vOut9.push_back( bbGetInputIn9()[i] ); }
67 bbSetOutputOut0( vOut0 );
68 bbSetOutputOut1( vOut1 );
69 bbSetOutputOut2( vOut2 );
70 bbSetOutputOut3( vOut3 );
71 bbSetOutputOut4( vOut4 );
72 bbSetOutputOut5( vOut5 );
73 bbSetOutputOut6( vOut6 );
74 bbSetOutputOut7( vOut7 );
75 bbSetOutputOut8( vOut8 );
76 bbSetOutputOut9( vOut9 );
81 void VectorFilterString::Process()
84 // THE MAIN PROCESSING METHOD BODY
85 // Here we simply set the input 'In' value to the output 'Out'
86 // And print out the output value
87 // INPUT/OUTPUT ACCESSORS ARE OF THE FORM :
88 // void bbSet{Input|Output}NAME(const TYPE&)
89 // const TYPE& bbGet{Input|Output}NAME() const
91 // * NAME is the name of the input/output
92 // (the one provided in the attribute 'name' of the tag 'input')
93 // * TYPE is the C++ type of the input/output
94 // (the one provided in the attribute 'type' of the tag 'input')
96 // bbSetOutputOut( bbGetInputIn() );
97 // std::cout << "Output value = " <<bbGetOutputOut() << std::endl;
99 if (bbGetInputType()==0)
101 std::vector<std::string> vOut0;
102 std::vector<std::string> vOut1;
103 std::vector<std::string> vOut2;
104 std::vector<std::string> vOut3;
105 std::vector<std::string> vOut4;
106 std::vector<std::string> vOut5;
107 std::vector<std::string> vOut6;
108 std::vector<std::string> vOut7;
109 std::vector<std::string> vOut8;
110 std::vector<std::string> vOut9;
111 ConnectionRepetitions( bbGetInputIn0() , &vOut0 );
112 ConnectionRepetitions( bbGetInputIn1() , &vOut1 );
113 ConnectionRepetitions( bbGetInputIn2() , &vOut2 );
114 ConnectionRepetitions( bbGetInputIn3() , &vOut3 );
115 ConnectionRepetitions( bbGetInputIn4() , &vOut4 );
116 ConnectionRepetitions( bbGetInputIn5() , &vOut5 );
117 ConnectionRepetitions( bbGetInputIn6() , &vOut6 );
118 ConnectionRepetitions( bbGetInputIn7() , &vOut7 );
119 ConnectionRepetitions( bbGetInputIn8() , &vOut8 );
120 ConnectionRepetitions( bbGetInputIn9() , &vOut9 );
121 bbSetOutputOut0( vOut0 );
122 bbSetOutputOut1( vOut1 );
123 bbSetOutputOut2( vOut2 );
124 bbSetOutputOut3( vOut3 );
125 bbSetOutputOut4( vOut4 );
126 bbSetOutputOut5( vOut5 );
127 bbSetOutputOut6( vOut6 );
128 bbSetOutputOut7( vOut7 );
129 bbSetOutputOut8( vOut8 );
130 bbSetOutputOut9( vOut9 );
134 if (bbGetInputType()==2)
141 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
143 void VectorFilterString::bbUserSetDefaultValues()
146 // SET HERE THE DEFAULT INPUT/OUTPUT VALUES OF YOUR BOX
147 // Here we initialize the input 'In' to 0
153 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
155 void VectorFilterString::bbUserInitializeProcessing()
158 // THE INITIALIZATION METHOD BODY :
160 // but this is where you should allocate the internal/output pointers
166 // Before editing this file, make sure it's a file of your own (i.e.: it wasn't generated from xml description; if so : your modifications will be lost)
168 void VectorFilterString::bbUserFinalizeProcessing()
171 // THE FINALIZATION METHOD BODY :
173 // but this is where you should desallocate the internal/output pointers
178 // EO namespace bbstd