osurs  0.0.1
network.h
Go to the documentation of this file.
1 
15 #ifndef OSURS_NETWORK_H_
16 #define OSURS_NETWORK_H_
17 
18 #include "osurs/types.h"
19 
20 // Constructor-like methods
21 
40 
50 Node *new_node(Network *network, const char *id, double x, double y);
51 
60 Composition *new_composition(Network *network, const char *id, int seat_count);
61 
70 Vehicle *new_vehicle(Network *network, const char *id,
71  Composition *composition);
72 
95 Route *new_route(Network *network, const char *id, Node *nodes[],
96  int arrival_offsets[], int departure_offsets[],
97  size_t route_size, const char *trip_ids[], int departures[],
98  Vehicle *vehicles[], size_t trip_size);
99 
100 // Getters
101 
109 Node *get_node(Network *network, const char *id);
110 
118 Vehicle *get_vehicle(Network *network, const char *id);
119 
127 Composition *get_composition(Network *network, const char *id);
128 
136 Route *get_route(Network *network, const char *id);
137 
145 Trip *get_trip(Route *route, const char *id);
146 
147 // Destructor-like methods
148 
158 void delete_network(Network *network);
159 
160 #endif // OSURS_NETWORK_H_
Node * get_node(Network *network, const char *id)
Get the node struct.
Definition: getter.c:17
Composition * get_composition(Network *network, const char *id)
Get the composition struct.
Definition: getter.c:33
Trip * get_trip(Route *route, const char *id)
Get the trip struct.
Definition: getter.c:49
Vehicle * get_vehicle(Network *network, const char *id)
Get the vehicle struct.
Definition: getter.c:25
Route * new_route(Network *network, const char *id, Node *nodes[], int arrival_offsets[], int departure_offsets[], size_t route_size, const char *trip_ids[], int departures[], Vehicle *vehicles[], size_t trip_size)
Create a new route and add it to the network.
Definition: constructor.c:49
Network * new_network()
Create a new network.
Definition: constructor.c:27
Vehicle * new_vehicle(Network *network, const char *id, Composition *composition)
Create a new vehicle and add it to the network.
Definition: constructor.c:100
Route * get_route(Network *network, const char *id)
Get the route struct.
Definition: getter.c:41
void delete_network(Network *network)
Delete a network.
Definition: destructor.c:28
Node * new_node(Network *network, const char *id, double x, double y)
Create a new node and add it to the network.
Definition: constructor.c:36
Composition * new_composition(Network *network, const char *id, int seat_count)
Create a new composition and add it to the network.
Definition: constructor.c:112
A composition.
Definition: types.h:117
A network.
Definition: types.h:130
A node.
Definition: types.h:38
A route.
Definition: types.h:91
A trip.
Definition: types.h:71
A vehicle.
Definition: types.h:106
Data types of osurs.