drogon/drogon_ctl/templates/plugin_h.csp

35 lines
784 B
Plaintext
Raw Permalink Normal View History

2019-03-29 07:34:14 +00:00
/**
*
* [[filename]].h
2019-03-29 07:34:14 +00:00
*
*/
#pragma once
#include <drogon/plugins/Plugin.h>
<%c++
auto namespaceVector=@@.get<std::vector<std::string>>("namespaceVector");
if(namespaceVector.empty())
$$<<"\n";
for(auto &namespaceName:namespaceVector){%>
namespace {%namespaceName%}
{
<%c++}
$$<<"\n";%>
2019-05-05 07:43:17 +00:00
class [[className]] : public drogon::Plugin<[[className]]>
2019-03-29 07:34:14 +00:00
{
public:
[[className]]() {}
2019-03-29 07:34:14 +00:00
/// This method must be called by drogon to initialize and start the plugin.
/// It must be implemented by the user.
void initAndStart(const Json::Value &config) override;
2019-03-29 07:34:14 +00:00
/// This method must be called by drogon to shutdown the plugin.
/// It must be implemented by the user.
void shutdown() override;
2019-03-29 07:34:14 +00:00
};
<%c++for(size_t i=0;i<namespaceVector.size();i++){%>
}
<%c++}%>