Loading [MathJax]/extensions/MathMenu.js
OGS
Location.h
Go to the documentation of this file.
1
13#include <cstddef>
14#include <iosfwd>
15
16#include "MeshEnums.h"
17
18#pragma once
19
20namespace MeshLib
21{
22
28{
29 std::size_t mesh_id;
31 std::size_t item_id;
32
33 Location(std::size_t meshid, MeshItemType itemtype, std::size_t itemid)
34 : mesh_id(meshid), item_type(itemtype), item_id(itemid){}
35};
36
38inline
39bool operator<(const Location& left, const Location& right)
40{
41 if (left.mesh_id != right.mesh_id)
42 {
43 return left.mesh_id < right.mesh_id;
44 }
45 if (left.item_type != right.item_type)
46 {
47 return left.item_type < right.item_type;
48 }
49 return left.item_id < right.item_id;
50}
51
52
53std::ostream& operator<<(std::ostream& os, Location const& l);
54
55} // namespace MeshLib
Definition of mesh-related Enumerations.
bool operator<(const Location &left, const Location &right)
Lexicographic order of Location.
Definition Location.h:39
std::ostream & operator<<(std::ostream &os, Element const &e)
Definition Element.cpp:88
std::size_t item_id
Definition Location.h:31
std::size_t mesh_id
Definition Location.h:29
Location(std::size_t meshid, MeshItemType itemtype, std::size_t itemid)
Definition Location.h:33
MeshItemType item_type
Definition Location.h:30