Skip to content

Commit

Permalink
fix: template specialization must go at the end
Browse files Browse the repository at this point in the history
  • Loading branch information
c-dilks committed Sep 9, 2024
1 parent 0565963 commit 5534ff2
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/iguana/algorithms/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ algo_lib = shared_library(
algo_sources,
include_directories: [ project_inc ] + ROOT_dep_inc_dirs,
dependencies: project_deps,
link_with: services_lib,
link_with: [ services_lib ],
link_args: ROOT_dep_link_args,
install: true,
build_rpath: ROOT_dep_rpath,
Expand Down
33 changes: 33 additions & 0 deletions src/iguana/services/ConcurrentParam.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,37 @@ namespace iguana {
{
throw std::runtime_error("TODO: 'threadpool' model not yet implemented");
}

// ==================================================================================
// template specializations
// ==================================================================================

template class ConcurrentParam<int>;
template class ConcurrentParam<double>;
template class ConcurrentParam<std::string>;
template class ConcurrentParam<std::vector<int>>;
template class ConcurrentParam<std::vector<double>>;
template class ConcurrentParam<std::vector<std::string>>;

template class SingleThreadParam<int>;
template class SingleThreadParam<double>;
template class SingleThreadParam<std::string>;
template class SingleThreadParam<std::vector<int>>;
template class SingleThreadParam<std::vector<double>>;
template class SingleThreadParam<std::vector<std::string>>;

template class MemoizedParam<int>;
template class MemoizedParam<double>;
template class MemoizedParam<std::string>;
template class MemoizedParam<std::vector<int>>;
template class MemoizedParam<std::vector<double>>;
template class MemoizedParam<std::vector<std::string>>;

template class ThreadPoolParam<int>;
template class ThreadPoolParam<double>;
template class ThreadPoolParam<std::string>;
template class ThreadPoolParam<std::vector<int>>;
template class ThreadPoolParam<std::vector<double>>;
template class ThreadPoolParam<std::vector<std::string>>;

}
38 changes: 3 additions & 35 deletions src/iguana/services/ConcurrentParam.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ namespace iguana {

public:
SingleThreadParam();
~SingleThreadParam() {}
~SingleThreadParam() override = default;
T const Load(concurrent_key_t const key = 0) const override;
void Save(T const& value, concurrent_key_t const key = 0) override;
bool HasKey(concurrent_key_t const key) const override;
Expand All @@ -92,7 +92,7 @@ namespace iguana {

public:
MemoizedParam();
~MemoizedParam() {}
~MemoizedParam() override = default;
T const Load(concurrent_key_t const key = 0) const override;
void Save(T const& value, concurrent_key_t const key = 0) override;
bool HasKey(concurrent_key_t const key) const override;
Expand All @@ -116,7 +116,7 @@ namespace iguana {

public:
ThreadPoolParam();
~ThreadPoolParam() {}
~ThreadPoolParam() override = default;
T const Load(concurrent_key_t const key = 0) const override;
void Save(T const& value, concurrent_key_t const key = 0) override;
bool HasKey(concurrent_key_t const key) const override;
Expand All @@ -127,38 +127,6 @@ namespace iguana {

};

// ==================================================================================
// template specializations
// ==================================================================================

template class ConcurrentParam<int>;
template class ConcurrentParam<double>;
template class ConcurrentParam<std::string>;
template class ConcurrentParam<std::vector<int>>;
template class ConcurrentParam<std::vector<double>>;
template class ConcurrentParam<std::vector<std::string>>;

template class SingleThreadParam<int>;
template class SingleThreadParam<double>;
template class SingleThreadParam<std::string>;
template class SingleThreadParam<std::vector<int>>;
template class SingleThreadParam<std::vector<double>>;
template class SingleThreadParam<std::vector<std::string>>;

template class MemoizedParam<int>;
template class MemoizedParam<double>;
template class MemoizedParam<std::string>;
template class MemoizedParam<std::vector<int>>;
template class MemoizedParam<std::vector<double>>;
template class MemoizedParam<std::vector<std::string>>;

template class ThreadPoolParam<int>;
template class ThreadPoolParam<double>;
template class ThreadPoolParam<std::string>;
template class ThreadPoolParam<std::vector<int>>;
template class ThreadPoolParam<std::vector<double>>;
template class ThreadPoolParam<std::vector<std::string>>;

// ==================================================================================
// ConcurrentParamFactory
// ==================================================================================
Expand Down
2 changes: 1 addition & 1 deletion src/iguana/tests/meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
test_exe_name = 'iguana_test'
test_exe_inc = include_directories('include')
test_exe_links = [ project_libs, vdor_lib ]
test_exe_links = project_libs + [ vdor_lib ]

test_exe = executable(
test_exe_name,
Expand Down

0 comments on commit 5534ff2

Please sign in to comment.