MetaID

class omexmeta::MetaID

an ID generator

Public Functions

MetaID(std::string base, long start_number, int num_digits = 4)

an ID generator used when creating IDs in the Editor.

Parameters
  • base_ – the constant portion of the id. Like semsim in semsim00001

  • start_number_ – the start_number portion of the id, like 1 in semsim00001

  • num_digits – specifies the start_number of digits to use in the id. So semsim00001 has 5 digits.

bool operator==(const MetaID &rhs) const
bool operator!=(const MetaID &rhs) const
std::string generate() const

generate the string for a metaid

Returns

a metaid defined by the parameters in instantiation

std::string generate(long n) const

generate the string for a metaid

Parameters

number – of digits

Returns

a metaid defined by the parameters in instantiation

int maxNumber() const

figure out the max number possible with user parameters

Returns

the maximum possible number with user parameters

Public Static Functions

static int countDigits(long long int n)

count the digits in a number

Parameters

n – the number to count digits in

Returns

the number of digits in n

Private Members

std::string base_
long start_number_
int num_digits_