HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UNI_Wire.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UNI_Wire.h ( UNI Library, C++)
7  *
8  * COMMENTS:
9  *
10  */
11 
12 #ifndef __UNI_Wire_h__
13 #define __UNI_Wire_h__
14 
15 #include "UNI_API.h"
16 #include "UNI_Item.h"
17 
18 // ============================================================================
19 class UNI_ConstWire : public UNI_ConstItem<UNI_WireID>
20 {
21 public:
22  /// Expose base class constructors.
24 
25  /// Returns the source end of the wire.
26  UNI_PortID src() const
27  { return graph() ? graph()->srcPort( id() ) : UNI_PortID(); }
28 
29  /// Returns the destination end of the wire.
30  UNI_PortID dst() const
31  { return graph() ? graph()->dstPort( id() ) : UNI_PortID(); }
32 };
33 
34 
35 // ============================================================================
36 class UNI_API UNI_Wire : public UNI_Item<UNI_WireID,
37  UNI_SessionWireID,
38  UNI_ConstWire>
39 {
40 public:
41  /// Expose base class constructors.
42  using UNI_Item::UNI_Item;
43 
44  /// Removes this wire from the graph.
45  void destroy();
46 };
47 
48 #endif
virtual UNI_PortID srcPort(UNI_WireID wire_id) const =0
#define UNI_API
Definition: UNI_API.h:11
UNI_Item()=default
Constructor.
virtual UNI_PortID dstPort(UNI_WireID wire_id) const =0
const UNI_Graph * graph() const
Returns the graph inside which the node lives.
Definition: UNI_Item.h:44
UNI_ConstItem()=default
Constructor.
UNI_PortID src() const
Returns the source end of the wire.
Definition: UNI_Wire.h:26
UNI_PortID dst() const
Returns the destination end of the wire.
Definition: UNI_Wire.h:30