Lines Matching full:attributes
1 // attributes.cc
17 #include "attributes.h"
22 string Attributes::atNames[NUM_ATR];
23 int Attributes::numAttrs = 0;
24 //Attributes::staticInit Attributes::staticInitializer;
27 Attributes::Attributes(void) { in Attributes() function in Attributes
31 attributes = 0; in Attributes()
35 Attributes::Attributes(const uint64_t a) { in Attributes() function in Attributes
39 attributes = a; in Attributes()
43 Attributes::~Attributes(void) { in ~Attributes()
45 } // Attributes destructor in ~Attributes()
47 void Attributes::Setup(void) { in Setup()
55 Attributes::atNames[i] = temp.str(); in Setup()
65 } // Attributes::Setup() in Setup()
67 // Display current attributes to user
68 void Attributes::DisplayAttributes(void) { in DisplayAttributes()
76 cout << hex << attributes << dec << ". Set fields are:\n"; in DisplayAttributes()
78 if ((UINT64_C(1) << i) & attributes) { in DisplayAttributes()
87 } // Attributes::DisplayAttributes() in DisplayAttributes()
89 // Display attributes for a partition. Note that partNum is just passed for
91 void Attributes::ShowAttributes(const uint32_t partNum) { in ShowAttributes()
96 bitset = (UINT64_C(1) << bitNum) & attributes; in ShowAttributes()
102 } // Attributes::ShowAttributes in ShowAttributes()
105 void Attributes::ChangeAttributes(void) { in ChangeAttributes()
109 cout << "Known attributes are:\n"; in ChangeAttributes()
119 if (bitValue & attributes) { // bit is set in ChangeAttributes()
120 attributes &= ~bitValue; // so unset it in ChangeAttributes()
123 attributes |= bitValue; // so set it in ChangeAttributes()
128 } // Attributes::ChangeAttributes() in ChangeAttributes()
130 // Display all defined attributes on the screen (omits undefined bits).
131 void Attributes::ListAttributes(void) { in ListAttributes()
138 cout << bitNum << ": " << Attributes::GetAttributeName(bitNum) << "\n"; in ListAttributes()
140 } // Attributes::ListAttributes in ListAttributes()
142 // multifaceted attributes access
144 bool Attributes::OperateOnAttributes(const uint32_t partNum, const string& attributeOperator, const… in OperateOnAttributes()
148 ao_or, ao_nand, ao_xor, ao_assignall, // operate on all attributes (bitmask) in OperateOnAttributes()
164 cerr << "Unknown attributes operator: " << attributeOperator << endl; in OperateOnAttributes()
188 // assign all attributes at once in OperateOnAttributes()
189 case ao_assignall: attributes = attributeBitMask; break; in OperateOnAttributes()
193 case ao_or: attributes |= attributeBitMask; break; in OperateOnAttributes()
197 case ao_nand: attributes &= ~attributeBitMask; break; in OperateOnAttributes()
201 case ao_xor: attributes ^= attributeBitMask; break; in OperateOnAttributes()
206 << bool (attributeBitMask & attributes) << endl; in OperateOnAttributes()
214 } // Attributes::OperateOnAttributes() in OperateOnAttributes()
222 // Display attributes
223 ostream & operator<<(ostream & os, const Attributes & data) { in operator <<()