Rev 88 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
87 | rm5248 | 1 | #include <stdlib.h> |
2 | #include <string.h> |
||
3 | |||
4 | #include "trainrecord.h" |
||
5 | |||
91 | rm5248 | 6 | TrainRecord::TrainRecord( int key, const char* reporting_mark, uint32_t road_number, |
87 | rm5248 | 7 | const char* stock_type, uint16_t costi, const char* notesi ){ |
8 | if( reporting_mark != NULL ){ |
||
9 | reporting.assign( reporting_mark ); |
||
10 | } |
||
11 | road = road_number; |
||
12 | if( stock_type != NULL ){ |
||
13 | stock.assign( stock_type ); |
||
14 | } |
||
15 | cost = costi; |
||
16 | if( notesi != NULL ){ |
||
17 | notes.assign( notesi ); |
||
18 | } |
||
88 | rm5248 | 19 | this->key = key; |
87 | rm5248 | 20 | } |
21 | |||
22 | std::string TrainRecord::getReportingMark(){ |
||
23 | return reporting; |
||
24 | } |
||
25 | |||
26 | void TrainRecord::setReportingMark(std::string mark ){ |
||
27 | reporting.assign( mark ); |
||
28 | } |
||
29 | |||
91 | rm5248 | 30 | uint32_t TrainRecord::getRoadNumber(){ |
87 | rm5248 | 31 | return road; |
32 | } |
||
33 | |||
91 | rm5248 | 34 | void TrainRecord::setRoadNumber( uint32_t roadIn ){ |
87 | rm5248 | 35 | road = roadIn; |
36 | } |
||
37 | |||
38 | std::string TrainRecord::getStockType(){ |
||
39 | return stock; |
||
40 | } |
||
41 | |||
42 | void TrainRecord::setStockType( std::string stck ){ |
||
43 | stock.assign( stck ); |
||
44 | } |
||
45 | |||
46 | uint16_t TrainRecord::getCost(){ |
||
47 | return cost; |
||
48 | } |
||
49 | |||
50 | void TrainRecord::setCost( uint16_t costIn ){ |
||
51 | cost = costIn; |
||
52 | } |
||
53 | |||
54 | std::string TrainRecord::getNotes(){ |
||
55 | return notes; |
||
56 | } |
||
57 | |||
58 | void TrainRecord::setNotes( std::string notesIn ){ |
||
59 | notes.assign( notesIn ); |
||
60 | } |
||
88 | rm5248 | 61 | |
62 | int TrainRecord::getKey(){ |
||
63 | return key; |
||
64 | } |