TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
flag128 Class Reference

#include <Util.h>

Public Member Functions

 flag128 (uint32 p1=0, uint32 p2=0, uint32 p3=0, uint32 p4=0)
 
bool IsEqual (uint32 p1=0, uint32 p2=0, uint32 p3=0, uint32 p4=0) const
 
bool HasFlag (uint32 p1=0, uint32 p2=0, uint32 p3=0, uint32 p4=0) const
 
void Set (uint32 p1=0, uint32 p2=0, uint32 p3=0, uint32 p4=0)
 
bool operator< (const flag128 &right) const
 
bool operator== (const flag128 &right) const
 
bool operator!= (const flag128 &right) const
 
flag128operator= (const flag128 &right)
 
flag128 operator& (const flag128 &right) const
 
flag128operator&= (const flag128 &right)
 
flag128 operator| (const flag128 &right) const
 
flag128operator|= (const flag128 &right)
 
flag128 operator~ () const
 
flag128 operator^ (const flag128 &right) const
 
flag128operator^= (const flag128 &right)
 
 operator bool () const
 
bool operator! () const
 
uint32operator[] (uint8 el)
 
const uint32operator[] (uint8 el) const
 

Private Attributes

uint32 part [4]
 

Constructor & Destructor Documentation

flag128::flag128 ( uint32  p1 = 0,
uint32  p2 = 0,
uint32  p3 = 0,
uint32  p4 = 0 
)
inline
369  {
370  part[0] = p1;
371  part[1] = p2;
372  part[2] = p3;
373  part[3] = p4;
374  }
uint32 part[4]
Definition: Util.h:365

Member Function Documentation

bool flag128::HasFlag ( uint32  p1 = 0,
uint32  p2 = 0,
uint32  p3 = 0,
uint32  p4 = 0 
) const
inline
382  {
383  return (part[0] & p1 || part[1] & p2 || part[2] & p3 || part[3] & p4);
384  }
uint32 part[4]
Definition: Util.h:365
bool flag128::IsEqual ( uint32  p1 = 0,
uint32  p2 = 0,
uint32  p3 = 0,
uint32  p4 = 0 
) const
inline
377  {
378  return (part[0] == p1 && part[1] == p2 && part[2] == p3 && part[3] == p4);
379  }
uint32 part[4]
Definition: Util.h:365
flag128::operator bool ( ) const
inline
482  {
483  return (part[0] != 0 || part[1] != 0 || part[2] != 0 || part[3] != 0);
484  }
uint32 part[4]
Definition: Util.h:365
bool flag128::operator! ( ) const
inline
487  {
488  return !this->operator bool();
489  }
#define bool
Definition: CascPort.h:16
bool flag128::operator!= ( const flag128 right) const
inline
418  {
419  return !this->operator ==(right);
420  }
bool operator==(const flag128 &right) const
Definition: Util.h:406

+ Here is the call graph for this function:

flag128 flag128::operator& ( const flag128 right) const
inline
432  {
433  return flag128(part[0] & right.part[0], part[1] & right.part[1],
434  part[2] & right.part[2], part[3] & right.part[3]);
435  }
uint32 part[4]
Definition: Util.h:365
flag128(uint32 p1=0, uint32 p2=0, uint32 p3=0, uint32 p4=0)
Definition: Util.h:368
flag128& flag128::operator&= ( const flag128 right)
inline
438  {
439  part[0] &= right.part[0];
440  part[1] &= right.part[1];
441  part[2] &= right.part[2];
442  part[3] &= right.part[3];
443  return *this;
444  }
uint32 part[4]
Definition: Util.h:365
bool flag128::operator< ( const flag128 right) const
inline
395  {
396  for (uint8 i = 4; i > 0; --i)
397  {
398  if (part[i - 1] < right.part[i - 1])
399  return true;
400  else if (part[i - 1] > right.part[i - 1])
401  return false;
402  }
403  return false;
404  }
uint32 part[4]
Definition: Util.h:365
uint8_t uint8
Definition: Define.h:152
flag128& flag128::operator= ( const flag128 right)
inline
423  {
424  part[0] = right.part[0];
425  part[1] = right.part[1];
426  part[2] = right.part[2];
427  part[3] = right.part[3];
428  return *this;
429  }
uint32 part[4]
Definition: Util.h:365
bool flag128::operator== ( const flag128 right) const
inline
407  {
408  return
409  (
410  part[0] == right.part[0] &&
411  part[1] == right.part[1] &&
412  part[2] == right.part[2] &&
413  part[3] == right.part[3]
414  );
415  }
uint32 part[4]
Definition: Util.h:365
uint32& flag128::operator[] ( uint8  el)
inline
492  {
493  return part[el];
494  }
uint32 part[4]
Definition: Util.h:365
const uint32& flag128::operator[] ( uint8  el) const
inline
497  {
498  return part[el];
499  }
uint32 part[4]
Definition: Util.h:365
flag128 flag128::operator^ ( const flag128 right) const
inline
467  {
468  return flag128(part[0] ^ right.part[0], part[1] ^ right.part[1],
469  part[2] ^ right.part[2], part[3] ^ right.part[3]);
470  }
uint32 part[4]
Definition: Util.h:365
flag128(uint32 p1=0, uint32 p2=0, uint32 p3=0, uint32 p4=0)
Definition: Util.h:368
flag128& flag128::operator^= ( const flag128 right)
inline
473  {
474  part[0] ^= right.part[0];
475  part[1] ^= right.part[1];
476  part[2] ^= right.part[2];
477  part[3] ^= right.part[3];
478  return *this;
479  }
uint32 part[4]
Definition: Util.h:365
flag128 flag128::operator| ( const flag128 right) const
inline
447  {
448  return flag128(part[0] | right.part[0], part[1] | right.part[1],
449  part[2] | right.part[2], part[3] | right.part[3]);
450  }
uint32 part[4]
Definition: Util.h:365
flag128(uint32 p1=0, uint32 p2=0, uint32 p3=0, uint32 p4=0)
Definition: Util.h:368
flag128& flag128::operator|= ( const flag128 right)
inline
453  {
454  part[0] |= right.part[0];
455  part[1] |= right.part[1];
456  part[2] |= right.part[2];
457  part[3] |= right.part[3];
458  return *this;
459  }
uint32 part[4]
Definition: Util.h:365
flag128 flag128::operator~ ( ) const
inline
462  {
463  return flag128(~part[0], ~part[1], ~part[2], ~part[3]);
464  }
uint32 part[4]
Definition: Util.h:365
flag128(uint32 p1=0, uint32 p2=0, uint32 p3=0, uint32 p4=0)
Definition: Util.h:368
void flag128::Set ( uint32  p1 = 0,
uint32  p2 = 0,
uint32  p3 = 0,
uint32  p4 = 0 
)
inline
387  {
388  part[0] = p1;
389  part[1] = p2;
390  part[2] = p3;
391  part[3] = p4;
392  }
uint32 part[4]
Definition: Util.h:365

Member Data Documentation

uint32 flag128::part[4]
private

The documentation for this class was generated from the following file: