This is my header file:
/**
* Job.h
*
**/
#ifndef JOB_
#define JOB_
#include <map>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <iomanip>
#include <vector>
class Job {
private:
int resourceId;
int inputRepresentation;
int outputRepresentation;
//Effects associative array
//Maps an effect to a map of it's attributes
//effectsMap[effect][attribute]=value
map< std::string, map<std::string, int> > *effectsMap;
public:
//constructors
Job();
Job(int resId, int inputRep, int outputRep);
//destructor
virtual ~Job();
//getters
int getInputRepresentation() const;
int getOutputRepresentation() const;
int getResourceId() const;
//setters
void setInputRepresentation(int inputRepresentation);
void setOutputRepresentation(int outputRepresentation);
void setResourceId(int resourceId);
void setRepresentations(std::map *rep);
void addEffect(std::string effect, map<std::string, int> attributesMap);
};
#endif
Now Ii will get to the point:
void setRepresentations(std::map *rep)
Gives the following error: “map is not a type”
This is weird because it looks like eclipse manages to properly link to the stl library…
And I do have a private field of map that seems to be fine.
Any ideas?
You need to specify the full type of the map, including the types inside the
< >: Something like: