|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "GaudiKernel/ServiceHandle.h"
13 #include "GaudiKernel/IMessageSvc.h"
14 #include "GaudiKernel/MsgStream.h"
20 #include "uuid/uuid.h"
44 catch (
const GaudiException& Exception) {
45 throw std::runtime_error(
46 "AthenaBarCodeImpl::Can not Set Counter Bit, Counter Overflow");
55 catch (
const GaudiException& Exception) {
56 throw std::runtime_error(
57 "AthenaBarCodeImpl::Can not initialize Reserve Bit");
66 catch (
const GaudiException& Exception) {
67 throw std::runtime_error(
68 "AthenaBarCodeImpl::Can not initialize Version Bit");
75 catch (
const GaudiException& Exception) {
76 throw std::runtime_error(
"AthenaBarCodeImpl::Can not set UUID Hash Bits");
103 if (
this != &
other) {
150 catch (
const GaudiException& Exception) {
151 throw std::runtime_error(
152 "AthenaBarCodeImpl::newVersion()::Version Overflow");
166 catch (
const GaudiException& Exception) {
167 throw std::runtime_error(
"AthenaBarCodeImpl::newVersion()::Version Too big");
176 out <<
"\n[AthenaBarCode]= " << std::hex << (
m_barcode) << std::dec << std::endl;
191 const int maxdigs = 16;
194 for (
int i = 0;
i < maxdigs;
i++) {
232 catch (
const GaudiException& Exception) {
233 throw std::runtime_error(
234 "AthenaBarCodeImpl::newVersion()::Version Overflow");
272 MsgStream
msg(
msgsvc,
"AthenaBarCodeImpl");
273 msg << MSG::WARNING <<
"setBits::bit to be set:" <<
id
274 <<
" is larger than limit:" << ((~
tmp2) >> (
TotalBits - nbits))
278 std::cout <<
"setBits::bit to be set:" <<
id <<
" is larger than limit:"
281 throw std::runtime_error(
"AthenaBarCodeImpl::setBit Failed");
325 const char* env_uuid =
getenv (
"_ATHENABARCODEIMPL_JOBUUID");
334 if (!
sc.isSuccess() || 0 == p_jobidsvc) {
338 uuid_generate(JobID);
345 PJobID_t pjobid = p_jobidsvc->getJobID();
void setReserveBits(AthenaBarCode_t id)
static std::atomic< AthenaBarCode_t > m_barcodeCounter
std::atomic< AthenaBarCode_t > m_barcode
static const AthenaBarCode_t UNDEFINEDBARCODE
const unsigned char * PJobID_t
static const unsigned short SUUIDBits
static AthenaBarCode_t hashUUID(const char *)
singleton-like access to IMessageSvc via open function and helper
static const unsigned short UUIDBits
static const unsigned short CounterBits
static const unsigned short SVersionBits
void setBits(unsigned short startbit, unsigned short nbits, AthenaBarCode_t id, AthenaBarCode_t &bc) const
AthenaBarCode_t getUUIDHash() const
void setAthenaBarCode(AthenaBarCode_t id)
@ u
Enums for curvilinear frames.
IMessageSvc * getMessageSvc(bool quiet=false)
AthenaBarCode_t hasUUIDHash() const
uint64_t AthenaBarCode_t
barcode for all INav4Mom classes
static const unsigned short TotalBits
static AthenaBarCode_t getDefaultHash(const char *jobid=nullptr)
::StatusCode StatusCode
StatusCode definition for legacy code.
AthenaBarCode_t getReserveBits() const
bool hasSameAthenaBarCodeExceptVersion(const IAthenaBarCode &obj) const
static const unsigned short SReserveBits
AthenaBarCode_t getBits(unsigned short startbit, unsigned short nbits) const
static const unsigned short SCounterBits
AthenaBarCode_t getAthenaBarCode() const
std::string getenv(const std::string &variableName)
get an environment variable
bool hasSameAthenaBarCode(const IAthenaBarCode &obj) const
static AthenaBarCode_t makeDefaultHash(const char *jobid)
static void setDefaultHash(const char *jobid)
AthenaBarCode_t AthenaBarCodeVersion_t
bool createdInCurrentJob() const
std::ostream & dump(std::ostream &out) const
static const unsigned short VersionBits
void setVersion(AthenaBarCodeVersion_t newversion)
AthenaBarCodeImpl & operator=(const AthenaBarCodeImpl &)
AthenaBarCodeVersion_t getVersion() const
static const unsigned short ReserveBits