DataDirector API
DDD_ConnectionEndpoint.h
Go to the documentation of this file.
1 #ifndef _DDD_ConnectionEndpoint_h_
2 #define _DDD_ConnectionEndpoint_h_
3 
4 /*! \file DDD_ConnectionEndpoint.h
5 
6  \par Copyright Information
7 
8  Copyright (c) 2012 The DiSTI Corporation.<br>
9  11301 Corporate Blvd; Suite 100<br>
10  Orlando, Florida 32817<br>
11  USA<br>
12  <br>
13  All rights reserved.<br>
14 
15  This Software contains proprietary trade secrets of DiSTI and may not be
16 reproduced, in whole or part, in any form, or by any means of electronic,
17 mechanical, or otherwise, without the written permission of DiSTI. Said
18 permission may be derived through the purchase of applicable DiSTI product
19 licenses which detail the distribution rights of this content and any
20 Derivative Works based on this or other copyrighted DiSTI Software.
21 
22  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
23 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
24 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
25 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
26 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
27 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
28 
29  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
30 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
31 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
32 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
33 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
34 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBLITY
35 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
36 EXCEED FIVE DOLLARS (US$5.00).
37 
38  The aforementioned terms and restrictions are governed by the laws of the
39 State of Florida and the United States of America.
40 
41 */
42 
43 #include "DDD_AssetBase.h"
44 #include "DDD_AttributeBase.h"
45 #include "DDD_AssetBase.h"
46 #include <string>
47 
48 namespace disti
49 {
50 
51 /** \brief The DDD_ConnectionEndpoint class. Endpoints are used as inputs and outputs to connections.
52  */
53 class DDD_EXPORT DDD_ConnectionEndpoint
54 {
55 public:
56  /** Constructor.
57  * \param attribute A pointer to the Attribute that will be connected
58  * \param converterPoint The name of the converter "pin" that this will be connected to
59  */
60  DDD_ConnectionEndpoint(DDD_AttributeBase *attribute, std::string converterPoint);
61 
62  /** Destructor */
64 
65  /** \return Returns true if this endpoint is valid, i.e. if it references
66  * a valid attribute of a valid, loaded asset.
67  */
68  bool Valid();
69 
70  /** \return Returns the name of the attribute associated with this endpoint */
71  std::string AttributeName();
72 
73  /** \return Returns the name of the asset associated with this endpoint */
74  std::string AssetName();
75 
76  /** \return Returns the name of the converter point associated with this endpoint */
77  std::string ConverterPointName();
78 
79  /** Set the converter point name for this endpoint
80  * \ param converterPoint The name of the converter "pin" this endpoint is connected to
81  */
82  void SetConverterPointName(const std::string& converterPoint);
83 
84  /** Set the attribute that this endpoint is connected to
85  * \param attribute Pointer to the attribute to connect to
86  */
87  void SetAttribute(DDD_AttributeBase *attribute);
88 
89  /** \return Returns a pointer to the attribute this endpoint is connected to */
90  DDD_AttributeBase* GetAttribute();
91 
92  /** Invalidates this endpoint, i.e. after this call this endpoint will no longer
93  * be associated with an instance of an attribute, it will be disconnected. */
94  void Invalidate();
95 
96  /** Called by the framework when an asset is deleted. If the attribute container (asset)
97  * specified matches the container for this endpoint, then the endpoint is invalidated
98  * \param attContainer The asset that is being deleted
99  * \return True if this endpoint was invalidated by this call
100  */
101  bool DisconnectAsset(DDD_AttributeContainer *attContainer);
102 
103  /** Called by the framework when an asset is renamed. If the asset specified in oldName
104  * matches the asset name associated with this endpoint, then the endpoint is updated to
105  * reference the newName
106  * \param oldname The old name of the asset
107  * \param newname The new name of the asset
108  */
109  void NotifyAssetNameChange(const std::string& oldname, const std::string& newname);
110 
111 private:
112  DDD_AttributeBase *_attribute; /**< The attribute associated with this endpoint, or NULL */
113  std::string _attributeName; /**< The name of the attribute associated with this endpoint */
114  std::string _assetName; /**< The name of the asset associated with this endpoint */
115  std::string _converterPointName; /**< The name of the converter point associated with this endpoint */
116 };
117 
118 /** \brief The DDD_EndpintList class. A list of DDD_Endpoints */
119 class DDD_EXPORT DDD_EndpointList : public DynamicPtrArray<DDD_ConnectionEndpoint*>
120 {
121 public:
122  /** Constructor */
124 
125  /** Returns which index within this EndpointList the attribute is at
126  * \param attr The attribute to find
127  * \return The (first) index the attribute is at or -1 if it is not in the list
128  */
129  int ConnectedAttributeIndex(DDD_AttributeBase *attr);
130 
131  /** \return Returns the number of times the specified attribute is referenced
132  * \param attr The attribute to search for
133  */
134  unsigned int NumberOfReferences(DDD_AttributeBase *attr);
135 };
136 
137 
138 } // end namespace disti
139 #endif
140 
DDD_AttributeContainer. A virtual interface class for containers of attributes.
Definition: DDD_AttributeBase.h:57
The DDD_EndpintList class. A list of DDD_Endpoints.
Definition: DDD_ConnectionEndpoint.h:119
A templated array of object pointers. The array dynamically resizes as needed.
Definition: dynamic_ptr_array.h:55
A virtual interface class for all DataDirector attribute types.
Definition: DDD_AttributeBase.h:87
The DDD_ConnectionEndpoint class. Endpoints are used as inputs and outputs to connections.
Definition: DDD_ConnectionEndpoint.h:53
The DDD_AssetBase class. Base class for Data Director assets.
DDD_EndpointList()
Definition: DDD_ConnectionEndpoint.h:123
Definition: AttributeChangedEmitter.h:46