snoop_listen: Add constructors for SnoopListen

Provide two additional constructors for SnoopListen, one that takes
any std::function that operates on sdbusplus message, and another one
that takes std::function that operates on the uint64_t postcode. This
allows user to easily register a POST code handler without writing much
of the boiler plate code.

example.cpp is also converted to use the new constructor.

Tested:
'snooper' program compiled from example.cpp behaves correctly.

Change-Id: I20dc4fa5067e836d3cfa8ebb616a131f38a93a30
Signed-off-by: Kun Yi <kunyi731@gmail.com>
2 files changed