Microflow 3D  v1.0
NodeID.h
Go to the documentation of this file.
1 // ==============================================================================================
2 // Microflow 3D, http://www.microflow.pwr.edu.pl/
3 // Created by Roman Szafran on 01.06.19.
4 // Copyright (c) 2019 Wroclaw University of Science and Technology.
5 // Distributed under the Apache License, Version 2.0. You may obtain a copy of the License at
6 // http://www.apache.org/licenses/LICENSE-2.0 or see accompanying file license.txt.
7 // Redistributions of source code must retain the above copyright and license notice.
8 // ==============================================================================================
9 
10 # pragma once
11 
12 #include <cstdint>
13 
14 namespace MF {
15  namespace GB {
16 
18  class NodeID {
19  public:
20  // Coding/decoding structure
21  union {
22  struct {
23  uint16_t nodeType :16;
24  uint16_t uidThreadNr :16;
25  uint16_t ThreadCount :16;
26  uint8_t ComponentNr :8;
27  uint8_t PhaseNr :8;
28  } Node;
29  uint64_t NodeID;
30  } node_id {};
31 
32  NodeID() {
33  node_id.NodeID = {0};
34  }
35  ~NodeID() = default;
36  };
37 
38  } /* End of namespace GB */
39 } /* End of namespace MF */
struct MF::GB::NodeID::@0::@1 Node
uint8_t ComponentNr
Definition: NodeID.h:26
A class that allows to determine the proper NodeID from combined nodeType, uidThreadNr, ThreadCount, ComponentNr and PhaseNr.
Definition: NodeID.h:18
uint16_t ThreadCount
Definition: NodeID.h:25
uint16_t uidThreadNr
Definition: NodeID.h:24
uint8_t PhaseNr
Definition: NodeID.h:27
uint64_t NodeID
Definition: NodeID.h:29
union MF::GB::NodeID::@0 node_id
~NodeID()=default
uint16_t nodeType
Definition: NodeID.h:23