Skip to content

Commit a421eb3

Browse files
committed
explicit instantiations for scheduler and CachedExpressionParser
1 parent 2391019 commit a421eb3

4 files changed

Lines changed: 30 additions & 3 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ target_sources(${PROJECT_NAME}
7373
src/preprocessor.cpp
7474
src/randomization.cpp
7575
src/schedule.cpp
76+
src/scheduler.cpp
7677
src/task.cpp
7778
src/parser.cpp
7879
PUBLIC

include/oryx/chron/parser.hpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ class CachedExpressionParser : ExpressionParser {
5555
mutable std::vector<Pair> cache_{};
5656
};
5757

58-
static_assert(traits::Parser<ExpressionParser>);
59-
static_assert(traits::Parser<CachedExpressionParser<>>);
60-
6158
inline constexpr ExpressionParser kParseExpression{};
6259

6360
} // namespace oryx::chron

src/parser.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <oryx/chron/details/parser.hpp>
66
#include <oryx/chron/preprocessor.hpp>
7+
#include <oryx/chron/common.hpp>
78

89
namespace oryx::chron {
910

@@ -33,4 +34,10 @@ auto ExpressionParser::operator()(std::string_view cron_expression) const -> std
3334
return data;
3435
}
3536

37+
template class ORYX_CHRON_API CachedExpressionParser<NullMutex>;
38+
template class ORYX_CHRON_API CachedExpressionParser<std::mutex>;
39+
40+
static_assert(traits::Parser<ExpressionParser>);
41+
static_assert(traits::Parser<CachedExpressionParser<NullMutex>>);
42+
3643
} // namespace oryx::chron

src/scheduler.cpp

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#include <oryx/chron/scheduler.hpp>
2+
3+
#include <oryx/chron/common.hpp>
4+
5+
namespace oryx::chron {
6+
7+
template class ORYX_CHRON_API Scheduler<LocalClock, NullMutex, ExpressionParser>;
8+
template class ORYX_CHRON_API Scheduler<LocalClock, std::mutex, ExpressionParser>;
9+
template class ORYX_CHRON_API Scheduler<LocalClock, NullMutex, CachedExpressionParser<NullMutex>>;
10+
template class ORYX_CHRON_API Scheduler<LocalClock, std::mutex, CachedExpressionParser<std::mutex>>;
11+
12+
template class ORYX_CHRON_API Scheduler<UTCClock, NullMutex, ExpressionParser>;
13+
template class ORYX_CHRON_API Scheduler<UTCClock, std::mutex, ExpressionParser>;
14+
template class ORYX_CHRON_API Scheduler<UTCClock, NullMutex, CachedExpressionParser<NullMutex>>;
15+
template class ORYX_CHRON_API Scheduler<UTCClock, std::mutex, CachedExpressionParser<std::mutex>>;
16+
17+
template class ORYX_CHRON_API Scheduler<TzClock, NullMutex, ExpressionParser>;
18+
template class ORYX_CHRON_API Scheduler<TzClock, std::mutex, ExpressionParser>;
19+
template class ORYX_CHRON_API Scheduler<TzClock, NullMutex, CachedExpressionParser<NullMutex>>;
20+
template class ORYX_CHRON_API Scheduler<TzClock, std::mutex, CachedExpressionParser<std::mutex>>;
21+
22+
} // namespace oryx::chron

0 commit comments

Comments
 (0)