sow-topn
Including the basic AMPS library:
#include <amps/ampsplusplus.hpp>
Constructing the command:
AMPS::Command cmd(AMPS::Message::Command::SOW);
AMPS::Message::Options opts;
opts.setTopN(5);
// Set other options as needed
cmd.setTopic(topic).setOptions(opts).setOrderBy("/name ASC, /orderId DESC");
The command can now be used in execute or executeAsync.