DataDirector API
DDD_AssetList.h
Go to the documentation of this file.
1 #ifndef _DDD_AssetList_h_
2 #define _DDD_AssetList_h_
3 
4 /*! \file DDD_AssetList.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 "dynamic_ptr_array.h"
44 #include "DDD_AssetBase.h"
45 
46 namespace disti
47 {
48 
49 /** \brief The DDD_AssetList class. Maintains a list of Data Director assets.
50  */
51 class DDD_EXPORT DDD_AssetList : public DynamicPtrArray<DDD_AssetBase*>
52 {
53 public:
54  /** Constructor */
55  DDD_AssetList();
56 
57  /** Destructor
58  * The DDD_AssetList does NOT manage the storage of its assets.
59  * Prior to calling this destructor, the calling code should free
60  * all of the assets in this list.
61  */
62  ~DDD_AssetList();
63 
64  /** \return Returns a pointer to the asset with the given instance name
65  * Returns NULL if the asset is not found
66  * \param name The name of the asset to find
67  */
68  DDD_AssetBase *Find(const std::string &name);
69 
70  /** Searches list for asset with given instance name; unlike Find(), this is const-safe
71  * \param name The name of the asset to find
72  * \return true if asset with matching instance name found; false otherwise
73  */
74  bool InList(const std::string &name) const;
75 
76  /** Finds the asset with the given name and replaces it with the supplied asset
77  * \param name The name of the asset to find
78  * \param newAsset Pointer to the asset that will replace the asset
79  */
80  void Replace(const std::string &name,DDD_AssetBase *newAsset);
81 
82  /** Moves an asset "UP" in the list, which means it gets moved further towards
83  * the end of the list. (It moves "UP" in draw order so it draws later)
84  * \param newAsset The asset to reorder
85  * \return True if if the asset was moved, false otherwise
86  */
87  bool MoveUp(DDD_AssetBase *newAsset);
88 
89  /** Moves an asset "DOWN" in the list, which means it gets moved closer towards
90  * the beginning of the list. (It moves "DOWN" in draw order so it draws earlier)
91  * \param newAsset The asset to reorder
92  * \return True if if the asset was moved, false otherwise
93  */
94  bool MoveDown(DDD_AssetBase *newAsset);
95 };
96 
97 } // namespace disti
98 #endif
99 
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 assets.
Definition: DDD_AssetBase.h:115
The DDD_AssetList class. Maintains a list of Data Director assets.
Definition: DDD_AssetList.h:51
The DDD_AssetBase class. Base class for Data Director assets.
The disti::DynamicPtrArray class. A templated array of objects pointers capable of dynamically growin...
Definition: AttributeChangedEmitter.h:46