| 28 | SMILECOMPONENT_STATICS(cFunctionals) |
| 29 | |
| 30 | SMILECOMPONENT_REGCOMP(cFunctionals) |
| 31 | { |
| 32 | SMILECOMPONENT_REGCOMP_INIT |
| 33 | |
| 34 | scname = COMPONENT_NAME_CFUNCTIONALS; |
| 35 | sdescription = COMPONENT_DESCRIPTION_CFUNCTIONALS; |
| 36 | |
| 37 | // we inherit cWinToVecProcessor configType and extend it: |
| 38 | // use _compman to find cFunctionalXXXXX component types... |
| 39 | // add corresponding config sub-types to our config type here.... |
| 40 | SMILECOMPONENT_INHERIT_CONFIGTYPE("cWinToVecProcessor") |
| 41 | |
| 42 | char *funclist=NULL; |
| 43 | |
| 44 | SMILECOMPONENT_IFNOTREGAGAIN_BEGIN |
| 45 | |
| 46 | // we return rA=1 twice, to allow cFunctionalXXXX to register! |
| 47 | if (_iteration <= 2) { |
| 48 | rA=1; |
| 49 | SMILECOMPONENT_MAKEINFO(cFunctionals); |
| 50 | } |
| 51 | |
| 52 | if (_compman != NULL) { |
| 53 | |
| 54 | int nTp = _compman->getNtypes(); |
| 55 | int i,j=0; |
| 56 | for (i=0; i<nTp; i++) { |
| 57 | const char * tp = _compman->getComponentType(i,1); |
| 58 | if (tp!=NULL) { |
| 59 | if (!strncmp(tp,"cFunctional",11)&&strncmp(tp,COMPONENT_NAME_CFUNCTIONALS,COMPONENT_NAME_CFUNCTIONALS_LENGTH)) { |
| 60 | // find beginning "cFunctional" but not our own type (cFunctionals) |
| 61 | const char *fn = tp+11; |
| 62 | j++; |
| 63 | if (funclist != NULL) { |
| 64 | char * tmp = funclist; |
| 65 | funclist = myvprint("%s %i.\t%s \t\t%s\n",funclist,j,fn,_compman->getComponentDescr(i)); |
| 66 | free(tmp); |
| 67 | } else { |
| 68 | funclist = myvprint(" (#) \t(name) \t\t(description)\n %i.\t%s \t\t%s\n",j,fn,_compman->getComponentDescr(i)); |
| 69 | } |
| 70 | // add config type |
| 71 | char *x = myvprint("functional sub-config of type %s",tp); |
| 72 | ct->setField(fn,x,_confman->getTypeObj(tp),NO_ARRAY,DONT_FREE); |
| 73 | free(x); |
| 74 | } |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | } else { // cannot proceed without component manager! |
| 79 | rA=1; |
| 80 | SMILECOMPONENT_MAKEINFO(cFunctionals); |
| 81 | } |
| 82 | |
| 83 | char *x = myvprint("Array that defines the enabled functionals\n The following functionals are available (sub-components) (Attention: the names are case-SENSITIVE!):\n%s",funclist); |
| 84 | ct->setField("functionalsEnabled",x,(const char*)NULL, ARRAY_TYPE); |
| 85 | free(x); |
| 86 | free(funclist); |
| 87 |
nothing calls this directly
no test coverage detected