Created
February 25, 2015 01:54
-
-
Save rblaze/ef1ec311ab4e497319c2 to your computer and use it in GitHub Desktop.
This file contains 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
class ConverterInterface { | |
void WriteInt(int, int); | |
void WriteDouble(int, double); | |
} | |
void convert_stream(Stream stream, ConverterInterface *writer) { | |
for (auto record : stream) { | |
if (record.type == INT) { | |
writer->WriteInt(record.fieldnumber, record.intvalue); | |
} else if (record.type == DOUBLE) { | |
writer->WriteDouble(record.fieldnumber, record.intvalue); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment