2020-01-17 13:22:08 +00:00
|
|
|
#include <simulation/sim_context.hpp>
|
|
|
|
#include <llarp.hpp>
|
|
|
|
|
|
|
|
namespace llarp
|
|
|
|
{
|
|
|
|
namespace simulate
|
|
|
|
{
|
|
|
|
Simulation::Simulation() : m_CryptoManager(new sodium::CryptoLibSodium())
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2020-04-07 18:38:56 +00:00
|
|
|
Simulation::NodeUp(llarp::Context*)
|
2020-01-17 13:22:08 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Node_ptr
|
2020-04-07 18:38:56 +00:00
|
|
|
Simulation::AddNode(const std::string& name)
|
2020-01-17 13:22:08 +00:00
|
|
|
{
|
|
|
|
auto itr = m_Nodes.find(name);
|
2020-04-07 18:38:56 +00:00
|
|
|
if (itr == m_Nodes.end())
|
2020-01-17 13:22:08 +00:00
|
|
|
{
|
2020-04-07 18:38:56 +00:00
|
|
|
itr = m_Nodes.emplace(name, std::make_shared<llarp::Context>(shared_from_this())).first;
|
2020-01-17 13:22:08 +00:00
|
|
|
}
|
|
|
|
return itr->second;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2020-04-07 18:38:56 +00:00
|
|
|
Simulation::DelNode(const std::string& name)
|
2020-01-17 13:22:08 +00:00
|
|
|
{
|
|
|
|
m_Nodes.erase(name);
|
|
|
|
}
|
|
|
|
} // namespace simulate
|
|
|
|
} // namespace llarp
|