lokinet/llarp/simulation/sim_context.cpp

35 lines
685 B
C++
Raw Normal View History

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
Simulation::NodeUp(llarp::Context*)
2020-01-17 13:22:08 +00:00
{
}
Node_ptr
Simulation::AddNode(const std::string& name)
2020-01-17 13:22:08 +00:00
{
auto itr = m_Nodes.find(name);
if (itr == m_Nodes.end())
2020-01-17 13:22:08 +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
Simulation::DelNode(const std::string& name)
2020-01-17 13:22:08 +00:00
{
m_Nodes.erase(name);
}
} // namespace simulate
} // namespace llarp