SST 16.0.0
Structural Simulation Toolkit
linkPair.h
1// Copyright 2009-2026 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-2026, 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
28 @param id ID of the link
29 */
30 explicit LinkPair(LinkId_t id) :
31 left(new Link(id)),
32 right(new Link(id))
33 {
34 left->pair_link = right;
35 right->pair_link = left;
36 }
37
38 /** Create a new LinkPair. This is used on restart.
39
40 @param order Value used to enforce the link order.
41 */
43 left(new Link()),
44 right(new Link())
45 {
46 left->pair_link = right;
47 right->pair_link = left;
48 }
49
50
51 virtual ~LinkPair() {}
52
53 /** Return the Left Link
54 * @return Left link
55 */
56 inline Link* getLeft() { return left; }
57
58 /** Return the Right Link
59 * @return Right link
60 */
61 inline Link* getRight() { return right; }
62
63private:
64 Link* left;
65 Link* right;
66};
67
68} // namespace SST
69
70#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:56
LinkPair()
Create a new LinkPair.
Definition linkPair.h:42
Link * getRight()
Return the Right Link.
Definition linkPair.h:61
LinkPair(LinkId_t id)
Create a new LinkPair.
Definition linkPair.h:30