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 |
std::string | AsStdString () const |
void | ConvertTimestampToUuid () |
Change an existing time stamp based UUID into a true UUID. | |
void | Increment () |
Generates a deterministic replacement for a given ID. | |
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. | |
static void | CreateNilUuids (bool aNil=true) |
A performance optimization which disables/enables the generation of pseudo-random UUIDs. | |
static void | SeedGenerator (unsigned int aSeed) |
Re-initialize the UUID generator with a given seed (for testing or QA purposes) | |
Private Attributes | |
boost::uuids::uuid | m_uuid |
KIID::KIID | ( | ) |
Definition at line 74 of file kiid.cpp.
References g_createNilUuids, m_uuid, nilGenerator, randomGenerator, and rng_mutex.
KIID::KIID | ( | const std::string & | aString | ) |
Definition at line 109 of file kiid.cpp.
References m_uuid, randomGenerator, and stringGenerator.
KIID::KIID | ( | timestamp_t | aTimestamp | ) |
timestamp_t KIID::AsLegacyTimestamp | ( | ) | const |
Definition at line 213 of file kiid.cpp.
References m_uuid.
Referenced by AsLegacyTimestampString(), BOOST_AUTO_TEST_CASE(), SCH_IO_KICAD_LEGACY::saveSheet(), and SCH_IO_KICAD_LEGACY::saveSymbol().
wxString KIID::AsLegacyTimestampString | ( | ) | const |
Definition at line 250 of file kiid.cpp.
References AsLegacyTimestamp().
Referenced by BOOST_AUTO_TEST_CASE(), and SCH_IO_KICAD_LEGACY::saveSymbol().
std::string KIID::AsStdString | ( | ) | const |
Definition at line 244 of file kiid.cpp.
References m_uuid.
Referenced by API_HANDLER_SCH::handleCreateUpdateItemsInternal(), API_HANDLER_PCB::handleCreateUpdateItemsInternal(), SCH_LABEL::Serialize(), SCH_LINE::Serialize(), FOOTPRINT::Serialize(), PAD::Serialize(), PCB_DIMENSION_BASE::Serialize(), PCB_SHAPE::Serialize(), PCB_TEXT::Serialize(), PCB_TEXTBOX::Serialize(), PCB_TRACK::Serialize(), PCB_ARC::Serialize(), PCB_VIA::Serialize(), and ZONE::Serialize().
wxString KIID::AsString | ( | ) | const |
Definition at line 238 of file kiid.cpp.
References m_uuid.
Referenced by SCH_SYMBOL::AddHierarchicalReference(), KIID_PATH::AsString(), SCH_SHEET_PATH::CheckForMissingSymbolInstances(), SCHEMATIC::ConvertRefsToKIIDs(), MULTICHANNEL_TOOL::findOtherItemsInRuleArea(), MULTICHANNEL_TOOL::findRoutedConnections(), SCH_EDITOR_CONTROL::FindSymbolAndItem(), formatArc(), formatBezier(), formatCircle(), formatPoly(), formatRect(), KICAD_FORMAT::FormatUuid(), 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(), DIALOG_GENERATORS::RebuildModels(), SCH_SYMBOL::RemoveInstance(), PCB_IO_KICAD_SEXPR_PARSER::resolveGroups(), SniffTest(), testGroupEqual(), to_json(), SCH_EDITOR_CONTROL::updatePastedSymbol(), and NETLIST_EXPORTER_ORCADPCB2::WriteNetlist().
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 256 of file kiid.cpp.
References IsLegacyTimestamp(), 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 280 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 |
Definition at line 226 of file kiid.cpp.
References m_uuid.
Referenced by BOOST_AUTO_TEST_CASE(), and std::operator()().
void KIID::Increment | ( | ) |
bool KIID::IsLegacyTimestamp | ( | ) | const |
|
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 286 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 170 of file kiid.cpp.
References AsString(), and niluuid.
Referenced by searchAreas().
|
private |
Definition at line 128 of file kiid.h.
Referenced by AsLegacyTimestamp(), AsStdString(), AsString(), Clone(), ConvertTimestampToUuid(), Hash(), Increment(), IsLegacyTimestamp(), KIID(), operator!=(), operator<(), operator==(), and operator>().