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