SST 15.0
Structural Simulation Toolkit
linkPair.h
1// Copyright 2009-2025 NTESS. Under the terms
2// of Contract DE-NA0003525 with NTESS, the U.S.
3// Government retains certain rights in this software.
4//
5// Copyright (c) 2009-2025, NTESS
6// All rights reserved.
7//
8// This file is part of the SST software package. For license
9// information, see the LICENSE file in the top level directory of the
10// distribution.
11
12#ifndef SST_CORE_LINKPAIR_H
13#define SST_CORE_LINKPAIR_H
14
15#include "sst/core/link.h"
16#include "sst/core/sst_types.h"
17
18namespace SST {
19
20/**
21 * Defines a pair of links (to define a connected link)
22 */
24{
25public:
26 /** Create a new LinkPair. This is used when the endpoints are in the same partition.
27 * @param order Value used to enforce the link order.
28 */
29 explicit LinkPair(LinkId_t order) :
30 left(new Link(order)),
31 right(new Link(order))
32 {
33 my_id = order;
34
35 left->pair_link = right;
36 right->pair_link = left;
37 }
38
39 /** Create a new LinkPair. This is used when the endpoints are in different partitions.
40 * @param order Value used to enforce the link order.
41 * @param remote_tag Used to look up the correct link on the other side.
42 */
43 LinkPair(LinkId_t order, LinkId_t remote_tag) :
44 left(new Link(remote_tag)),
45 right(new Link(order))
46 {
47 my_id = order;
48
49 left->pair_link = right;
50 right->pair_link = left;
51 }
52
53 virtual ~LinkPair() {}
54
55 /** Return the Left Link
56 * @return Left link
57 */
58 inline Link* getLeft() { return left; }
59
60 /** Return the Right Link
61 * @return Right link
62 */
63 inline Link* getRight() { return right; }
64
65private:
66 Link* left;
67 Link* right;
68
69 LinkId_t my_id;
70};
71
72} // namespace SST
73
74#endif // SST_CORE_LINKPAIR_H
Defines a pair of links (to define a connected link)
Definition linkPair.h:24
Link * getLeft()
Return the Left Link.
Definition linkPair.h:58
LinkPair(LinkId_t order)
Create a new LinkPair.
Definition linkPair.h:29
Link * getRight()
Return the Right Link.
Definition linkPair.h:63
LinkPair(LinkId_t order, LinkId_t remote_tag)
Create a new LinkPair.
Definition linkPair.h:43