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