Skip to content

core.smartid #

smart id's

  • sid = smart id, is 3 to 6 letters, 0...z
  • gid = rid.cid.oid
  • rid = region id
  • cid = circle id
  • oid = object id
  • each of above id's are smart id's

fn cid #

fn cid(args_ CIDGet) !CID

get a circle id . circle's are unique per twin . params: .

name       string
cid_int    u32
cid_string string

returns circle ..

struct CID {
        circle u32
}

fn cid_core #

fn cid_core() CID

this is the cid for circle0

fn gid #

fn gid(args_ GIDNewArgs) !GID

get global unique id . params: .

gid_str  string // rid.cid.oid format
oid_int  int
oid_str  string // e.g. aaa, is 1...6 letter representation of a unique id
cid_int  int    // int representation of cid
cid_str  string // string representation of cid
cid_name string // chosen name of circle

fn gid_check #

fn gid_check(gid string) bool

check if format is [..5].[..5].[..5] . and [..5] is string return error if issue

fn gid_test #

fn gid_test(gid string) !

raise error if smartid not valid

struct CID #

struct CID {
pub mut:
	circle u32
}

fn (CID) u32 #

fn (cid CID) u32() u32

fn (CID) str #

fn (cid CID) str() string

fn (CID) name #

fn (cid CID) name() !string

fn (CID) gid #

fn (cid CID) gid(args OIDGetArgs) !GID

fn (CID) sids_replace #

fn (cid CID) sids_replace(txt string) !string

fn (CID) sids_acknowledge #

fn (cid CID) sids_acknowledge(txt string) !

struct CIDGet #

@[params]
struct CIDGet {
pub mut:
	name       string
	cid_int    u32
	cid_string string
}

struct GID #

struct GID {
pub mut:
	cid CID
mut:
	region u32
	id     u32
}

global smart if, represents an object on global level

fn (GID) oid #

fn (gid GID) oid() u32

object id in u32

fn (GID) ostr #

fn (gid GID) ostr() string

object id as string

fn (GID) str #

fn (gid GID) str() string

object id as string

struct GIDNewArgs #

@[params]
struct GIDNewArgs {
pub mut:
	gid_str  string // rid.cid.oid format
	oid_u32  u32
	oid_int  int
	oid_str  string // e.g. aaa, is 1...6 letter representation of a unique id
	cid_int  int    // int representation of cid
	cid_str  string // string representation of cid
	cid_name string // chosen name of circle
}

struct OIDGetArgs #

@[params]
struct OIDGetArgs {
pub mut:
	oid_int int    // int representation of cid
	oid_str string // string representation of cid
}