mirror of https://github.com/mamba-org/mamba.git
Refactred pool.hpp
This commit is contained in:
parent
86593edeb7
commit
29f793befb
|
@ -1,4 +1,5 @@
|
|||
#pragma once
|
||||
#ifndef MAMBA_POOL_HPP
|
||||
#define MAMBA_POOL_HPP
|
||||
|
||||
#include "thirdparty/minilog.hpp"
|
||||
#include "context.hpp"
|
||||
|
@ -13,34 +14,24 @@ namespace mamba
|
|||
class MPool
|
||||
{
|
||||
public:
|
||||
MPool()
|
||||
{
|
||||
m_pool = pool_create();
|
||||
pool_setdisttype(m_pool, DISTTYPE_CONDA);
|
||||
set_debuglevel();
|
||||
}
|
||||
|
||||
~MPool()
|
||||
{
|
||||
LOG(INFO) << "Freeing pool.";
|
||||
pool_free(m_pool);
|
||||
}
|
||||
MPool();
|
||||
~MPool();
|
||||
|
||||
void set_debuglevel()
|
||||
{
|
||||
pool_setdebuglevel(m_pool, Context::instance().verbosity);
|
||||
}
|
||||
MPool(const MPool&) = delete;
|
||||
MPool& operator=(const MPool&) = delete;
|
||||
MPool(MPool&&) = delete;
|
||||
MPool& operator=(MPool&&) = delete;
|
||||
|
||||
void create_whatprovides()
|
||||
{
|
||||
pool_createwhatprovides(m_pool);
|
||||
}
|
||||
void set_debuglevel();
|
||||
void create_whatprovides();
|
||||
|
||||
operator Pool*()
|
||||
{
|
||||
return m_pool;
|
||||
}
|
||||
operator Pool*();
|
||||
|
||||
private:
|
||||
|
||||
Pool* m_pool;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#endif // MAMBA_POOL_HPP
|
||||
|
|
1
setup.py
1
setup.py
|
@ -65,6 +65,7 @@ ext_modules = [
|
|||
'src/context.cpp',
|
||||
'src/fetch.cpp',
|
||||
'src/package_handling.cpp',
|
||||
'src/pool.cpp',
|
||||
'src/query.cpp',
|
||||
'src/repo.cpp',
|
||||
'src/solver.cpp',
|
||||
|
|
|
@ -0,0 +1,33 @@
|
|||
#include "pool.hpp"
|
||||
|
||||
namespace mamba
|
||||
{
|
||||
MPool::MPool()
|
||||
{
|
||||
m_pool = pool_create();
|
||||
pool_setdisttype(m_pool, DISTTYPE_CONDA);
|
||||
set_debuglevel();
|
||||
}
|
||||
|
||||
MPool::~MPool()
|
||||
{
|
||||
LOG(INFO) << "Freeing pool.";
|
||||
pool_free(m_pool);
|
||||
}
|
||||
|
||||
void MPool::set_debuglevel()
|
||||
{
|
||||
pool_setdebuglevel(m_pool, Context::instance().verbosity);
|
||||
}
|
||||
|
||||
void MPool::create_whatprovides()
|
||||
{
|
||||
pool_createwhatprovides(m_pool);
|
||||
}
|
||||
|
||||
MPool::operator Pool*()
|
||||
{
|
||||
return m_pool;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue