DataDirector API
DDD_AssetFactory.h
Go to the documentation of this file.
1 #ifndef _DDD_AssetFactory_h_
2 #define _DDD_AssetFactory_h_
3 
4 /*! \file DDD_AssetFactory.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_DynamicLibrary.h"
44 #include "DDD_AssetBase.h"
45 #include "DDD_StringList.h"
46 #include "DDD_LogFacade.h"
47 
48 namespace disti
49 {
50 class DDD_AssetLibrary;
51 
52 /** \brief The DDD_AssetFactory class. Factory for creating Data Director assets.
53  */
54 class DDD_EXPORT DDD_AssetFactory : public DDD_LogFacade
55 {
56 private:
57 
59 
60  AssetLibraryList _loadedLibs; /**< List of loaded asset libraries */
61 
62  /** Constructor. Only the static Instance() interface can create this */
64 
65  /** Intalls the built-in assets into the factory */
66  void InstallBuiltInAssets();
67 
68 public:
69 
70  /** Public interface to the singleton
71  * \return Returns a pointer to the singleton instance
72  */
73  static DDD_AssetFactory& Instance();
74 
75  /** Creates a new asset of the requested type
76  * \param className The name of the asset class to instantiate
77  * \param container The container that owns the asset
78  * \return Returns a pointer to instantiated asset, or null if asset cannot be instantiated
79  */
80  DDD_AssetBase* InstantiateNewAsset(const std::string& className,DDD_AssetContainer *container);
81 
82  /** Load the library file for the particular asset and install it in the factory
83  * \param className The class name of the asset
84  * \param libFileName The name of the DLL/.SO file that has the creator function
85  * \return True if the class was successfully installed in the factory
86  */
87  bool FindAsset(const std::string& className, std::string libFileName);
88 
89  /** \return Returns a list of known asset types that the factory can create
90  */
91  DDD_StringList GetKnownAssetTypes();
92 };
93 
94 
95 } // end namespace disti
96 
97 
98 #endif
99 
A templated array of objects. The array dynamically resizes as needed.
Definition: dynamic_array.h:61
A cross-platform class for loading dynamic link libraries and shared objects.
A virtual interface class for all DataDirector assets.
Definition: DDD_AssetBase.h:115
Facade to provide a simpler interface to the DDD_Log singleton. Its second purpose is for decoupling;...
Definition: DDD_LogFacade.h:50
The DDD_AssetFactory class. Factory for creating Data Director assets.
Definition: DDD_AssetFactory.h:54
The DDD_AssetBase class. Base class for Data Director assets.
A virtual interface class for containers of assets. Allows assets to find each other, exchange events and update attributes of each other.
Definition: DDD_AssetBase.h:80
Definition: AttributeChangedEmitter.h:46