OGS
Location.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include <cstddef>
5#include <iosfwd>
6
7#include "MeshEnums.h"
8
9#pragma once
10
11namespace MeshLib
12{
13
19{
20 std::size_t mesh_id;
22 std::size_t item_id;
23
24 Location(std::size_t meshid, MeshItemType itemtype, std::size_t itemid)
25 : mesh_id(meshid), item_type(itemtype), item_id(itemid){}
26};
27
29inline
30bool operator<(const Location& left, const Location& right)
31{
32 if (left.mesh_id != right.mesh_id)
33 {
34 return left.mesh_id < right.mesh_id;
35 }
36 if (left.item_type != right.item_type)
37 {
38 return left.item_type < right.item_type;
39 }
40 return left.item_id < right.item_id;
41}
42
43
44std::ostream& operator<<(std::ostream& os, Location const& l);
45
46} // namespace MeshLib
bool operator<(const Location &left, const Location &right)
Lexicographic order of Location.
Definition Location.h:30
std::ostream & operator<<(std::ostream &os, Element const &e)
Definition Element.cpp:97
std::size_t item_id
Definition Location.h:22
std::size_t mesh_id
Definition Location.h:20
Location(std::size_t meshid, MeshItemType itemtype, std::size_t itemid)
Definition Location.h:24
MeshItemType item_type
Definition Location.h:21