Subversion Repositories Programming Utils

Rev

Rev 88 | Go to most recent revision | Details | 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
 
6
TrainRecord::TrainRecord( const char* reporting_mark, uint16_t road_number,
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
    }
19
}
20
 
21
std::string TrainRecord::getReportingMark(){
22
    return reporting;
23
}
24
 
25
void TrainRecord::setReportingMark(std::string mark ){
26
    reporting.assign( mark );
27
}
28
 
29
uint16_t TrainRecord::getRoadNumber(){
30
    return road;
31
}
32
 
33
void TrainRecord::setRoadNumber( uint16_t roadIn ){
34
    road = roadIn;
35
}
36
 
37
std::string TrainRecord::getStockType(){
38
    return stock;
39
}
40
 
41
void TrainRecord::setStockType( std::string stck ){
42
    stock.assign( stck );
43
}
44
 
45
uint16_t TrainRecord::getCost(){
46
    return cost;
47
}
48
 
49
void TrainRecord::setCost( uint16_t costIn ){
50
    cost = costIn;
51
}
52
 
53
std::string TrainRecord::getNotes(){
54
    return notes;
55
}
56
 
57
void TrainRecord::setNotes( std::string notesIn ){
58
    notes.assign( notesIn );
59
}