Skip to content

Commit 3dd2954

Browse files
committed
fdsdump: add unique_ptr constructor to ViewFactory
1 parent 741d036 commit 3dd2954

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

src/tools/fdsdump/src/aggregator/viewFactory.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,18 @@ ViewFactory::create_view(
296296
return view;
297297
}
298298

299+
std::unique_ptr<View>
300+
ViewFactory::create_unique_view(
301+
const std::string &key_def,
302+
const std::string &value_def,
303+
const std::string &order_def,
304+
unsigned int output_limit)
305+
{
306+
std::unique_ptr<View> view(new View);
307+
create_view(*view.get(), key_def, value_def, order_def, output_limit);
308+
return view;
309+
}
310+
299311
void
300312
ViewFactory::create_view(
301313
View &view,

src/tools/fdsdump/src/aggregator/viewFactory.hpp

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,23 @@ class ViewFactory {
5050
const std::string &order_def,
5151
unsigned int output_limit = 0);
5252

53+
/**
54+
* @brief Create an unique aggregation view
55+
*
56+
* @param key_def The definition of the key fields as specified on the command line
57+
* @param value_def The definition of the value fields as specified on the command line
58+
* @param order_def The definition of the order-by fields as specified on the command line
59+
* @param output_limit The number of items that will be outputted using this view (0 = no limit)
60+
*
61+
* @return The view
62+
*/
63+
std::unique_ptr<View>
64+
static create_unique_view(
65+
const std::string &key_def,
66+
const std::string &value_def,
67+
const std::string &order_def,
68+
unsigned int output_limit);
69+
5370
private:
5471
static std::unique_ptr<Field> create_elem_or_alias(const std::string &def);
5572

0 commit comments

Comments
 (0)