KiCad PCB EDA Suite
kiid.cpp File Reference
#include <kiid.h>
#include <boost/uuid/uuid_generators.hpp>
#include <boost/uuid/uuid_io.hpp>
#include <boost/functional/hash.hpp>
#include <nlohmann/json.hpp>
#include <cctype>
#include <mutex>
#include <wx/log.h>

Go to the source code of this file.

Functions

KIIDNilUuid ()
 
void to_json (nlohmann::json &aJson, const KIID &aKIID)
 
void from_json (const nlohmann::json &aJson, KIID &aKIID)
 

Variables

static std::mutex rng_mutex
 
static boost::mt19937 rng
 
static boost::uuids::basic_random_generator< boost::mt19937 > randomGenerator
 
static boost::uuids::string_generator stringGenerator
 
static boost::uuids::nil_generator nilGenerator
 
KIID niluuid (0)
 
static bool g_createNilUuids = false
 

Function Documentation

◆ from_json()

void from_json ( const nlohmann::json aJson,
KIID aKIID 
)

Definition at line 376 of file kiid.cpp.

377{
378 aKIID = KIID( aJson.get<std::string>() );
379}
Definition: kiid.h:48

◆ NilUuid()

KIID & NilUuid ( )

Definition at line 67 of file kiid.cpp.

68{
69 static KIID nil( 0 );
70 return nil;
71}

Referenced by SCH_SEXPR_PARSER::parseSchSymbolInstances().

◆ to_json()

void to_json ( nlohmann::json aJson,
const KIID aKIID 
)

Definition at line 370 of file kiid.cpp.

371{
372 aJson = aKIID.AsString().ToUTF8();
373}
wxString AsString() const
Definition: kiid.cpp:257

References KIID::AsString().

Variable Documentation

◆ g_createNilUuids

bool g_createNilUuids = false
static

Definition at line 63 of file kiid.cpp.

Referenced by KIID::CreateNilUuids(), and KIID::KIID().

◆ nilGenerator

boost::uuids::nil_generator nilGenerator
static

Definition at line 55 of file kiid.cpp.

Referenced by KIID::KIID().

◆ niluuid

◆ randomGenerator

boost::uuids::basic_random_generator<boost::mt19937> randomGenerator
static

Definition at line 51 of file kiid.cpp.

Referenced by KIID::ConvertTimestampToUuid(), KIID::KIID(), and KIID::SeedGenerator().

◆ rng

boost::mt19937 rng
static

Definition at line 50 of file kiid.cpp.

Referenced by KIID::SeedGenerator().

◆ rng_mutex

std::mutex rng_mutex
static

Definition at line 44 of file kiid.cpp.

Referenced by KIID::KIID().

◆ stringGenerator

boost::uuids::string_generator stringGenerator
static

Definition at line 54 of file kiid.cpp.

Referenced by KIID::KIID().