GL Studio C++ Runtime API
rso_interface_2.h
Go to the documentation of this file.
1/// \file rso_interface_2.h
2/// \brief Defines the RSO interface v2, which provides a generic way of accessing RSOs and other content, disti::RSOInterface2.
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_RSO_INTERFACE_2_H
40#define DISTI_INCLUDED_RSO_INTERFACE_2_H
41
42#include "rso_interface_1.h"
43
44namespace disti
45{
46////////////////////////////////////////////////////////////////////////////////
47// In order for the RSO to be discovered in a .DLL or .so file,
48// The following "C" funtions need to be defined.
49// They are only comments here.
50////////////////////////////////////////////////////////////////////////////////
51// RSOInterface1* CreateRSOInterface2_ClassNameHere()
52// Optionally:
53// const char* GlsDefaultClassName()
54////////////////////////////////////////////////////////////////////////////////
55
56/** The RSOInterface2 class defines an abstract interface to an RSO instance.
57 */
59{
60public:
61 ////////////////////////////////////////////////////////////////////////////////
62 // The RSO Interface methods
63 ////////////////////////////////////////////////////////////////////////////////
64 typedef unsigned int ResourceHandle; ///< Typedef for a unique resource identifier.
65
66 // Explicitly carry these methods forward from the base class, as we're creating overloads of them here.
69
70 /// Obtains a resource handle to a given named resource
71 /// This handle must be disposed of with the ReleaseResourceHandle method once it
72 /// is no longer needed.
73 /// If this method fails, the return value will not be a valid handle; this can
74 /// be determined by calling IsResourceHandleValid.
75 /// \param resourceName The resource name to create a handle for.
76 /// \return A handle to the desired resource.
77 virtual ResourceHandle CreateResourceHandle( const char* resourceName ) = 0;
78
79 /// Disposes of a resource handle.
80 /// \param resourceHandle The resource handle to release.
81 virtual void ReleaseResourceHandle( ResourceHandle resourceHandle ) = 0;
82
83 /// Checks if a given resource handle is valid.
84 /// \param resourceHandle The resource handle to check.
85 /// \return Whether or not the handle is valid.
86 virtual bool IsResourceHandleValid( ResourceHandle resourceHandle ) = 0;
87
88 /// Set the string value for a resource specified by handle
89 /// \param resourceHandle The handle of the resource to set.
90 /// \param resourceVal The new string value to set.
91 virtual void SetResource( ResourceHandle resourceHandle, const char* resourceVal ) = 0;
92
93 /// \return The string value for a resource specified by handle.
94 /// \param resourceHandle The handle to return the string value for.
95 virtual const char* GetResource( ResourceHandle resourceHandle ) = 0;
96
97 /// Set the value as an integer for a given named resource.
98 /// \param resourceName The name of the resource to set.
99 /// \param resourceVal The new integer value to set.
100 virtual void SetIntResource( const char* resourceName, long resourceVal ) = 0;
101
102 /// \return The value as an integer for a given named resource.
103 /// \param resourceName The name to return the integer value for.
104 virtual long GetIntResource( const char* resourceName ) = 0;
105
106 /// Set the value as an integer for a resource specified by handle.
107 /// \param handle The handle of the resource to set.
108 /// \param resourceVal The new integer value to set.
109 virtual void SetIntResource( ResourceHandle handle, long resourceVal ) = 0;
110
111 /// \return The value as an integer for a resource specified by handle.
112 /// \param resourceHandle The handle to return the integer value for.
113 virtual long GetIntResource( ResourceHandle resourceHandle ) = 0;
114
115 /// Set the value as a float for a given named resource.
116 /// \param resourceName The name of the resource to set.
117 /// \param resourceVal The new float value to set.
118 virtual void SetFloatResource( const char* resourceName, double resourceVal ) = 0;
119
120 /// \return The value as a float for a given named resource.
121 /// \param resourceName The name to return the float value for.
122 virtual double GetFloatResource( const char* resourceName ) = 0;
123
124 /// Set the value as a float for a resource specified by handle.
125 /// \param handle The handle of the resource to set.
126 /// \param resourceVal The new float value to set.
127 virtual void SetFloatResource( ResourceHandle handle, double resourceVal ) = 0;
128
129 /// \return The value as a float for a resource specified by handle.
130 /// \param resourceHandle The handle to return the integer value for.
131 virtual double GetFloatResource( ResourceHandle resourceHandle ) = 0;
132
133protected:
134 ////////////////////////////////////////////////////////////////////////////////
135 /// Protected destructor so it can't be deleted directly.
136 ////////////////////////////////////////////////////////////////////////////////
137 virtual ~RSOInterface2() {}
138};
139
140} // end namespace disti
141
142#endif
Definition: rso_interface_1.h:60
virtual void SetResource(const char *resourceName, const char *resourceVal)=0
virtual const char * GetResource(const char *resourceName)=0
Definition: rso_interface_2.h:59
virtual void SetFloatResource(const char *resourceName, double resourceVal)=0
virtual bool IsResourceHandleValid(ResourceHandle resourceHandle)=0
virtual const char * GetResource(ResourceHandle resourceHandle)=0
virtual void SetIntResource(ResourceHandle handle, long resourceVal)=0
virtual void SetFloatResource(ResourceHandle handle, double resourceVal)=0
virtual double GetFloatResource(ResourceHandle resourceHandle)=0
virtual void SetResource(ResourceHandle resourceHandle, const char *resourceVal)=0
virtual void ReleaseResourceHandle(ResourceHandle resourceHandle)=0
virtual void SetIntResource(const char *resourceName, long resourceVal)=0
virtual ~RSOInterface2()
Protected destructor so it can't be deleted directly.
Definition: rso_interface_2.h:137
virtual long GetIntResource(ResourceHandle resourceHandle)=0
virtual long GetIntResource(const char *resourceName)=0
virtual double GetFloatResource(const char *resourceName)=0
unsigned int ResourceHandle
Typedef for a unique resource identifier.
Definition: rso_interface_2.h:64
virtual ResourceHandle CreateResourceHandle(const char *resourceName)=0
Definition: bmpimage.h:46
Defines the RSO interface, which provides a generic way of accessing RSOs and other content,...