Skip to content

Commit 08621ec

Browse files
author
kr-2003
committed
definition shifted to cpp file
1 parent 6d08824 commit 08621ec

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

src/xmagics/execution.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,20 @@ namespace xcpp
3535

3636
int timeit::exec_counter = 0;
3737

38+
void timeit::operator()(const std::string& line)
39+
{
40+
std::string cline = line;
41+
std::string ccell = "";
42+
execute(cline, ccell);
43+
}
44+
45+
void timeit::operator()(const std::string& line, const std::string& cell)
46+
{
47+
std::string cline = line;
48+
std::string ccell = cell;
49+
execute(cline, ccell);
50+
}
51+
3852
void timeit::get_options(argparser& argpars)
3953
{
4054
argpars.add_description("Time execution of a C++ statement or expression");

src/xmagics/execution.hpp

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
#include <cstddef>
1313
#include <string>
1414

15-
#include "clang/Interpreter/CppInterOp.h"
16-
1715
#include "xeus-cpp/xmagics.hpp"
1816
#include "xeus-cpp/xoptions.hpp"
1917

@@ -24,20 +22,10 @@ namespace xcpp
2422
public:
2523

2624
XEUS_CPP_API
27-
virtual void operator()(const std::string& line) override
28-
{
29-
std::string cline = line;
30-
std::string cell = "";
31-
execute(cline, cell);
32-
}
25+
virtual void operator()(const std::string& line) override;
3326

3427
XEUS_CPP_API
35-
virtual void operator()(const std::string& line, const std::string& cell) override
36-
{
37-
std::string cline = line;
38-
std::string ccell = cell;
39-
execute(cline, ccell);
40-
}
28+
virtual void operator()(const std::string& line, const std::string& cell) override;
4129

4230
public:
4331

@@ -49,7 +37,6 @@ namespace xcpp
4937
std::string inner(std::size_t number, const std::string& code, int exec_counter) const;
5038
std::string _format_time(double timespan, std::size_t precision) const;
5139
void execute(std::string& line, std::string& cell);
52-
std::string wrap_code(const std::string& code) const;
5340
};
5441
}
5542
#endif

0 commit comments

Comments
 (0)