ModErn Text Analysis
META Enumerates Textual Applications
clonable.h
Go to the documentation of this file.
1 
10 #ifndef META_UTIL_CLONABLE_H_
11 #define META_UTIL_CLONABLE_H_
12 
13 #include <memory>
14 #include "util/shim.h"
15 
16 namespace meta
17 {
18 namespace util
19 {
20 
27 template <class Root, class Base, class Derived>
28 class multilevel_clonable : public Base
29 {
30  public:
32  using Base::Base;
33 
40  virtual std::unique_ptr<Root> clone() const
41  {
42  return make_unique<Derived>(static_cast<const Derived&>(*this));
43  }
44 };
45 
51 template <class Base, class Derived>
53 }
54 }
55 #endif
Template class to facilitate polymorphic cloning.
Definition: clonable.h:28
The ModErn Text Analysis toolkit is a suite of natural language processing, classification, information retreival, data mining, and other applications of text processing.
Definition: analyzer.h:24
virtual std::unique_ptr< Root > clone() const
Clones the given object.
Definition: clonable.h:40