ATLAS Offline Software
|
#include <SCT_SerialNumber.h>
Public Member Functions | |
SCT_SerialNumber () | |
Default constructor produces an invalid serial number. More... | |
SCT_SerialNumber (const std::string &snString) | |
Construct from string of the full number. More... | |
SCT_SerialNumber (const unsigned long long fullSerialNumber) | |
Construct from full number (unsigned), which has to be a long long. More... | |
SCT_SerialNumber (const long long fullSerialNumber) | |
Construct from full number (signed), which has to be a long long. More... | |
SCT_SerialNumber (const unsigned int truncatedSerialNumber) | |
Construct from unsigned int, which can only hold the truncated serial number. More... | |
SCT_SerialNumber (const int truncatedSerialNumber) | |
Construct from int, which can only hold the truncated serial number. More... | |
conversions to other forms | |
unsigned int | m_truncatedNumber |
The truncated number holds the integer part after the '20220' of the serial number. More... | |
std::string | str () const |
Full serial number as a string More... | |
unsigned int | to_uint () const |
Truncated serial number as unsigned int. More... | |
unsigned long long | to_ulonglong () const |
Full serial number as long long. More... | |
operator unsigned int () const | |
Overload cast to uint. More... | |
bool | isWellFormed () const |
Cursory check on whether the serial number is well formed N.B. More... | |
bool | is_valid () const |
Until a better test is made, is_valid returns only whether its well formed. More... | |
SCT_SerialNumber is a class to hold a serial number and provide check on validity, and conversions between the different formats. In general, an SCT serial number is a unique 14 digit code assigned to each module and found on the module as a bar code. It always starts with 20220
Definition at line 22 of file SCT_SerialNumber.h.
SCT_SerialNumber::SCT_SerialNumber | ( | ) |
Default constructor produces an invalid serial number.
Definition at line 17 of file SCT_SerialNumber.cxx.
SCT_SerialNumber::SCT_SerialNumber | ( | const std::string & | snString | ) |
SCT_SerialNumber::SCT_SerialNumber | ( | const unsigned long long | fullSerialNumber | ) |
Construct from full number (unsigned), which has to be a long long.
Definition at line 29 of file SCT_SerialNumber.cxx.
SCT_SerialNumber::SCT_SerialNumber | ( | const long long | fullSerialNumber | ) |
Construct from full number (signed), which has to be a long long.
Definition at line 37 of file SCT_SerialNumber.cxx.
SCT_SerialNumber::SCT_SerialNumber | ( | const unsigned int | truncatedSerialNumber | ) |
Construct from unsigned int, which can only hold the truncated serial number.
Definition at line 46 of file SCT_SerialNumber.cxx.
SCT_SerialNumber::SCT_SerialNumber | ( | const int | truncatedSerialNumber | ) |
Construct from int, which can only hold the truncated serial number.
Definition at line 50 of file SCT_SerialNumber.cxx.
|
inline |
Until a better test is made, is_valid returns only whether its well formed.
Definition at line 72 of file SCT_SerialNumber.h.
bool SCT_SerialNumber::isWellFormed | ( | ) | const |
Cursory check on whether the serial number is well formed N.B.
this is deliberately not an 'is_valid' method since a check on validity would require more comprehensive validation.
Definition at line 81 of file SCT_SerialNumber.cxx.
SCT_SerialNumber::operator unsigned int | ( | ) | const |
Overload cast to uint.
Definition at line 76 of file SCT_SerialNumber.cxx.
std::string SCT_SerialNumber::str | ( | ) | const |
unsigned int SCT_SerialNumber::to_uint | ( | ) | const |
Truncated serial number as unsigned int.
Definition at line 67 of file SCT_SerialNumber.cxx.
unsigned long long SCT_SerialNumber::to_ulonglong | ( | ) | const |
Full serial number as long long.
Definition at line 72 of file SCT_SerialNumber.cxx.
|
private |
The truncated number holds the integer part after the '20220' of the serial number.
Definition at line 76 of file SCT_SerialNumber.h.