lokinet/llarp/simulation/sim_context.cpp
Thomas Winget 7caa87862e standardize include format and pragma once
All #ifndef guards on headers have been removed, I think,
in favor of #pragma once

Headers are now included as `#include "filename"` if the included file
resides in the same directory as the file including it, or any
subdirectory therein.  Otherwise they are included as
`#include <project/top/dir/relative/path/filename>`

The above does not include system/os headers.
2021-03-09 19:01:41 -05:00

33 lines
664 B
C++

#include "sim_context.hpp"
#include <llarp.hpp>
namespace llarp
{
namespace simulate
{
Simulation::Simulation() : m_CryptoManager(new sodium::CryptoLibSodium())
{}
void
Simulation::NodeUp(llarp::Context*)
{}
Node_ptr
Simulation::AddNode(const std::string& name)
{
auto itr = m_Nodes.find(name);
if (itr == m_Nodes.end())
{
itr = m_Nodes.emplace(name, std::make_shared<llarp::Context>(shared_from_this())).first;
}
return itr->second;
}
void
Simulation::DelNode(const std::string& name)
{
m_Nodes.erase(name);
}
} // namespace simulate
} // namespace llarp