Last active
August 29, 2015 14:16
-
-
Save srenault/ab7e7c8a2ad240cc18c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int main(int argc, char **argv) { | |
google::protobuf::Arena arena; | |
std::ifstream in("<path>"); | |
m::cheminot::data::Graph* graphBuf = google::protobuf::Arena::CreateMessage<m::cheminot::data::Graph>(&arena); | |
graphBuf->ParseFromIstream(&in); | |
in.close(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax = "proto3"; | |
option cc_enable_arenas = true; | |
package m.cheminot.data; | |
message Graph { | |
map<string, Vertice> vertices = 1; | |
} | |
message Vertice { | |
string id = 1; | |
string name = 2; | |
repeated string edges = 3; | |
repeated StopTime stopTimes = 4; | |
} | |
message StopTime { | |
string tripId = 1; | |
string arrival = 2; | |
string departure = 3; | |
string stopId = 4; | |
int32 pos = 5; | |
} | |
message CalendarDates { | |
map<string, CalendarExceptions> exceptionsByServiceId = 1; | |
} | |
message CalendarExceptions { | |
repeated CalendarDate calendarDates = 1; | |
} | |
message CalendarDate { | |
string serviceId = 1; | |
string date = 2; | |
int32 exceptionType = 3; | |
} | |
message Calendar { | |
string serviceId = 1; | |
string monday = 2; | |
string tuesday = 3; | |
string wednesday = 4; | |
string thursday = 5; | |
string friday = 6; | |
string saturday = 7; | |
string sunday = 8; | |
string startDate = 9; | |
string endDate = 10; | |
} | |
message TripStopIds { | |
repeated string stopIds = 1; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main(44728,0x7fff77496300) malloc: *** error for object 0x7ffb8ac04ed0: pointer being freed was not allocated | |
*** set a breakpoint in malloc_error_break to debug | |
[1] 44728 abort ./main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Have you figured out the problem?