GL Studio C++ Runtime API
live_component_accessor.h
Go to the documentation of this file.
1/// \file live_component_accessor.h
2/// \brief The disti::LiveComponentAccessor class.
3///
4/// \par Copyright Information
5///
6/// Copyright (c) 2017 by The DiSTI Corporation.<br>
7/// 12249 Science Drive; Suite 300<br>
8/// Orlando, Florida 32826<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#ifndef DISTI_INCLUDED_LIVE_COMPONENT_ACCESSOR_H
40#define DISTI_INCLUDED_LIVE_COMPONENT_ACCESSOR_H
41
42#include "gls_include.h"
43#include "gls_version.h"
44#include <string>
45
46namespace disti
47{
48class LiveComponentLibRef;
49class ComponentBase;
50/** LiveComponentAccessor keeps the LiveComponent library loaded in the application.
51 * and stores the information necessary to safely delete the component.*/
53{
54public:
55 typedef void ( *CreateCb )( ComponentBase* ); ///< Typedef for an on create callback function pointer.
56
57private:
58 LiveComponentLibRef* _liveComponentLibRef; ///< Reference to the library the component was loaded from (freed by the LiveComponentAccessor).
59 std::string _className; ///< The ClassName of the component.
60 ComponentBase* _component; ///< The component to be freed by the LiveComponentAccessor.
61
62 //** Private constructor: see CreateInstance() */
63 GLS_EXPORT LiveComponentAccessor( LiveComponentLibRef* lib, const char* className, ComponentBase* comp );
65
66public:
67 /// Creates a LiveComponentAccessor and associates it with the given component.
68 /// \param lib Pointer to the underlying library the component was loaded from.
69 /// \param className The generated class name for the component.
70 /// \param comp Pointer to the component reference.
71 /// \return A new LiveComponentAccessor object.
73
74 /// Clone the LiveComponentAccessor to apply to a new component instance.
75 /// \param newComp The component reference to make a clone from.
76 /// \return A new LiveComponentAccessor object.
78
79 /// Deletes the LiveComponentAccessor, it's associated component, and the LiveComponentLibRef.
80 virtual GLS_EXPORT void Delete();
81
82 /// \return The RSO library version info.
84
85 /// \return The RSO library path.
87
88 /// \return The RSO's class name.
90};
91
92} // namespace disti
93
94#endif
Definition: component_base.h:67
Definition: gls_version.h:223
Definition: live_component_accessor.h:53
const char * LoadedClassName()
virtual LiveComponentAccessor * Clone(ComponentBase *newComp)
virtual void Delete()
Deletes the LiveComponentAccessor, it's associated component, and the LiveComponentLibRef.
const GlsBuiltVersionInfo & BuiltVersion()
static LiveComponentAccessor * CreateInstance(LiveComponentLibRef *lib, const char *className, ComponentBase *comp)
void(* CreateCb)(ComponentBase *)
Typedef for an on create callback function pointer.
Definition: live_component_accessor.h:55
Definition: live_component_lib_ref.h:66
A file for all GL Studio files to include.
#define GLS_EXPORT
Macro denoting which functions should be visible from the runtime library.
Definition: gls_include.h:50
Used for matching version of libraries and headers.
Definition: bmpimage.h:46