PluginBases.cpp 1.04 KB
Newer Older
1
#include <base/PluginBases.hpp>
2
#include <memory>
3
#include <random>
4
5
using namespace XPlug;

6
XPlug::LazyPlugin::LazyPlugin()
7
{
8
  std::default_random_engine engine;
9
10
11
12
13
14
  this->infoComponent = std::make_unique<StaticInfoComponent>(
    "No Name Plugin",
    "urn://LazyPlugin/ToLazyToInit",
    "A simple plugin wich does something... at least it exists",
    "LGPL",
    "Me",
15
16
    "http://myhompeage.never.existed.com",
    std::uniform_int_distribution<int64_t>()(engine));
17

18
19
20
  this->portComponent = std::make_unique<DynamicPortComponent>();
  this->featureComponent =
    std::make_unique<AutomaticFeatureComponent>(this->portComponent.get());
21
}
22

23
24
XPlug::LazyPlugin::LazyPlugin(std::vector<std::unique_ptr<IPort>> ports)
  : LazyPlugin()
25
{
26
27
28
29
  for (size_t i = 0; i < ports.size(); i++) {
    this->portComponent->addPort(std::move(ports[i]));
  }
  this->featureComponent->detectFeatures(this->getPortComponent());
30
31
}

32
33
34
void
XPlug::LazyPlugin::init()
{}
35

36
37
38
void
XPlug::LazyPlugin::deinit()
{}
39

40
41
42
void
XPlug::LazyPlugin::activate()
{}
43

44
45
46
void
XPlug::LazyPlugin::deactivate()
{}