| 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.*/
54 class LiveComponentAccessor
55{
56 public:
57 typedef void ( *CreateCb )( ComponentBase* ); ///< Typedef for an on create callback function pointer.
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 /// \param lib Pointer to the underlying library the component was loaded from.
71 /// \param className The generated class name for the component.
72 /// \param comp Pointer to the component reference.
73 /// \return A new LiveComponentAccessor object.
74 static GLS_EXPORT LiveComponentAccessor* CreateInstance( LiveComponentLibRef* lib, const char* className, ComponentBase* comp );
75
76 /// Clone the LiveComponentAccessor to apply to a new component instance.
77 /// \param newComp The component reference to make a clone from.
78 /// \return A new LiveComponentAccessor object.
79 virtual GLS_EXPORT LiveComponentAccessor* Clone( ComponentBase* newComp );
80
81 /// Deletes the LiveComponentAccessor, it's associated component, and the LiveComponentLibRef.
82 virtual GLS_EXPORT void Delete();
83
84 /// \return The RSO library version info.
85 GLS_EXPORT const GlsBuiltVersionInfo& BuiltVersion();
86
87 /// \return The RSO library path.
88 GLS_EXPORT const char* LoadedFilePath();
89
90 /// \return The RSO's class name.
91 GLS_EXPORT const char* LoadedClassName();
92};
93
94} // namespace disti
95
96#endif
disti::ComponentBase
Definition: component_base.h:68
disti::GlsBuiltVersionInfo2
Definition: gls_version.h:234
disti::LiveComponentAccessor
Definition: live_component_accessor.h:55
disti::LiveComponentAccessor::LoadedClassName
const char * LoadedClassName()
disti::LiveComponentAccessor::Clone
virtual LiveComponentAccessor * Clone(ComponentBase *newComp)
disti::LiveComponentAccessor::Delete
virtual void Delete()
Deletes the LiveComponentAccessor, it's associated component, and the LiveComponentLibRef.
disti::LiveComponentAccessor::BuiltVersion
const GlsBuiltVersionInfo & BuiltVersion()
disti::LiveComponentAccessor::LoadedFilePath
const char * LoadedFilePath()
disti::LiveComponentAccessor::CreateInstance
static LiveComponentAccessor * CreateInstance(LiveComponentLibRef *lib, const char *className, ComponentBase *comp)
disti::LiveComponentAccessor::CreateCb
void(* CreateCb)(ComponentBase *)
Typedef for an on create callback function pointer.
Definition: live_component_accessor.h:57
disti::LiveComponentLibRef
Definition: live_component_lib_ref.h:67
gls_include.h
A file for all GL Studio files to include.
GLS_EXPORT
#define GLS_EXPORT
Macro denoting which functions should be visible from the runtime library.
Definition: gls_include.h:52
gls_version.h
Used for matching version of libraries and headers.
disti
Definition: bmpimage.h:47