From c63dfa4946092962370e48e5e2d3fc0af06c18df Mon Sep 17 00:00:00 2001 From: Chris Frey Date: Sun, 19 Dec 2010 15:40:28 -0500 Subject: [PATCH] example: use new Add() templates to clarify example code --- examples/pipedump.cc | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/examples/pipedump.cc b/examples/pipedump.cc index 6ee9a1a7..9225f5e4 100644 --- a/examples/pipedump.cc +++ b/examples/pipedump.cc @@ -96,19 +96,14 @@ int main(int argc, char *argv[]) MultiRecordParser mrp( new UnknownParser ); - // add a few known record types + // add a few known record types... first, the manual way mrp.Add( Contact::GetDBName(), new RecordParser >( new Store)); - mrp.Add( Calendar::GetDBName(), - new RecordParser >( - new Store)); - mrp.Add( Sms::GetDBName(), - new RecordParser >( - new Store)); - mrp.Add( Timezone::GetDBName(), - new RecordParser >( - new Store)); + // and with the template member (does the same thing) + mrp.Add( new Store ); + mrp.Add( new Store ); + mrp.Add( new Store ); builder.Restart(); pipe.PumpFile(mrp); -- 2.11.4.GIT