Go to the documentation of this file.00001
00021 #ifndef INTERFACE_LOCATION_H
00022 #define INTERFACE_LOCATION_H
00023
00024 #include "coordinates.h"
00025 #include <string>
00026 #include <vector>
00027 #include <iostream>
00028 using namespace std;
00029
00030 enum InterfacePosition {DONT_CARE, NORTH, NORTHEAST, EAST, SOUTHEAST, SOUTH, SOUTHWEST, WEST, NORTHWEST};
00031 const string NO_INTERFACE_DEFINED = "ANY_IF";
00032
00033 class InterfaceLocation {
00034
00035 private:
00036 string type;
00037 vector<string> expression;
00038 Coordinates location;
00039 InterfacePosition position;
00040
00041 public:
00042 InterfaceLocation(string n, Coordinates c, InterfacePosition pos = DONT_CARE) : type(n), location(c), position(pos) {
00043
00044 string remainingExpression(type);
00045 while(remainingExpression.find(" ") != string::npos) {
00046 size_t offset = remainingExpression.find(" ");
00047 expression.push_back(remainingExpression.substr(0, offset));
00048 remainingExpression.erase(0, offset + 1);
00049 }
00050
00051
00052 expression.push_back(remainingExpression);
00053 }
00054
00055 InterfaceLocation(vector<string> exp, Coordinates c, InterfacePosition pos = DONT_CARE) : expression(exp), location(c), position(pos) {
00056 type = "";
00057 }
00058
00059 vector<string> getInterfaceExpressionVector(void) const;
00060
00061 Coordinates getInterfaceLocation(void) const;
00062 InterfacePosition getInterfacePosition(void) const;
00063
00064 };
00065
00066 #endif