Skip to content

Commit

Permalink
added virtual clone function to Cut
Browse files Browse the repository at this point in the history
  • Loading branch information
jkguiang committed Jun 6, 2024
1 parent 6fc65c9 commit 6eff31f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/cutflow.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ Cut::Cut(std::string new_name)

Cut::~Cut() {}

virtual Cut* Cut::clone(std::string new_name)
{
return new Cut(new_name);
}

void Cut::print()
{
std::cout << "---- " << name << " ----" << std::endl;
Expand Down
7 changes: 7 additions & 0 deletions src/cutflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,13 @@ class Cut
*/
virtual ~Cut();

/**
* Create a copy of this cut object
* @param new_name name of cut copy
* @return pointer to a copy of this cut object
*/
virtual Cut* clone(std::string new_name);

/**
* Print cut object properties
* @return none
Expand Down

0 comments on commit 6eff31f

Please sign in to comment.