https://mooseframework.inl.gov
Public Types | Public Member Functions | Private Attributes | List of all members
AttribSorted Class Referenceabstract

This attribute describes sorting state. More...

#include <TheWarehouse.h>

Inheritance diagram for AttribSorted:
[legend]

Public Types

typedef bool Key
 

Public Member Functions

void setFrom (const Key &k)
 
 AttribSorted (TheWarehouse &w)
 
 AttribSorted (TheWarehouse &w, bool is_sorted)
 
 AttribSorted (const AttribSorted &)=default
 
 AttribSorted (AttribSorted &&)=default
 
AttribSortedoperator= (const AttribSorted &)=default
 
AttribSortedoperator= (AttribSorted &&)=default
 
virtual void initFrom (const MooseObject *obj) override
 initFrom reads and stores the desired meta-data from obj for later matching comparisons. More...
 
virtual bool isMatch (const Attribute &other) const override
 isMatch returns true if the meta-data stored in this attribute is equivalent to that stored in other. More...
 
virtual bool isEqual (const Attribute &other) const override
 isEqual returns true if the meta-data stored in this attribute is identical to that stored in other. More...
 
 hashfunc (_val)
 
 clonefunc (AttribSorted)
 
bool operator== (const Attribute &other) const
 
bool operator!= (const Attribute &other) const
 
unsigned int id () const
 returns the unique attribute ID associated with all attributes that have the same (mose derived) class as this object. More...
 
virtual std::size_t hash () const =0
 This function must return a deterministic value that is uniquely determined by the data the attribute holds (i.e. More...
 
virtual std::unique_ptr< Attributeclone () const =0
 clone creates and returns and identical (deep) copy of this attribute - i.e. More...
 

Private Attributes

bool _val
 
bool _initd
 

Detailed Description

This attribute describes sorting state.

Definition at line 112 of file TheWarehouse.h.

Member Typedef Documentation

◆ Key

typedef bool AttribSorted::Key

Definition at line 115 of file TheWarehouse.h.

Constructor & Destructor Documentation

◆ AttribSorted() [1/4]

AttribSorted::AttribSorted ( TheWarehouse w)
inline

Definition at line 118 of file TheWarehouse.h.

118 : Attribute(w, "sorted"), _val(false), _initd(false) {}
Attribute(TheWarehouse &w, const std::string name)
Constructs/initializes a new attribute with the specified name for use in warehouse w...
Definition: TheWarehouse.C:36

◆ AttribSorted() [2/4]

AttribSorted::AttribSorted ( TheWarehouse w,
bool  is_sorted 
)
inline

Definition at line 119 of file TheWarehouse.h.

120  : Attribute(w, "sorted"), _val(is_sorted), _initd(true)
121  {
122  }
Attribute(TheWarehouse &w, const std::string name)
Constructs/initializes a new attribute with the specified name for use in warehouse w...
Definition: TheWarehouse.C:36
constexpr bool is_sorted()
Check if the given index sequence is sorted ()internal function)

◆ AttribSorted() [3/4]

AttribSorted::AttribSorted ( const AttribSorted )
default

◆ AttribSorted() [4/4]

AttribSorted::AttribSorted ( AttribSorted &&  )
default

Member Function Documentation

◆ clone()

virtual std::unique_ptr<Attribute> Attribute::clone ( ) const
pure virtualinherited

clone creates and returns and identical (deep) copy of this attribute - i.e.

the result of clone should return true if passed into isMatch.

Referenced by TheWarehouse::update().

◆ clonefunc()

AttribSorted::clonefunc ( AttribSorted  )

◆ hash()

virtual std::size_t Attribute::hash ( ) const
pure virtualinherited

This function must return a deterministic value that is uniquely determined by the data the attribute holds (i.e.

is initialized with). Ideally, the data should be uniformly and randomly distributed across the domain of size_t values - e.g. 1 and 2 should hash to completely unrelated values. Use of std::hash for POD is encouraged. A convenience hash_combine function is also provided to combine the results an existing hash with one or more other values.

Referenced by std::hash< Attribute >::operator()().

◆ hashfunc()

AttribSorted::hashfunc ( _val  )

◆ id()

unsigned int Attribute::id ( ) const
inlineinherited

returns the unique attribute ID associated with all attributes that have the same (mose derived) class as this object.

This ID is determined at construction time this

Definition at line 67 of file TheWarehouse.h.

Referenced by std::hash< Attribute >::operator()().

67 { return _id; }

◆ initFrom()

void AttribSorted::initFrom ( const MooseObject obj)
overridevirtual

initFrom reads and stores the desired meta-data from obj for later matching comparisons.

Implements Attribute.

Definition at line 39 of file TheWarehouse.C.

40 {
41 }

◆ isEqual()

bool AttribSorted::isEqual ( const Attribute other) const
overridevirtual

isEqual returns true if the meta-data stored in this attribute is identical to that stored in other.

isEqual does not need to check/compare the values from the instances' id() functions.

Implements Attribute.

Definition at line 51 of file TheWarehouse.C.

52 {
53  return isMatch(other);
54 }
virtual bool isMatch(const Attribute &other) const override
isMatch returns true if the meta-data stored in this attribute is equivalent to that stored in other...
Definition: TheWarehouse.C:44

◆ isMatch()

bool AttribSorted::isMatch ( const Attribute other) const
overridevirtual

isMatch returns true if the meta-data stored in this attribute is equivalent to that stored in other.

This is is for query matching - not exact equivalence. isMatch does not need to check/compare the values from the instances' id() functions.

Implements Attribute.

Definition at line 44 of file TheWarehouse.C.

Referenced by isEqual().

45 {
46  auto a = dynamic_cast<const AttribSorted *>(&other);
47  return _initd && a && a->_initd && (a->_val == _val);
48 }
This attribute describes sorting state.
Definition: TheWarehouse.h:112

◆ operator!=()

bool Attribute::operator!= ( const Attribute other) const
inlineinherited

Definition at line 62 of file TheWarehouse.h.

62 { return !(*this == other); }

◆ operator=() [1/2]

AttribSorted& AttribSorted::operator= ( const AttribSorted )
default

◆ operator=() [2/2]

AttribSorted& AttribSorted::operator= ( AttribSorted &&  )
default

◆ operator==()

bool Attribute::operator== ( const Attribute other) const
inlineinherited

Definition at line 58 of file TheWarehouse.h.

59  {
60  return _id == other._id && isEqual(other);
61  }
virtual bool isEqual(const Attribute &other) const =0
isEqual returns true if the meta-data stored in this attribute is identical to that stored in other...

◆ setFrom()

void AttribSorted::setFrom ( const Key k)
inline

Definition at line 116 of file TheWarehouse.h.

116 { _val = k; }

Member Data Documentation

◆ _initd

bool AttribSorted::_initd
private

Definition at line 136 of file TheWarehouse.h.

Referenced by isMatch().

◆ _val

bool AttribSorted::_val
private

Definition at line 135 of file TheWarehouse.h.

Referenced by isMatch(), and setFrom().


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