libfaster API Documentation  Development Version
Super fast distributted computing
workerICreate.cpp
1 #include <iostream>
2 #include "workerFdd.h"
3 #include "workerFddGroup.h"
4 #include "worker.h"
5 
6 
7 
8 void faster::worker::createIFDD(unsigned long int id, fddType kType, fddType tType, size_t size){
9  workerFddBase * newFdd = new workerFdd(id, kType, tType, size);
10  fddList.insert(fddList.end(), newFdd);
11 }
12 
13 void faster::worker::createFDDGroup(unsigned long int id, fddType kType, std::vector<unsigned long int> & idV){
14  std::vector<workerFddBase *> members(idV.size(), NULL);
15 
16  for ( size_t i = 0; i < members.size(); ++i){
17  members[i] = fddList[idV[i]];;
18  }
19 
20  workerFddBase * newFdd;
21  switch(kType){
22  case Char:
23  newFdd = new workerFddGroup<char>(id, kType, members);
24  break;
25  case Int:
26  newFdd = new workerFddGroup<int>(id, kType, members);
27  break;
28  case LongInt:
29  newFdd = new workerFddGroup<long int>(id, kType, members);
30  break;
31  case Float:
32  newFdd = new workerFddGroup<float>(id, kType, members);
33  break;
34  case Double:
35  newFdd = new workerFddGroup<double>(id, kType, members);
36  break;
37  case String:
38  newFdd = new workerFddGroup<std::string>(id, kType, members);
39  break;
40  default:
41  std::cerr << " Error: could not identify FddGroup Key Type!\n";
42  break;
43  }
44  if (newFdd != NULL)
45  fddList.insert(fddList.end(), newFdd);
46 }
47 
48 
unsigned int fddType
Dataset type.
Definition: definitions.h:16