ATLAS Offline Software
Loading...
Searching...
No Matches
HashMaker.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5/***************************************************************************
6 * Muon Calibration Identifiers
7 * -----------------------------------------
8 *
9 * Author : Martin Woudstra
10 * Creation Date: 03 May 2005
11 * Last Update : 09 May 2005
12 ***************************************************************************/
13
15
16#ifndef MUONCALIBIDENTIFIER_HASHMAKER_H
17# define MUONCALIBIDENTIFIER_HASHMAKER_H
18// std
19
20// other packages
21
22// this package
23
24// macro to create a full hash class implementation
25#define CREATE_HASH_CLASS(ClassName) \
26class ClassName { \
27public: \
28 ClassName() : m_data(UINT_MAX) {}; \
29 explicit ClassName( unsigned int dat ) : m_data(dat) {} \
30 operator unsigned int () const { \
31 return m_data; \
32 } \
33 const ClassName& operator=( const ClassName& rhs ) { \
34 m_data = rhs.m_data; \
35 return *this; \
36 } \
37 const ClassName& operator=( unsigned int rhs ) { \
38 m_data = rhs; \
39 return *this; \
40 } \
41 bool isValid() const { \
42 return m_data != UINT_MAX; \
43 } \
44private: \
45 unsigned int m_data; \
46};
47
48
49#endif // MUONCALIBIDENTIFIER_HASHMAKER_H