Timetabler
segment.h
Go to the documentation of this file.
1 
3 #ifndef SEGMENT_H
4 #define SEGMENT_H
5 
6 #include <string>
7 #include "fields/field.h"
8 #include "global.h"
9 
13 class Segment : public Field{
14 private:
18  int startSegment;
22  int endSegment;
23 public:
24  Segment(int, int);
25  bool operator==(const Segment &other);
26  int length();
27  bool isIntersecting(const Segment &other);
29  std::string getName();
30  std::string getTypeName();
31 };
32 
33 #endif
FieldType getType()
Gets the type under the FieldType enum.
Definition: segment.cpp:68
Class for a field.
Definition: field.h:14
bool isIntersecting(const Segment &other)
Determines if two Segments are intersecting. Two segments are said to be intersecting if they contain...
Definition: segment.cpp:53
bool operator==(const Segment &other)
Checks if two segment objects are identical, which is if their start and end segments are identical...
Definition: segment.cpp:28
int length()
Gets the length of the Segment, which is the number of segment units it represents. For example, the length of the Segment 16 is 6.
Definition: segment.cpp:39
Segment(int, int)
Constructs the Segment object.
Definition: segment.cpp:14
std::string getTypeName()
Gets the type name, which is "Segment".
Definition: segment.cpp:88
FieldType
Enum that represents all the field types.
Definition: global.h:10
std::string getName()
Gets the name of the Segment. The name is a string that concatenates the start and end segment values...
Definition: segment.cpp:79
Class for segment.
Definition: segment.h:13