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