ExecutorActivator.cpp 1.15 KB
Newer Older
1
2
#include "graph_executor_eager.hpp"
#include "graph_executor_lazy.hpp"
Mccaskey, Alex's avatar
Mccaskey, Alex committed
3
4
#include "node_executor_exatensor.hpp"
#include "node_executor_talsh.hpp"
5
6
7
8
9
10
11
12
13
14
15
16
17

#include "cppmicroservices/BundleActivator.h"
#include "cppmicroservices/BundleContext.h"

#include <memory>
#include <set>

using namespace cppmicroservices;

namespace {

/**
 */
18
class US_ABI_LOCAL ExecutorActivator : public BundleActivator {
19
20

public:
21
  ExecutorActivator() {}
22
23
24
25
26

  /**
   */
  void Start(BundleContext context) {

27
28
    auto g1 = std::make_shared<exatn::runtime::EagerGraphExecutor>();
    auto g2 = std::make_shared<exatn::runtime::LazyGraphExecutor>();
29

30
31
    context.RegisterService<exatn::runtime::TensorGraphExecutor>(g1);
    context.RegisterService<exatn::runtime::TensorGraphExecutor>(g2);
32
33
34
35
36
37

    auto n1 = std::make_shared<exatn::runtime::TalshNodeExecutor>();
    auto n2 = std::make_shared<exatn::runtime::ExatensorNodeExecutor>();

    context.RegisterService<exatn::runtime::TensorNodeExecutor>(n1);
    context.RegisterService<exatn::runtime::TensorNodeExecutor>(n2);
38
39
40
41
42
43
44
45
46
  }

  /**
   */
  void Stop(BundleContext /*context*/) {}
};

} // namespace

47
CPPMICROSERVICES_EXPORT_BUNDLE_ACTIVATOR(ExecutorActivator)