ATLAS Offline Software
Loading...
Searching...
No Matches
CoWRecord.h
Go to the documentation of this file.
1// --*- c++ -*--
2
3/*
4 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef COWTOOLS_RECORD
8#define COWTOOLS_RECORD
10
11namespace CoWTools{
12 class CoWRecord{
13 public:
14 CoWRecord(bool summary=true):
15 addrStart(0),
16 addrEnd(0),
17 perms(0),
18 offset(0),
19 inode(0),
20 m_ms(summary),
21 dmin(0),
22 dmaj(0)
23 {}
24 unsigned long addrStart,addrEnd;
25 short perms;
26 unsigned long long offset;
27 unsigned long inode;
29 unsigned int dmin,dmaj;
30 void parseRecord(std::istream& in);
31 public:
32 friend CoWRecord operator-(CoWRecord lhs, const CoWRecord& rhs){
33 return lhs-=rhs;
34 }
36 CoWRecord m(*this);
37 m.m_ms=-m_ms;
38 return m;
39 }
40 explicit operator bool() const {
41 auto vals=m_ms.getValueArray();
42 for(int i=0;i<11;i++){
43 if(vals[i])return true;
44 }
45 return false;
46 }
47
48 friend CoWRecord operator+(CoWRecord lhs, const CoWRecord& rhs){
49 return lhs+=rhs;
50 }
51
52 inline CoWRecord& operator+=(const CoWRecord& rhs){
53 perms|=rhs.perms;
54 m_ms+=rhs.m_ms;
55 return *this;
56 }
57
58 inline CoWRecord& operator-=(const CoWRecord& rhs){
59 perms^=rhs.perms;
60 m_ms-=rhs.m_ms;
61 return *this;
62 }
63 };
64
65}//end namespace
66
67#endif
unsigned long inode
Definition CoWRecord.h:27
void parseRecord(std::istream &in)
Definition CoWRecord.cxx:8
CoWRecord & operator-=(const CoWRecord &rhs)
Definition CoWRecord.h:58
friend CoWRecord operator-(CoWRecord lhs, const CoWRecord &rhs)
Definition CoWRecord.h:32
CoWRecord operator-() const
Definition CoWRecord.h:35
CoWRecordStats m_ms
Definition CoWRecord.h:28
unsigned int dmaj
Definition CoWRecord.h:29
unsigned long addrEnd
Definition CoWRecord.h:24
CoWRecord(bool summary=true)
Definition CoWRecord.h:14
unsigned long addrStart
Definition CoWRecord.h:24
CoWRecord & operator+=(const CoWRecord &rhs)
Definition CoWRecord.h:52
unsigned int dmin
Definition CoWRecord.h:29
unsigned long long offset
Definition CoWRecord.h:26
friend CoWRecord operator+(CoWRecord lhs, const CoWRecord &rhs)
Definition CoWRecord.h:48