KiCad PCB EDA Suite
|
#include <kiid.h>
Public Member Functions | |
KIID () | |
KIID (int null) | |
KIID (const std::string &aString) | |
KIID (const char *aString) | |
KIID (const wxString &aString) | |
KIID (timestamp_t aTimestamp) | |
void | Clone (const KIID &aUUID) |
size_t | Hash () const |
bool | IsLegacyTimestamp () const |
timestamp_t | AsLegacyTimestamp () const |
wxString | AsString () const |
wxString | AsLegacyTimestampString () const |
void | ConvertTimestampToUuid () |
Change an existing time stamp based UUID into a true UUID. More... | |
void | Increment () |
Generates a deterministic replacement for a given ID. More... | |
bool | operator== (KIID const &rhs) const |
bool | operator!= (KIID const &rhs) const |
bool | operator< (KIID const &rhs) const |
bool | operator> (KIID const &rhs) const |
Static Public Member Functions | |
static bool | SniffTest (const wxString &aCandidate) |
Returns true if a string has the correct formatting to be a KIID. More... | |
static void | CreateNilUuids (bool aNil=true) |
A performance optimization which disables/enables the generation of pseudo-random UUIDs. More... | |
static void | SeedGenerator (unsigned int aSeed) |
Re-initialize the UUID generator with a given seed (for testing or QA purposes) More... | |
Private Attributes | |
boost::uuids::uuid | m_uuid |
timestamp_t | m_cached_timestamp |
KIID::KIID | ( | ) |
Definition at line 74 of file kiid.cpp.
References g_createNilUuids, m_cached_timestamp, m_uuid, nilGenerator, randomGenerator, and rng_mutex.
KIID::KIID | ( | const std::string & | aString | ) |
Definition at line 112 of file kiid.cpp.
References IsLegacyTimestamp(), m_cached_timestamp, m_uuid, randomGenerator, and stringGenerator.
KIID::KIID | ( | timestamp_t | aTimestamp | ) |
Definition at line 207 of file kiid.cpp.
References AsLegacyTimestampString(), m_cached_timestamp, and m_uuid.
timestamp_t KIID::AsLegacyTimestamp | ( | ) | const |
Definition at line 230 of file kiid.cpp.
References m_cached_timestamp.
Referenced by AsLegacyTimestampString(), SCH_LEGACY_PLUGIN::saveSheet(), and SCH_LEGACY_PLUGIN::saveSymbol().
wxString KIID::AsLegacyTimestampString | ( | ) | const |
Definition at line 263 of file kiid.cpp.
References AsLegacyTimestamp().
Referenced by KIID(), and SCH_LEGACY_PLUGIN::saveSymbol().
wxString KIID::AsString | ( | ) | const |
Definition at line 257 of file kiid.cpp.
References m_uuid.
Referenced by SCH_SYMBOL::AddHierarchicalReference(), KIID_PATH::AsString(), SCHEMATIC::ConvertRefsToKIIDs(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), PCB_PLUGIN::format(), SCH_SEXPR_PLUGIN::Format(), formatArc(), formatBezier(), formatCircle(), PNS::LOGGER::FormatEvent(), formatPoly(), formatRect(), SCH_PIN::GetDefaultNetName(), SCH_REFERENCE::GetFullPath(), RC_ITEM::GetJsonViolation(), PAD::GetMsgPanelInfo(), BOARD_ITEM::GetParentAsString(), PROJECT::GetSheetName(), NETLIST_EXPORTER_XML::makeSymbols(), PCB_BASE_FRAME::OnFpChangeDebounceTimer(), SCH_SHEET_PATH::PathAsString(), SCH_SYMBOL::RemoveInstance(), PCB_PARSER::resolveGroups(), SCH_SEXPR_PLUGIN::saveBitmap(), SCH_SEXPR_PLUGIN::saveBusEntry(), SCH_SEXPR_PLUGIN::saveJunction(), SCH_SEXPR_PLUGIN::saveLine(), SCH_SEXPR_PLUGIN::saveNoConnect(), SCH_SEXPR_PLUGIN::saveSheet(), SCH_SEXPR_PLUGIN::saveSymbol(), SCH_SEXPR_PLUGIN::saveText(), SCH_SEXPR_PLUGIN::saveTextBox(), SniffTest(), testGroupEqual(), to_json(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().
void KIID::Clone | ( | const KIID & | aUUID | ) |
Definition at line 250 of file kiid.cpp.
References m_cached_timestamp, and m_uuid.
void KIID::ConvertTimestampToUuid | ( | ) |
Change an existing time stamp based UUID into a true UUID.
If this is not a time stamp based UUID, then no change is made.
Definition at line 269 of file kiid.cpp.
References IsLegacyTimestamp(), m_cached_timestamp, m_uuid, and randomGenerator.
|
static |
A performance optimization which disables/enables the generation of pseudo-random UUIDs.
NB: uses a global. Not thread safe!
Definition at line 294 of file kiid.cpp.
References g_createNilUuids.
Referenced by SYMBOL_TREE_MODEL_ADAPTER::AddLibraries(), KIID_NIL_SET_RESET::KIID_NIL_SET_RESET(), SYMBOL_VIEWER_FRAME::loadAllLibraries(), and KIID_NIL_SET_RESET::~KIID_NIL_SET_RESET().
size_t KIID::Hash | ( | ) | const |
void KIID::Increment | ( | ) |
bool KIID::IsLegacyTimestamp | ( | ) | const |
Definition at line 224 of file kiid.cpp.
References m_uuid.
Referenced by ConvertTimestampToUuid(), and KIID().
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
Re-initialize the UUID generator with a given seed (for testing or QA purposes)
WARNING: Do not call this function from within KiCad or via a Python action plugin. It is only to be used inside QA tests or in external Python scripts. Resetting the UUID generator in the middle of a KiCad GUI run will potentially have harmful effects on file integrity.
aSeed | is a seed to pass to the boost::mt19937 pseudo-random number generator |
Definition at line 300 of file kiid.cpp.
References randomGenerator, and rng.
Referenced by BOOST_AUTO_TEST_CASE().
|
static |
Returns true if a string has the correct formatting to be a KIID.
Definition at line 179 of file kiid.cpp.
References AsString(), and niluuid.
Referenced by searchAreas().
|
private |
Definition at line 129 of file kiid.h.
Referenced by AsLegacyTimestamp(), Clone(), ConvertTimestampToUuid(), and KIID().
|
private |
Definition at line 127 of file kiid.h.
Referenced by AsString(), Clone(), ConvertTimestampToUuid(), Hash(), Increment(), IsLegacyTimestamp(), KIID(), operator!=(), operator<(), operator==(), and operator>().