GL Studio C++ Runtime API
live_component_accessor.h
Go to the documentation of this file.
1 /*! \file
2  \brief The disti::LiveComponentAccessor class.
3 
4  \par Copyright Information
5 
6  Copyright (c) 2017 by The DiSTI Corporation.<br>
7  11301 Corporate Blvd; Suite 100<br>
8  Orlando, Florida 32817<br>
9  USA<br>
10  <br>
11  All rights reserved.<br>
12 
13  This Software contains proprietary trade secrets of DiSTI and may not be
14 reproduced, in whole or part, in any form, or by any means of electronic,
15 mechanical, or otherwise, without the written permission of DiSTI. Said
16 permission may be derived through the purchase of applicable DiSTI product
17 licenses which detail the distribution rights of this content and any
18 Derivative Works based on this or other copyrighted DiSTI Software.
19 
20  NO WARRANTY. THE SOFTWARE IS PROVIDED "AS-IS," WITHOUT WARRANTY OF ANY KIND,
21 AND ANY USE OF THIS SOFTWARE PRODUCT IS AT YOUR OWN RISK. TO THE MAXIMUM EXTENT
22 PERMITTED BY APPLICABLE LAW, DISTI AND ITS SUPPLIERS DISCLAIM ALL WARRANTIES
23 AND CONDITIONS, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
24 IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY AND/OR FITNESS FOR A
25 PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT, WITH REGARD TO THE SOFTWARE.
26 
27  LIMITATION OF LIABILITY. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW,
28 IN NO EVENT SHALL DISTI OR ITS SUPPLIERS BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
29 INDIRECT, OR CONSEQUENTIAL DAMAGES WHATSOEVER (INCLUDING, WITHOUT LIMITATION,
30 DAMAGES FOR LOSS OF BUSINESS PROFITS, BUSINESS INTERRUPTION, LOSS OF BUSINESS
31 INFORMATION, OR ANY OTHER PECUNIARY LOSS) ARISING OUT OF THE USE OF OR
32 INABILITY TO USE THE SOFTWARE, EVEN IF DISTI HAS BEEN ADVISED OF THE POSSIBILITY
33 OF SUCH DAMAGES. DISTI'S ENTIRE LIABILITY AND YOUR EXCLUSIVE REMEDY SHALL NOT
34 EXCEED FIVE DOLLARS (US$5.00).
35 
36  The aforementioned terms and restrictions are governed by the laws of the
37 State of Florida and the United States of America.
38 
39 */
40 
41 #ifndef _LIVE_COMPONENT_ACCESSOR_H
42 #define _LIVE_COMPONENT_ACCESSOR_H
43 
44 #include "gls_include.h"
45 #include "gls_version.h"
46 #include <string>
47 
48 namespace disti
49 {
50 class LiveComponentLibRef;
51 class ComponentBase;
52 /** LiveComponentAccessor keeps the LiveComponent library loaded in the application.
53  * and stores the information necessary to safely delete the component.*/
55 {
56 public:
57  typedef void ( *CreateCb )( ComponentBase* );
58 
59 private:
60  LiveComponentLibRef* _liveComponentLibRef; //< Reference to the library the component was loaded from (freed by the LiveComponentAccessor)
61  std::string _className; //< The ClassName of the component
62  ComponentBase* _component; //< The component to be freed by the LiveComponentAccessor
63 
64  //** Private constructor: see CreateInstance() */
65  GLS_EXPORT LiveComponentAccessor( LiveComponentLibRef* lib, const char* className, ComponentBase* comp );
66  virtual GLS_EXPORT ~LiveComponentAccessor();
67 
68 public:
69  /** Creates a LiveComponentAccessor and associates it with the given component. */
70  static GLS_EXPORT LiveComponentAccessor* CreateInstance( LiveComponentLibRef* lib, const char* className, ComponentBase* comp );
71 
72  /** Clone the LiveComponentAccessor to apply to a new component instance */
73  virtual GLS_EXPORT LiveComponentAccessor* Clone( ComponentBase* newComp );
74 
75  /** Deletes the LiveComponentAccessor, it's associated component, and the LiveComponentLibRef. */
76  virtual GLS_EXPORT void Delete();
77 
78  /** Returns the RSO library version info */
79  GLS_EXPORT const GlsBuiltVersionInfo& BuiltVersion();
80 
81  /** Returns the RSO library path */
82  GLS_EXPORT const char* LoadedFilePath();
83 
84  /** Returns the RSO's class name */
85  GLS_EXPORT const char* LoadedClassName();
86 };
87 
88 } // namespace disti
89 
90 #endif
Definition: live_component_lib_ref.h:66
const char * LoadedClassName()
A file for all GL Studio files to include.
Used for matching version of libraries and headers.
Definition: component_base.h:67
virtual LiveComponentAccessor * Clone(ComponentBase *newComp)
static LiveComponentAccessor * CreateInstance(LiveComponentLibRef *lib, const char *className, ComponentBase *comp)
Definition: gls_version.h:210
const GlsBuiltVersionInfo & BuiltVersion()
Definition: live_component_accessor.h:54
Definition: bmpimage.h:46