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 
24  public:
25  Segment(int, int);
26  bool operator==(const Segment &other);
27  int length();
28  bool isIntersecting(const Segment &other);
30  std::string getName();
31  std::string getTypeName();
32 };
33 
34 #endif
FieldType getType()
Gets the type under the FieldType enum.
Definition: segment.cpp:66
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:52
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:40
Segment(int, int)
Constructs the Segment object.
Definition: segment.cpp:14
std::string getTypeName()
Gets the type name, which is "Segment".
Definition: segment.cpp:84
FieldType
Enum that represents all the field types.
Definition: global.h:9
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:75
Class for segment.
Definition: segment.h:13